diff --git a/.github/.test/samples.json b/.github/.test/samples.json index 1f753ac8fc3..d756cc45dfd 100644 --- a/.github/.test/samples.json +++ b/.github/.test/samples.json @@ -1244,6 +1244,30 @@ "Client: TypeScript" ] }, + { + "input": "typescript-nestjs-v6-petstore-not-provided-in-root-with-npm.sh", + "matches": [ + "Client: TypeScript" + ] + }, + { + "input": "typescript-nestjs-v6-petstore-not-provided-in-root.sh", + "matches": [ + "Client: TypeScript" + ] + }, + { + "input": "typescript-nestjs-v6-petstore-provided-in-root-with-npm.sh", + "matches": [ + "Client: TypeScript" + ] + }, + { + "input": "typescript-nestjs-v6-petstore-provided-in-root.sh", + "matches": [ + "Client: TypeScript" + ] + }, { "input": "typescript-node-petstore-with-npm.sh", "matches": [ diff --git a/.gitignore b/.gitignore index ebe0dc1ff9c..b56824e26e3 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ packages/ .vscode/ **/.vs .factorypath +.metals/* .settings diff --git a/CI/.drone.yml b/CI/.drone.yml index 7df20d5e7f2..49495e43094 100644 --- a/CI/.drone.yml +++ b/CI/.drone.yml @@ -2,6 +2,11 @@ kind: pipeline name: default steps: +# test nim client +- name: nim-client-test + image: nimlang/nim + commands: + - (cd samples/client/petstore/nim/ && nim c sample_client.nim) # test protobuf schema generator - name: protobuf-schema-test image: nanoservice/protobuf-go diff --git a/README.md b/README.md index 1a12fb8b928..90e9fdeaea8 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ If you find OpenAPI Generator useful for work, please consider asking your compa [](https://docspring.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor) [](https://datadoghq.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor) [](https://cpl.thalesgroup.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor) +[](https://www.apideck.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 @@ -76,7 +77,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se | | Languages/Frameworks | | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, 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** (rust, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 8.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs) | +| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, 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** (rust, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 8.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, Rxjs) | | **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (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** | | **Configuration files** | [**Apache2**](https://httpd.apache.org/) | @@ -671,6 +672,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [Vouchery.io](https://vouchery.io) - [Xero](https://www.xero.com/) - [Yahoo Japan](https://www.yahoo.co.jp/) +- [viadee](https://www.viadee.de/) - [Vonage](https://vonage.com) - [YITU Technology](https://www.yitutech.com/) - [Yelp](https://www.yelp.com/) @@ -809,6 +811,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2020-12-09 - [プロジェクトにOpenAPI Generatorで自動生成された型付きAPI Clientを導入した話](https://qiita.com/yoshifujiT/items/905c18700ede23f40840) by [@yoshifujiT](https://github.com/yoshifujiT) - 2020-12-15 - [Next.js + NestJS + GraphQLで変化に追従するフロントエンドへ 〜 ショッピングクーポンの事例紹介](https://techblog.yahoo.co.jp/entry/2020121530052952/) by [小倉 陸](https://github.com/ogugu9) at [Yahoo! JAPAN Tech Blog](https://techblog.yahoo.co.jp/) - 2021-01-08 - [Hello, New API – Part 1](https://www.nginx.com/blog/hello-new-api-part-1/) by [Jeremy Schulman](https://www.nginx.com/people/jeremy-schulman/) at [Major League Baseball](https://www.mlb.com) +- 2021-01-18 - [「アプリ開発あるある」を疑うことから始まった、API Clientコードの自動生成【デブスト2020】](https://codezine.jp/article/detail/13406?p=2) by [CodeZine編集部](https://codezine.jp/author/1) ## [6 - About Us](#table-of-contents) @@ -902,10 +905,11 @@ Here is a list of template creators: * TypeScript (Angular7): @topce * TypeScript (Axios): @nicokoenig * TypeScript (Fetch): @leonyu + * TypeScript (Inversify): @gualtierim * TypeScript (jQuery): @bherila + * TypeScript (Nestjs): @vfrank66 * TypeScript (Node): @mhardorf * TypeScript (Rxjs): @denyo - * TypeScript (Inversify): @gualtierim * TypeScript (redux-query): @petejohansonxo * Server Stubs * Ada: @stcarrez diff --git a/appveyor.yml b/appveyor.yml index 24610d9100e..b12d075eb40 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -46,6 +46,8 @@ build_script: - dotnet build samples\client\petstore\csharp-netcore\OpenAPIClientCore\Org.OpenAPITools.sln # build C# API client (.net framework 4.7) - dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-net47\Org.OpenAPITools.sln + # build C# API client (.net 5.0) + - dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-net5.0\Org.OpenAPITools.sln # build C# API client - nuget restore samples\client\petstore\csharp\OpenAPIClient\Org.OpenAPITools.sln - msbuild samples\client\petstore\csharp\OpenAPIClient\Org.OpenAPITools.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" @@ -65,6 +67,8 @@ test_script: - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj # test C# API client (.net framework 4.7) - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-net47\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj + # test C# API client (.net 5.0) + - dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-net5.0\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj # test c# API client - nunit3-console samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\bin\Debug\Org.OpenAPITools.Test.dll --result=myresults.xml;format=AppVeyor # test c# API client (with PropertyChanged) diff --git a/bin/configs/csharp-netcore-OpenAPIClient-net50.yaml b/bin/configs/csharp-netcore-OpenAPIClient-net50.yaml new file mode 100644 index 00000000000..88194beae34 --- /dev/null +++ b/bin/configs/csharp-netcore-OpenAPIClient-net50.yaml @@ -0,0 +1,13 @@ +# for .net standard +generatorName: csharp-netcore +outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0 +# TODO switch to http signature spec after fixing compilation issues +#inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/csharp-netcore +additionalProperties: + packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' + useCompareNetObjects: true + disallowAdditionalPropertiesIfNotPresent: false + useOneOfDiscriminatorLookup: true + targetFramework: net5.0 diff --git a/bin/configs/elixir.yaml b/bin/configs/elixir.yaml index 6507adae5fc..a287f44705b 100644 --- a/bin/configs/elixir.yaml +++ b/bin/configs/elixir.yaml @@ -1,6 +1,6 @@ generatorName: elixir outputDir: samples/client/petstore/elixir -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/elixir additionalProperties: invokerPackage: OpenapiPetstore diff --git a/bin/configs/other/java-undertow-server-java-undertow.yaml b/bin/configs/java-undertow-server-java-undertow.yaml similarity index 100% rename from bin/configs/other/java-undertow-server-java-undertow.yaml rename to bin/configs/java-undertow-server-java-undertow.yaml diff --git a/bin/configs/other/swift5-alamofireLibrary.yaml b/bin/configs/swift5-alamofireLibrary.yaml similarity index 100% rename from bin/configs/other/swift5-alamofireLibrary.yaml rename to bin/configs/swift5-alamofireLibrary.yaml diff --git a/bin/configs/other/swift5-combineLibrary.yaml b/bin/configs/swift5-combineLibrary.yaml similarity index 100% rename from bin/configs/other/swift5-combineLibrary.yaml rename to bin/configs/swift5-combineLibrary.yaml diff --git a/bin/configs/other/swift5-default.yaml b/bin/configs/swift5-default.yaml similarity index 100% rename from bin/configs/other/swift5-default.yaml rename to bin/configs/swift5-default.yaml diff --git a/bin/configs/other/swift5-deprecated.yaml b/bin/configs/swift5-deprecated.yaml similarity index 100% rename from bin/configs/other/swift5-deprecated.yaml rename to bin/configs/swift5-deprecated.yaml diff --git a/bin/configs/other/swift5-nonPublicApi.yaml b/bin/configs/swift5-nonPublicApi.yaml similarity index 100% rename from bin/configs/other/swift5-nonPublicApi.yaml rename to bin/configs/swift5-nonPublicApi.yaml diff --git a/bin/configs/other/swift5-objcCompatible.yaml b/bin/configs/swift5-objcCompatible.yaml similarity index 100% rename from bin/configs/other/swift5-objcCompatible.yaml rename to bin/configs/swift5-objcCompatible.yaml diff --git a/bin/configs/other/swift5-promisekitLibrary.yaml b/bin/configs/swift5-promisekitLibrary.yaml similarity index 100% rename from bin/configs/other/swift5-promisekitLibrary.yaml rename to bin/configs/swift5-promisekitLibrary.yaml diff --git a/bin/configs/other/swift5-readonlyProperties.yaml b/bin/configs/swift5-readonlyProperties.yaml similarity index 100% rename from bin/configs/other/swift5-readonlyProperties.yaml rename to bin/configs/swift5-readonlyProperties.yaml diff --git a/bin/configs/other/swift5-resultLibrary.yaml b/bin/configs/swift5-resultLibrary.yaml similarity index 100% rename from bin/configs/other/swift5-resultLibrary.yaml rename to bin/configs/swift5-resultLibrary.yaml diff --git a/bin/configs/other/swift5-rxswiftLibrary.yaml b/bin/configs/swift5-rxswiftLibrary.yaml similarity index 100% rename from bin/configs/other/swift5-rxswiftLibrary.yaml rename to bin/configs/swift5-rxswiftLibrary.yaml diff --git a/bin/configs/other/swift5-urlsessionLibrary.yaml b/bin/configs/swift5-urlsessionLibrary.yaml similarity index 100% rename from bin/configs/other/swift5-urlsessionLibrary.yaml rename to bin/configs/swift5-urlsessionLibrary.yaml diff --git a/bin/configs/typescript-nestjs-v6-provided-in-root.yaml b/bin/configs/typescript-nestjs-v6-provided-in-root.yaml new file mode 100644 index 00000000000..4fb999ef170 --- /dev/null +++ b/bin/configs/typescript-nestjs-v6-provided-in-root.yaml @@ -0,0 +1,9 @@ +generatorName: typescript-nestjs +outputDir: samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +additionalProperties: + nestVersion: 6.0.0 + "npmName": "@openapitools/typescript-nestjs-petstore" + "npmVersion": "1.0.0" + "npmRepository" : "https://skimdb.npmjs.com/registry" + "snapshot" : false diff --git a/bin/windows/typescript.bat b/bin/windows/typescript.bat deleted file mode 100755 index 0e006951cf4..00000000000 --- a/bin/windows/typescript.bat +++ /dev/null @@ -1,22 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M - -set args=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g typescript -o samples\openapi3\client\petstore\typescript\builds\default --additional-properties=platform=node,npmName=ts-petstore-client -java %JAVA_OPTS% -jar %executable% %args% - -args=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g typescript -o samples\openapi3\client\petstore\typescript\builds\jquery --additional-properties=framework=jquery,npmName=ts-petstore-client -java %JAVA_OPTS% -jar %executable% %args% - -set args=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g typescript -o samples\openapi3\client\petstore\typescript\builds\object_params --additional-properties=platform=node,npmName=ts-petstore-client,useObjectParameters -java %JAVA_OPTS% -jar %executable% %args% - -set args=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g typescript -o samples\openapi3\client\petstore\typescript\builds\inversify --additional-properties=platform=node,npmName=ts-petstore-client,useInversify -java %JAVA_OPTS% -jar %executable% %args% - -set args=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g typescript -o samples\openapi3\client\petstore\typescript\builds\deno --additional-properties=platform=deno -java %JAVA_OPTS% -jar %executable% %args% diff --git a/CI/bitrise.yml b/bitrise.yml similarity index 74% rename from CI/bitrise.yml rename to bitrise.yml index 9cd05231017..16084569fda 100644 --- a/CI/bitrise.yml +++ b/bitrise.yml @@ -11,7 +11,7 @@ workflows: primary: steps: - git-clone@4.0.17: {} - - brew-install@0.10.2: + - brew-install@0.11.0: inputs: - packages: maven - script@1.1.6: @@ -30,15 +30,6 @@ workflows: mvn --no-snapshot-updates package -Dorg.slf4j.simpleLogger.defaultLogLevel=error title: Build openapi-generator - - script@1.1.6: - title: Update Swift samples - inputs: - - content: | - #!/usr/bin/env bash - - set -e - - bin/generate-samples.sh ./bin/configs/other/swift5-* - script@1.1.6: title: Run Swift5 tests inputs: @@ -47,5 +38,5 @@ workflows: set -e - ./samples/client/test/swift5/swift5_test_all.sh + ./samples/client/petstore/swift5/swift5_test_all.sh diff --git a/docs/generators.md b/docs/generators.md index 739d0cfd19a..1b2aa656bfb 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -69,6 +69,7 @@ The following generators are available: * [typescript-fetch](generators/typescript-fetch.md) * [typescript-inversify](generators/typescript-inversify.md) * [typescript-jquery](generators/typescript-jquery.md) +* [typescript-nestjs (experimental)](generators/typescript-nestjs.md) * [typescript-node](generators/typescript-node.md) * [typescript-redux-query](generators/typescript-redux-query.md) * [typescript-rxjs](generators/typescript-rxjs.md) diff --git a/docs/generators/cpp-qt5-client.md b/docs/generators/cpp-qt5-client.md index 557ea18b69b..ada59e68cea 100644 --- a/docs/generators/cpp-qt5-client.md +++ b/docs/generators/cpp-qt5-client.md @@ -232,10 +232,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl ### Security Feature | Name | Supported | Defined By | | ---- | --------- | ---------- | -|BasicAuth|✗|OAS2,OAS3 -|ApiKey|✗|OAS2,OAS3 +|BasicAuth|✓|OAS2,OAS3 +|ApiKey|✓|OAS2,OAS3 |OpenIDConnect|✗|OAS3 -|BearerToken|✗|OAS3 +|BearerToken|✓|OAS3 |OAuth2_Implicit|✗|OAS2,OAS3 |OAuth2_Password|✗|OAS2,OAS3 |OAuth2_ClientCredentials|✗|OAS2,OAS3 diff --git a/docs/generators/csharp-netcore.md b/docs/generators/csharp-netcore.md index cf7870c5824..60a347dfea5 100644 --- a/docs/generators/csharp-netcore.md +++ b/docs/generators/csharp-netcore.md @@ -28,10 +28,10 @@ These options may be applied as additional-properties (cli) or configOptions (pl |returnICollection|Return ICollection<T> instead of the concrete type.| |false| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src| -|targetFramework|The target .NET framework version.|
**netstandard1.3**
.NET Standard 1.3 compatible
**netstandard1.4**
.NET Standard 1.4 compatible
**netstandard1.5**
.NET Standard 1.5 compatible
**netstandard1.6**
.NET Standard 1.6 compatible
**netstandard2.0**
.NET Standard 2.0 compatible
**netstandard2.1**
.NET Standard 2.1 compatible
**netcoreapp2.0**
.NET Core 2.0 compatible
**netcoreapp2.1**
.NET Core 2.1 compatible
**netcoreapp3.0**
.NET Core 3.0 compatible
**netcoreapp3.1**
.NET Core 3.1 compatible
**net47**
.NET Framework 4.7 compatible
|netstandard2.0| +|targetFramework|The target .NET framework version.|
**netstandard1.3**
.NET Standard 1.3 compatible
**netstandard1.4**
.NET Standard 1.4 compatible
**netstandard1.5**
.NET Standard 1.5 compatible
**netstandard1.6**
.NET Standard 1.6 compatible
**netstandard2.0**
.NET Standard 2.0 compatible
**netstandard2.1**
.NET Standard 2.1 compatible
**netcoreapp2.0**
.NET Core 2.0 compatible
**netcoreapp2.1**
.NET Core 2.1 compatible
**netcoreapp3.0**
.NET Core 3.0 compatible
**netcoreapp3.1**
.NET Core 3.1 compatible
**net47**
.NET Framework 4.7 compatible
**net5.0**
.NET 5.0 compatible
|netstandard2.0| |useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| |useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| -|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and onlye one match in oneOf's schemas) will be skipped.| |false| +|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |false| |validatable|Generates self-validatable models.| |true| ## IMPORT MAPPING diff --git a/docs/generators/elixir.md b/docs/generators/elixir.md index 3c4d586c233..835a32834af 100644 --- a/docs/generators/elixir.md +++ b/docs/generators/elixir.md @@ -36,6 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • Atom
  • Boolean
  • DateTime
  • +
  • Decimal
  • Float
  • Integer
  • List
  • @@ -43,6 +44,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
  • PID
  • String
  • Tuple
  • +
  • map()
  • ## RESERVED WORDS diff --git a/docs/generators/go.md b/docs/generators/go.md index 6399eb4a3e7..a2318c003f3 100644 --- a/docs/generators/go.md +++ b/docs/generators/go.md @@ -16,7 +16,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |packageVersion|Go package version.| |1.0.0| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |structPrefix|whether to prefix struct with the class name. e.g. DeletePetOpts => PetApiDeletePetOpts| |false| -|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and onlye one match in oneOf's schemas) will be skipped.| |false| +|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |false| |withAWSV4Signature|whether to include AWS v4 signature support| |false| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| diff --git a/docs/generators/java.md b/docs/generators/java.md index 819129bc1fa..38c3f19f56a 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -35,7 +35,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |invokerPackage|root package for generated code| |org.openapitools.client| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |true| |legacyDiscriminatorBehavior|Set to true for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
    **true**
    The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
    **false**
    The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
    |true| -|library|library template (sub-template) to use|
    **jersey1**
    HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.
    **jersey2**
    HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
    **feign**
    HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.
    **okhttp-gson**
    [DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
    **retrofit2**
    HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
    **resttemplate**
    HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
    **webclient**
    HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
    **resteasy**
    HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
    **vertx**
    HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
    **google-api-client**
    HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
    **rest-assured**
    HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
    **native**
    HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
    **microprofile**
    HTTP client: Microprofile client 1.x. JSON processing: Jackson 2.9.x
    |okhttp-gson| +|library|library template (sub-template) to use|
    **jersey1**
    HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.
    **jersey2**
    HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
    **feign**
    HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.
    **okhttp-gson**
    [DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
    **retrofit2**
    HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
    **resttemplate**
    HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
    **webclient**
    HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
    **resteasy**
    HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
    **vertx**
    HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
    **google-api-client**
    HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
    **rest-assured**
    HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
    **native**
    HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
    **microprofile**
    HTTP client: Microprofile client 1.x. JSON processing: Jackson 2.9.x
    |okhttp-gson| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null| @@ -57,7 +57,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src/main/java| -|supportJava6|Whether to support Java6 with the Jersey1 library. This option has been deprecated and will be removed in the 5.x release| |false| |useAbstractionForFiles|Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on resttemplate library| |false| |useBeanValidation|Use BeanValidation API annotations| |false| |useGzipFeature|Send gzip-encoded requests| |false| diff --git a/docs/generators/powershell.md b/docs/generators/powershell.md index 19ee0fe1218..a9c14eab47d 100644 --- a/docs/generators/powershell.md +++ b/docs/generators/powershell.md @@ -21,7 +21,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |releaseNotes|Release notes of the generated PowerShell module| |null| |skipVerbParsing|Set skipVerbParsing to not try get powershell verbs of operation names| |null| |tags|Tags applied to the generated PowerShell module. These help with module discovery in online galleries| |null| -|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and onlye one match in oneOf's schemas) will be skipped.| |null| +|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |null| ## IMPORT MAPPING diff --git a/docs/generators/rust-server.md b/docs/generators/rust-server.md index d24af6089b7..cadccd0fbcc 100644 --- a/docs/generators/rust-server.md +++ b/docs/generators/rust-server.md @@ -186,7 +186,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | Name | Supported | Defined By | | ---- | --------- | ---------- | |Simple|✓|OAS2,OAS3 -|Composite|✗|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 |Polymorphism|✗|OAS2,OAS3 |Union|✗|OAS3 diff --git a/docs/generators/typescript-nestjs.md b/docs/generators/typescript-nestjs.md new file mode 100644 index 00000000000..9ec83a6246c --- /dev/null +++ b/docs/generators/typescript-nestjs.md @@ -0,0 +1,254 @@ +--- +title: Config Options for typescript-nestjs +sidebar_label: typescript-nestjs +--- + +These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
    **false**
    The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
    **true**
    Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
    |true| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| +|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|fileNaming|Naming convention for the output files: 'camelCase', 'kebab-case'.| |camelCase| +|legacyDiscriminatorBehavior|Set to true 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| +|modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null| +|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| +|modelSuffix|The suffix of the generated model.| |null| +|nestVersion|The version of Nestjs.| |6.0.0| +|npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| +|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| +|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| +|nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|serviceFileSuffix|The suffix of the file of the generated service (service<suffix>.ts).| |.service| +|serviceSuffix|The suffix of the generated service.| |Service| +|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|stringEnums|Generate string enums instead of objects for enum values.| |false| +|supportsES6|Generate code that conforms to ES6.| |false| +|taggedUnions|Use discriminators to create tagged unions instead of extending interfaces.| |false| +|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | +|array|Array| + + +## LANGUAGE PRIMITIVES + + + +## RESERVED WORDS + + + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|ToolingExtension +|MockServer|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Array|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✓|ToolingExtension +|MapOfModel|✓|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✓|ToolingExtension +|MapOfCollectionOfEnum|✓|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✓|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✗|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✗|OAS3 +|ParameterStyling|✗|OAS3 +|Callbacks|✗|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✓|OAS2 +|FormMultipart|✓|OAS2 +|Cookie|✓|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✓|OAS2,OAS3 +|Union|✗|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✗|OAS2,OAS3 +|ApiKey|✗|OAS2,OAS3 +|OpenIDConnect|✗|OAS3 +|BearerToken|✗|OAS3 +|OAuth2_Implicit|✗|OAS2,OAS3 +|OAuth2_Password|✗|OAS2,OAS3 +|OAuth2_ClientCredentials|✗|OAS2,OAS3 +|OAuth2_AuthorizationCode|✗|OAS2,OAS3 + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✓|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✗|OAS2,OAS3 diff --git a/docs/plugins.md b/docs/plugins.md index 7fcbf4ac4c1..224a0d5fa58 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -15,7 +15,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase) org.openapitools openapi-generator-maven-plugin - 4.3.1 + 5.0.0 @@ -76,7 +76,7 @@ buildscript { maven { url "https://repo1.maven.org/maven2" } } dependencies { - classpath "org.openapitools:openapi-generator-gradle-plugin:3.3.4" + classpath "org.openapitools:openapi-generator-gradle-plugin:5.0.0" } } @@ -111,9 +111,6 @@ openApiGenerate { apiPackage = "org.openapi.example.api" invokerPackage = "org.openapi.example.invoker" modelPackage = "org.openapi.example.model" - modelFilesConstrainedTo = [ - "Error" - ] configOptions = [ dateLibrary: "java8" ] diff --git a/docs/roadmap.md b/docs/roadmap.md index c56e7dbe641..8dc6e85c3e3 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -59,7 +59,7 @@ Short term are focused on improving contributor and user productivity (part of t * SPI plugins * Templating engine * Language extensions - * Custom extensions (e.g. allowing users to load support for https://github.com/Azure/azure-rest-api-specs[azure-rest-api-specs]) + * Custom extensions (e.g. allowing users to load support for [azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs)) * Customizable templating engines (handlebars support) * Unit-testing templates (to previously mentioned explicit type as an interface to the template) * Reduce coupling diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc index a9f1c58ab18..5590516dc1d 100644 --- a/modules/openapi-generator-gradle-plugin/README.adoc +++ b/modules/openapi-generator-gradle-plugin/README.adoc @@ -551,7 +551,7 @@ BUILD SUCCESSFUL in 0s === openApiValidate -.in buid.gradle +.in build.gradle [source,groovy] ---- openApiValidate { diff --git a/modules/openapi-generator-gradle-plugin/gradlew b/modules/openapi-generator-gradle-plugin/gradlew index 83f2acfdc31..dff5c7d9402 100755 --- a/modules/openapi-generator-gradle-plugin/gradlew +++ b/modules/openapi-generator-gradle-plugin/gradlew @@ -44,7 +44,7 @@ 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"' +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -82,6 +82,7 @@ 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 @@ -129,6 +130,7 @@ fi 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 @@ -154,19 +156,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + 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" ;; + 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 @@ -175,14 +177,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +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" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - exec "$JAVACMD" "$@" diff --git a/modules/openapi-generator-gradle-plugin/gradlew.bat b/modules/openapi-generator-gradle-plugin/gradlew.bat index 24467a141f7..6a68175eb70 100644 --- a/modules/openapi-generator-gradle-plugin/gradlew.bat +++ b/modules/openapi-generator-gradle-plugin/gradlew.bat @@ -1,100 +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 Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@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=-Dfile.encoding=UTF-8 "-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/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties index f3b443b6b0c..cc9120b6ed8 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties @@ -1,3 +1,3 @@ # RELEASE_VERSION -openApiGeneratorVersion=5.0.0-SNAPSHOT +openApiGeneratorVersion=5.0.1-SNAPSHOT # /RELEASE_VERSION diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java index b66b232129f..d576eea2c40 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java @@ -367,5 +367,5 @@ public class CodegenConstants { "If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. " + "If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default."; public static final String USE_ONEOF_DISCRIMINATOR_LOOKUP = "useOneOfDiscriminatorLookup"; - public static final String USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC = "Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and onlye one match in oneOf's schemas) will be skipped."; + public static final String USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC = "Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java index 4bcb5dd4bf9..1663343387f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java @@ -79,7 +79,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties { public Set allMandatory = new TreeSet(); // with parent's required properties public Set imports = new TreeSet(); - public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum; + public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasValidation; /** * Indicates the OAS schema specifies "nullable: true". */ @@ -612,12 +612,11 @@ public class CodegenModel implements IJsonSchemaValidationProperties { this.additionalProperties = additionalProperties; } - // indicates if the model component has validation on the root level schema - // this will be true when minItems or minProperties is set - public boolean hasValidation() { - boolean val = (maxItems != null || minItems != null || minProperties != null || maxProperties != null || minLength != null || maxLength != null || multipleOf != null || pattern != null || minimum != null || maximum != null || Boolean.TRUE.equals(uniqueItems) || Boolean.TRUE.equals(exclusiveMaximum) || Boolean.TRUE.equals(exclusiveMinimum)); - return val; - } + @Override + public boolean getHasValidation() { return hasValidation; } + + @Override + public void setHasValidation(boolean hasValidation) { this.hasValidation = hasValidation; } public List getReadOnlyVars() { return readOnlyVars; @@ -742,6 +741,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties { isDeprecated == that.isDeprecated && hasOnlyReadOnly == that.hasOnlyReadOnly && isNull == that.isNull && + hasValidation == that.hasValidation && getUniqueItems() == that.getUniqueItems() && getExclusiveMinimum() == that.getExclusiveMinimum() && getExclusiveMaximum() == that.getExclusiveMaximum() && @@ -806,7 +806,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties { getDescription(), getClassVarName(), getModelJson(), getDataType(), getXmlPrefix(), getXmlNamespace(), getXmlName(), getClassFilename(), getUnescapedDescription(), getDiscriminator(), getDefaultValue(), getArrayModelType(), isAlias, isString, isInteger, isLong, isNumber, isNumeric, isFloat, isDouble, - isDate, isDateTime, isNull, + isDate, isDateTime, isNull, hasValidation, getVars(), getAllVars(), getRequiredVars(), getOptionalVars(), getReadOnlyVars(), getReadWriteVars(), getParentVars(), getAllowableValues(), getMandatory(), getAllMandatory(), getImports(), hasVars, isEmptyVars(), hasMoreModels, hasEnums, isEnum, isNullable, hasRequired, hasOptional, isArray, @@ -898,6 +898,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties { sb.append(", additionalProperties='").append(additionalProperties).append('\''); sb.append(", isModel='").append(isModel).append('\''); sb.append(", isNull='").append(isNull); + sb.append(", hasValidation='").append(hasValidation); sb.append('}'); return sb.toString(); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java index 7c6f80ae843..811d48d324c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java @@ -582,5 +582,11 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { public void setIsNull(boolean isNull) { this.isNull = isNull; } + + @Override + public boolean getHasValidation() { return hasValidation; } + + @Override + public void setHasValidation(boolean hasValidation) { this.hasValidation = hasValidation; } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java index b956a3ea7e1..60d32f47712 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java @@ -687,6 +687,12 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti this.isNull = isNull; } + @Override + public boolean getHasValidation() { return hasValidation; } + + @Override + public void setHasValidation(boolean hasValidation) { this.hasValidation = hasValidation; } + @Override public String toString() { final StringBuilder sb = new StringBuilder("CodegenProperty{"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java index 7762676b7ca..5db6b721715 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java @@ -78,6 +78,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { public CodegenProperty additionalProperties; public List vars = new ArrayList(); // all properties (without parent's properties) public List requiredVars = new ArrayList(); + private boolean hasValidation; @Override public int hashCode() { @@ -85,7 +86,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBoolean, isDate, isDateTime, isUuid, isEmail, isModel, isFreeFormObject, isAnyType, isDefault, simpleType, primitiveType, isMap, isArray, isBinary, isFile, schema, jsonSchema, vendorExtensions, items, additionalProperties, - vars, requiredVars, isNull, + vars, requiredVars, isNull, hasValidation, getMaxProperties(), getMinProperties(), uniqueItems, getMaxItems(), getMinItems(), getMaxLength(), getMinLength(), exclusiveMinimum, exclusiveMaximum, getMinimum(), getMaximum(), getPattern(), is1xx, is2xx, is3xx, is4xx, is5xx); @@ -124,6 +125,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { items == that.items && additionalProperties == that.additionalProperties && isNull == that.isNull && + hasValidation == that.hasValidation && is1xx == that.is1xx && is2xx == that.is2xx && is3xx == that.is3xx && @@ -426,6 +428,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { sb.append(", vars='").append(vars).append('\''); sb.append(", requiredVars='").append(requiredVars).append('\''); sb.append(", isNull='").append(isNull); + sb.append(", hasValidation='").append(hasValidation); sb.append('}'); return sb.toString(); } @@ -456,4 +459,10 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { public void setIsNull(boolean isNull) { this.isNull = isNull; } + + @Override + public boolean getHasValidation() { return hasValidation; } + + @Override + public void setHasValidation(boolean hasValidation) { this.hasValidation = hasValidation; } } 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 9f063bef496..1d30af652a8 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 @@ -2258,6 +2258,7 @@ public class DefaultCodegen implements CodegenConfig { } CodegenModel m = CodegenModelFactory.newInstance(CodegenModelType.MODEL); + ModelUtils.syncValidationProperties(schema, m); if (reservedWords.contains(name)) { m.name = escapeReservedWord(name); @@ -2305,7 +2306,6 @@ public class DefaultCodegen implements CodegenConfig { m.setItems(arrayProperty.items); m.arrayModelType = arrayProperty.complexType; addParentContainer(m, name, schema); - ModelUtils.syncValidationProperties(schema, m); } else if (ModelUtils.isNullType(schema)) { m.isNull = true; } else if (schema instanceof ComposedSchema) { @@ -2500,8 +2500,6 @@ public class DefaultCodegen implements CodegenConfig { m.isMap = true; } else if (ModelUtils.isIntegerSchema(schema)) { // integer type // NOTE: Integral schemas as CodegenModel is a rare use case and may be removed at a later date. - // Sync of properties is done for consistency with other data types like CodegenParameter/CodegenProperty. - ModelUtils.syncValidationProperties(schema, m); m.isNumeric = Boolean.TRUE; if (ModelUtils.isLongSchema(schema)) { // int64/long format @@ -2511,23 +2509,15 @@ public class DefaultCodegen implements CodegenConfig { } } else if (ModelUtils.isDateTimeSchema(schema)) { // NOTE: DateTime schemas as CodegenModel is a rare use case and may be removed at a later date. - // Sync of properties is done for consistency with other data types like CodegenParameter/CodegenProperty. - ModelUtils.syncValidationProperties(schema, m); m.isDateTime = Boolean.TRUE; } else if (ModelUtils.isDateSchema(schema)) { // NOTE: Date schemas as CodegenModel is a rare use case and may be removed at a later date. - // Sync of properties is done for consistency with other data types like CodegenParameter/CodegenProperty. - ModelUtils.syncValidationProperties(schema, m); m.isDate = Boolean.TRUE; } else if (ModelUtils.isStringSchema(schema)) { // NOTE: String schemas as CodegenModel is a rare use case and may be removed at a later date. - // Sync of properties is done for consistency with other data types like CodegenParameter/CodegenProperty. - ModelUtils.syncValidationProperties(schema, m); m.isString = Boolean.TRUE; } else if (ModelUtils.isNumberSchema(schema)) { // NOTE: Number schemas as CodegenModel is a rare use case and may be removed at a later date. - // Sync of properties is done for consistency with other data types like CodegenParameter/CodegenProperty. - ModelUtils.syncValidationProperties(schema, m); m.isNumeric = Boolean.TRUE; if (ModelUtils.isFloatSchema(schema)) { // float m.isFloat = Boolean.TRUE; @@ -2538,7 +2528,6 @@ public class DefaultCodegen implements CodegenConfig { } } else if (ModelUtils.isFreeFormObject(openAPI, schema)) { addAdditionPropertiesToCodeGenModel(m, schema); - ModelUtils.syncValidationProperties(schema, m); } if (Boolean.TRUE.equals(schema.getNullable())) { @@ -3077,7 +3066,6 @@ public class DefaultCodegen implements CodegenConfig { p = unaliasSchema(p, importMapping); CodegenProperty property = CodegenModelFactory.newInstance(CodegenModelType.PROPERTY); - ModelUtils.syncValidationProperties(p, property); property.name = toVarName(name); @@ -3144,27 +3132,6 @@ public class DefaultCodegen implements CodegenConfig { property.isInteger = Boolean.TRUE; } - if (p.getMinimum() != null) { - property.minimum = String.valueOf(p.getMinimum().longValue()); - } - if (p.getMaximum() != null) { - property.maximum = String.valueOf(p.getMaximum().longValue()); - } - if (p.getExclusiveMinimum() != null) { - property.exclusiveMinimum = p.getExclusiveMinimum(); - } - if (p.getExclusiveMaximum() != null) { - property.exclusiveMaximum = p.getExclusiveMaximum(); - } - if (p.getMultipleOf() != null) { - property.multipleOf = p.getMultipleOf(); - } - - // check if any validation rule defined - // exclusive* are noop without corresponding min/max - if (property.minimum != null || property.maximum != null || p.getMultipleOf() != null) - property.hasValidation = true; - } else if (ModelUtils.isBooleanSchema(p)) { // boolean type property.isBoolean = true; property.getter = toBooleanGetter(name); @@ -3177,27 +3144,6 @@ public class DefaultCodegen implements CodegenConfig { property.isDateTime = true; } else if (ModelUtils.isDecimalSchema(p)) { // type: string, format: number property.isDecimal = true; - if (p.getMinimum() != null) { - property.minimum = String.valueOf(p.getMinimum()); - } - if (p.getMaximum() != null) { - property.maximum = String.valueOf(p.getMaximum()); - } - if (p.getExclusiveMinimum() != null) { - property.exclusiveMinimum = p.getExclusiveMinimum(); - } - if (p.getExclusiveMaximum() != null) { - property.exclusiveMaximum = p.getExclusiveMaximum(); - } - if (p.getMultipleOf() != null) { - property.multipleOf = p.getMultipleOf(); - } - - // check if any validation rule defined - // exclusive* are noop without corresponding min/max - if (property.minimum != null || property.maximum != null || p.getMultipleOf() != null) { - property.hasValidation = true; - } } else if (ModelUtils.isStringSchema(p)) { if (ModelUtils.isByteArraySchema(p)) { property.isByteArray = true; @@ -3219,15 +3165,8 @@ public class DefaultCodegen implements CodegenConfig { } else { property.isString = true; } - - property.maxLength = p.getMaxLength(); - property.minLength = p.getMinLength(); property.pattern = toRegularExpression(p.getPattern()); - // check if any validation rule defined - if (property.pattern != null || property.minLength != null || property.maxLength != null) - property.hasValidation = true; - } else if (ModelUtils.isNumberSchema(p)) { property.isNumeric = Boolean.TRUE; if (ModelUtils.isFloatSchema(p)) { // float @@ -3238,28 +3177,6 @@ public class DefaultCodegen implements CodegenConfig { property.isNumber = Boolean.TRUE; } - if (p.getMinimum() != null) { - property.minimum = String.valueOf(p.getMinimum()); - } - if (p.getMaximum() != null) { - property.maximum = String.valueOf(p.getMaximum()); - } - if (p.getExclusiveMinimum() != null) { - property.exclusiveMinimum = p.getExclusiveMinimum(); - } - if (p.getExclusiveMaximum() != null) { - property.exclusiveMaximum = p.getExclusiveMaximum(); - } - if (p.getMultipleOf() != null) { - property.multipleOf = p.getMultipleOf(); - } - - // check if any validation rule defined - // exclusive* are noop without corresponding min/max - if (property.minimum != null || property.maximum != null || p.getMultipleOf() != null) { - property.hasValidation = true; - } - } else if (isFreeFormObject(p)) { property.isFreeFormObject = true; } else if (isAnyTypeSchema(p)) { @@ -3347,8 +3264,6 @@ public class DefaultCodegen implements CodegenConfig { } // handle inner property - property.maxItems = p.getMaxItems(); - property.minItems = p.getMinItems(); String itemName = null; if (p.getExtensions() != null && p.getExtensions().get("x-item-name") != null) { itemName = p.getExtensions().get("x-item-name").toString(); @@ -3365,6 +3280,7 @@ public class DefaultCodegen implements CodegenConfig { property.isMap = true; property.containerType = "map"; property.baseType = getSchemaType(p); + // TODO remove this hack in the future, code should use minProperties and maxProperties for object schemas property.minItems = p.getMinProperties(); property.maxItems = p.getMaxProperties(); @@ -3983,20 +3899,6 @@ public class DefaultCodegen implements CodegenConfig { public CodegenResponse fromResponse(String responseCode, ApiResponse response) { CodegenResponse r = CodegenModelFactory.newInstance(CodegenModelType.RESPONSE); - if (response.getContent() != null && response.getContent().size() > 0) { - // Ensure validation properties from a target schema are persisted on CodegenResponse. - // This ignores any edge case where different schemas have different validations because we don't - // have a way to indicate a preference for response schema and are effective 1:1. - Schema contentSchema = null; - for (MediaType mt : response.getContent().values()) { - if (contentSchema != null) break; - contentSchema = mt.getSchema(); - } - if (contentSchema != null) { - ModelUtils.syncValidationProperties(contentSchema, r); - } - } - if ("default".equals(responseCode) || "defaultResponse".equals(responseCode)) { r.code = "0"; r.isDefault = true; @@ -4030,8 +3932,11 @@ public class DefaultCodegen implements CodegenConfig { responseSchema = ModelUtils.getSchemaFromResponse(response); } r.schema = responseSchema; - if (responseSchema != null && responseSchema.getPattern() != null) { - r.setPattern(toRegularExpression(responseSchema.getPattern())); + if (responseSchema != null) { + ModelUtils.syncValidationProperties(responseSchema, r); + if (responseSchema.getPattern() != null) { + r.setPattern(toRegularExpression(responseSchema.getPattern())); + } } r.message = escapeText(response.getDescription()); @@ -4219,20 +4124,6 @@ public class DefaultCodegen implements CodegenConfig { public CodegenParameter fromParameter(Parameter parameter, Set imports) { CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - if (parameter.getContent() != null && parameter.getContent().size() > 0) { - // Ensure validation properties from a target schema are persisted on CodegenParameter. - // This ignores any edge case where different schemas have different validations because we don't - // have a way to indicate a preference for parameter schema and are effective 1:1. - Schema contentSchema = null; - for (MediaType mt : parameter.getContent().values()) { - if (contentSchema != null) break; - contentSchema = mt.getSchema(); - } - if (contentSchema != null) { - ModelUtils.syncValidationProperties(contentSchema, codegenParameter); - } - } - codegenParameter.baseName = parameter.getName(); codegenParameter.description = escapeText(parameter.getDescription()); codegenParameter.unescapedDescription = parameter.getDescription(); @@ -4271,6 +4162,7 @@ public class DefaultCodegen implements CodegenConfig { LOGGER.warn("warning! Schema not found for parameter \"" + parameter.getName() + "\", using String"); parameterSchema = new StringSchema().description("//TODO automatically added by openapi-generator due to missing type definition."); } + ModelUtils.syncValidationProperties(parameterSchema, codegenParameter); if (Boolean.TRUE.equals(parameterSchema.getNullable())) { // use nullable defined in the spec codegenParameter.isNullable = true; @@ -5465,7 +5357,7 @@ public class DefaultCodegen implements CodegenConfig { if (var.defaultValue != null) { String enumName = null; final String enumDefaultValue; - if ("string".equalsIgnoreCase(dataType)) { + if (isDataTypeString(dataType)) { enumDefaultValue = toEnumValue(var.defaultValue, dataType); } else { enumDefaultValue = var.defaultValue; @@ -6029,9 +5921,10 @@ public class DefaultCodegen implements CodegenConfig { if (StringUtils.isNotBlank(schema.get$ref())) { name = ModelUtils.getSimpleRef(schema.get$ref()); } + Schema validationSchema = unaliasSchema(schema, importMapping); schema = ModelUtils.getReferencedSchema(this.openAPI, schema); - ModelUtils.syncValidationProperties(schema, codegenParameter); + ModelUtils.syncValidationProperties(validationSchema, codegenParameter); if (ModelUtils.isMapSchema(schema)) { // Schema with additionalproperties: true (including composed schemas with additionalproperties: true) @@ -6159,12 +6052,6 @@ public class DefaultCodegen implements CodegenConfig { codegenParameter.dataType = codegenProperty.dataType; codegenParameter.description = codegenProperty.description; codegenParameter.paramName = toParamName(codegenParameter.baseName); - codegenParameter.minimum = codegenProperty.minimum; - codegenParameter.maximum = codegenProperty.maximum; - codegenParameter.exclusiveMinimum = codegenProperty.exclusiveMinimum; - codegenParameter.exclusiveMaximum = codegenProperty.exclusiveMaximum; - codegenParameter.minLength = codegenProperty.minLength; - codegenParameter.maxLength = codegenProperty.maxLength; codegenParameter.pattern = codegenProperty.pattern; codegenParameter.isNullable = codegenProperty.isNullable; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 67bee20dbe0..e752c710c94 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -266,9 +266,9 @@ public class DefaultGenerator implements Generator { // TODO: Allow user to define _which_ servers object in the array to target. // Configures contextPath/basePath according to api document's servers URL url = URLPathUtils.getServerURL(openAPI, config.serverVariableOverrides()); - contextPath = config.escapeText(url.getPath()).replaceAll("/$", ""); // for backward compatibility + contextPath = removeTrailingSlash(config.escapeText(url.getPath())); // for backward compatibility basePathWithoutHost = contextPath; - basePath = config.escapeText(URLPathUtils.getHost(openAPI, config.serverVariableOverrides())).replaceAll("/$", ""); + basePath = removeTrailingSlash(config.escapeText(URLPathUtils.getHost(openAPI, config.serverVariableOverrides()))); } private void configureOpenAPIInfo() { @@ -552,7 +552,7 @@ public class DefaultGenerator implements Generator { } @SuppressWarnings("unchecked") - private void generateApis(List files, List allOperations, List allModels) { + void generateApis(List files, List allOperations, List allModels) { if (!generateApis) { // TODO: Process these anyway and present info via dryRun? LOGGER.info("Skipping generation of APIs."); @@ -580,7 +580,7 @@ public class DefaultGenerator implements Generator { Map operation = processOperations(config, tag, ops, allModels); URL url = URLPathUtils.getServerURL(openAPI, config.serverVariableOverrides()); operation.put("basePath", basePath); - operation.put("basePathWithoutHost", config.encodePath(url.getPath()).replaceAll("/$", "")); + operation.put("basePathWithoutHost", removeTrailingSlash(config.encodePath(url.getPath()))); operation.put("contextPath", contextPath); operation.put("baseName", tag); operation.put("apiPackage", config.apiPackage()); @@ -756,7 +756,7 @@ public class DefaultGenerator implements Generator { } @SuppressWarnings("unchecked") - private Map buildSupportFileBundle(List allOperations, List allModels) { + Map buildSupportFileBundle(List allOperations, List allModels) { Map bundle = new HashMap<>(config.additionalProperties()); bundle.put("apiPackage", config.apiPackage()); @@ -806,6 +806,7 @@ public class DefaultGenerator implements Generator { List servers = config.fromServers(openAPI.getServers()); if (servers != null && !servers.isEmpty()) { + servers.forEach(server -> server.url = removeTrailingSlash(server.url)); bundle.put("servers", servers); bundle.put("hasServers", true); } @@ -1483,4 +1484,8 @@ public class DefaultGenerator implements Generator { } } + private String removeTrailingSlash(String value) { + return StringUtils.removeEnd(value, "/"); + } + } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java index 9b0ad0f89f9..3d9cd65af29 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/IJsonSchemaValidationProperties.java @@ -94,4 +94,8 @@ public interface IJsonSchemaValidationProperties { boolean getIsNull(); void setIsNull(boolean isNull); + + boolean getHasValidation(); + + void setHasValidation(boolean hasValidation); } 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 40ab769081d..95aaf46b6fa 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 @@ -378,38 +378,34 @@ public class InlineModelResolver { ListIterator listIterator = children.listIterator(); while (listIterator.hasNext()) { Schema component = listIterator.next(); - if (component instanceof ObjectSchema || // for inline schema with type:object - (component != null && component.getProperties() != null && - !component.getProperties().isEmpty())) { // for inline schema without type:object - Schema op = component; - if (op.get$ref() == null && op.getProperties() != null && op.getProperties().size() > 0) { - // If a `title` attribute is defined in the inline schema, codegen uses it to name the - // inline schema. Otherwise, we'll use the default naming such as InlineObject1, etc. - // We know that this is not the best way to name the model. - // - // Such naming strategy may result in issues. If the value of the 'title' attribute - // happens to match a schema defined elsewhere in the specification, 'innerModelName' - // will be the same as that other schema. - // - // To have complete control of the model naming, one can define the model separately - // instead of inline. - String innerModelName = resolveModelName(op.getTitle(), key); - Schema innerModel = modelFromProperty(openAPI, op, innerModelName); - String existing = matchGenerated(innerModel); - if (existing == null) { - openAPI.getComponents().addSchemas(innerModelName, innerModel); - addGenerated(innerModelName, innerModel); - Schema schema = new Schema().$ref(innerModelName); - schema.setRequired(op.getRequired()); - listIterator.set(schema); - } else { - Schema schema = new Schema().$ref(existing); - schema.setRequired(op.getRequired()); - listIterator.set(schema); - } + if ((component != null) && + (component.get$ref() == null) && + ((component.getProperties() != null && !component.getProperties().isEmpty()) || + (component.getEnum() != null && !component.getEnum().isEmpty()))) { + // If a `title` attribute is defined in the inline schema, codegen uses it to name the + // inline schema. Otherwise, we'll use the default naming such as InlineObject1, etc. + // We know that this is not the best way to name the model. + // + // Such naming strategy may result in issues. If the value of the 'title' attribute + // happens to match a schema defined elsewhere in the specification, 'innerModelName' + // will be the same as that other schema. + // + // To have complete control of the model naming, one can define the model separately + // instead of inline. + String innerModelName = resolveModelName(component.getTitle(), key); + Schema innerModel = modelFromProperty(openAPI, component, innerModelName); + String existing = matchGenerated(innerModel); + if (existing == null) { + openAPI.getComponents().addSchemas(innerModelName, innerModel); + addGenerated(innerModelName, innerModel); + Schema schema = new Schema().$ref(innerModelName); + schema.setRequired(component.getRequired()); + listIterator.set(schema); + } else { + Schema schema = new Schema().$ref(existing); + schema.setRequired(component.getRequired()); + listIterator.set(schema); } - } else { - // likely a reference to schema (not inline schema) } } } @@ -540,7 +536,7 @@ public class InlineModelResolver { */ private String sanitizeName(final String name) { return name - .replaceAll("^[0-9]", "_") // e.g. 12object => _2object + .replaceAll("^[0-9]", "_$0") // e.g. 12object => _12object .replaceAll("[^A-Za-z0-9]", "_"); // e.g. io.schema.User name => io_schema_User_name } @@ -671,6 +667,8 @@ public class InlineModelResolver { model.setXml(xml); model.setRequired(object.getRequired()); model.setNullable(object.getNullable()); + model.setEnum(object.getEnum()); + model.setType(object.getType()); model.setDiscriminator(object.getDiscriminator()); model.setWriteOnly(object.getWriteOnly()); model.setUniqueItems(object.getUniqueItems()); 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 5eb54b986f8..bf4e138bcb9 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 @@ -517,6 +517,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code importMapping.put("JsonReader", "com.google.gson.stream.JsonReader"); importMapping.put("JsonWriter", "com.google.gson.stream.JsonWriter"); importMapping.put("IOException", "java.io.IOException"); + importMapping.put("Arrays", "java.util.Arrays"); importMapping.put("Objects", "java.util.Objects"); importMapping.put("StringUtil", invokerPackage + ".StringUtil"); // import JsonCreator if JsonProperty is imported 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 33ac8a95bb1..32c7c3cff45 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 @@ -898,7 +898,8 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co } @Override - public String toDefaultValue(Schema p) { + public String toDefaultValue(Schema schema) { + Schema p = ModelUtils.getReferencedSchema(this.openAPI, schema); if (ModelUtils.isBooleanSchema(p)) { if (p.getDefault() != null) { return p.getDefault().toString(); @@ -921,8 +922,15 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co } } else if (ModelUtils.isStringSchema(p)) { if (p.getDefault() != null) { - return "\"" + p.getDefault() + "\""; + String _default = (String) p.getDefault(); + if (p.getEnum() == null) { + return "\"" + escapeText(_default) + "\""; + } else { + // convert to enum var name later in postProcessModels + return _default; + } } + return null; } return null; 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 12e3e15bb85..91763105be6 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 @@ -63,7 +63,8 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { FrameworkStrategy.NETCOREAPP_2_1, FrameworkStrategy.NETCOREAPP_3_0, FrameworkStrategy.NETCOREAPP_3_1, - FrameworkStrategy.NETFRAMEWORK_4_7 + FrameworkStrategy.NETFRAMEWORK_4_7, + FrameworkStrategy.NET_5_0 ); private static FrameworkStrategy defaultFramework = FrameworkStrategy.NETSTANDARD_2_0; protected final Map frameworks; @@ -908,6 +909,8 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { }; static FrameworkStrategy NETFRAMEWORK_4_7 = new FrameworkStrategy("net47", ".NET Framework 4.7 compatible", "net47", Boolean.FALSE) { }; + static FrameworkStrategy NET_5_0 = new FrameworkStrategy("net5.0", ".NET 5.0 compatible", "net5.0", Boolean.FALSE) { + }; protected String name; protected String description; protected String testTargetFramework; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java index f0b8cfc957c..7a383a1e87e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5ClientCodegen.java @@ -23,6 +23,7 @@ import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.SupportingFile; import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.meta.features.GlobalFeature; +import org.openapitools.codegen.meta.features.SecurityFeature; import java.io.File; @@ -42,6 +43,9 @@ public class CppQt5ClientCodegen extends CppQt5AbstractCodegen implements Codege .includeDocumentationFeatures(DocumentationFeature.Readme) .includeGlobalFeatures(GlobalFeature.ParameterizedServer) .includeGlobalFeatures(GlobalFeature.MultiServer) + .includeSecurityFeatures(SecurityFeature.BasicAuth) + .includeSecurityFeatures(SecurityFeature.ApiKey) + .includeSecurityFeatures(SecurityFeature.BearerToken) ); // set the output folder here diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java index 728db0d2152..5d1da614223 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java @@ -168,6 +168,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig Arrays.asList( "Integer", "Float", + "Decimal", "Boolean", "String", "List", @@ -175,7 +176,8 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig "Map", "Tuple", "PID", - "DateTime" + "DateTime", + "map()" // This is a workaround, since the DefaultCodeGen uses our elixir TypeSpec datetype to evaluate the primitive ) ); @@ -510,8 +512,7 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig } else if (ModelUtils.isDateTimeSchema(p)) { return "DateTime.t"; } else if (ModelUtils.isObjectSchema(p)) { - // TODO How to map it? - return super.getTypeDeclaration(p); + return "map()"; } else if (ModelUtils.isIntegerSchema(p)) { return "integer()"; } else if (ModelUtils.isNumberSchema(p)) { @@ -520,9 +521,8 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig return "String.t"; } else if (ModelUtils.isBooleanSchema(p)) { return "boolean()"; - } else if (!StringUtils.isEmpty(p.get$ref())) { // model - // How to map it? - return super.getTypeDeclaration(p); + } else if (!StringUtils.isEmpty(p.get$ref())) { + return this.moduleName + ".Model." + super.getTypeDeclaration(p) + ".t"; } else if (ModelUtils.isFileSchema(p)) { return "String.t"; } else if (ModelUtils.isStringSchema(p)) { @@ -593,12 +593,12 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig this.isDefinedDefault = (this.code.equals("0") || this.code.equals("default")); } - public String codeMappingKey(){ - if(this.isDefinedDefault) { + public String codeMappingKey() { + if (this.isDefinedDefault) { return ":default"; } - if(code.matches("^\\d{3}$")){ + if (code.matches("^\\d{3}$")) { return code; } @@ -818,6 +818,23 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig sb.append(".t"); } } + + private boolean getRequiresHttpcWorkaround() { + // Only POST/PATCH/PUT are affected from the httpc bug + if (!(this.httpMethod.equals("POST") || this.httpMethod.equals("PATCH") || this.httpMethod.equals("PUT"))) { + return false; + } + + // If theres something required for the body, the workaround is not required + for (CodegenParameter requiredParam : this.requiredParams) { + if (requiredParam.isBodyParam || requiredParam.isFormParam) { + return false; + } + } + + // In case there is nothing for the body, the operation requires the workaround + return true; + } } class ExtendedCodegenModel extends CodegenModel { 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 a0ce92fac1c..3dd6dddbf69 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 @@ -142,7 +142,6 @@ public class JavaClientCodegen extends AbstractJavaCodegen cliOptions.add(CliOption.newBoolean(PARCELABLE_MODEL, "Whether to generate models for Android that implement Parcelable with the okhttp-gson library.")); cliOptions.add(CliOption.newBoolean(USE_PLAY_WS, "Use Play! Async HTTP client (Play WS API)")); cliOptions.add(CliOption.newString(PLAY_VERSION, "Version of Play! Framework (possible values \"play24\" (Deprecated), \"play25\" (Deprecated), \"play26\" (Default))")); - cliOptions.add(CliOption.newBoolean(SUPPORT_JAVA6, "Whether to support Java6 with the Jersey1 library. This option has been deprecated and will be removed in the 5.x release")); cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); cliOptions.add(CliOption.newBoolean(PERFORM_BEANVALIDATION, "Perform BeanValidation")); cliOptions.add(CliOption.newBoolean(USE_GZIP_FEATURE, "Send gzip-encoded requests")); @@ -154,7 +153,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen cliOptions.add(CliOption.newBoolean(USE_ABSTRACTION_FOR_FILES, "Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on " + RESTTEMPLATE + " library")); cliOptions.add(CliOption.newBoolean(DYNAMIC_OPERATIONS, "Generate operations dynamically at runtime from an OAS", this.dynamicOperations)); - supportedLibraries.put(JERSEY1, "HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead."); + supportedLibraries.put(JERSEY1, "HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead."); supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x"); supportedLibraries.put(FEIGN, "HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x."); supportedLibraries.put(OKHTTP_GSON, "[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'."); @@ -392,6 +391,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); supportingFiles.add(new SupportingFile("ParamExpander.mustache", invokerFolder, "ParamExpander.java")); supportingFiles.add(new SupportingFile("EncodingUtils.mustache", invokerFolder, "EncodingUtils.java")); + supportingFiles.add(new SupportingFile("auth/DefaultApi20Impl.mustache", authFolder, "DefaultApi20Impl.java")); + supportingFiles.add(new SupportingFile("auth/OauthPasswordGrant.mustache", authFolder, "OauthPasswordGrant.java")); + supportingFiles.add(new SupportingFile("auth/OauthClientCredentialsGrant.mustache", authFolder, "OauthClientCredentialsGrant.java")); + } else if (OKHTTP_GSON.equals(getLibrary()) || StringUtils.isEmpty(getLibrary())) { // the "okhttp-gson" library template requires "ApiCallback.mustache" for async call supportingFiles.add(new SupportingFile("ApiCallback.mustache", invokerFolder, "ApiCallback.java")); @@ -851,35 +854,35 @@ public class JavaClientCodegen extends AbstractJavaCodegen } } } + } - // add implements for serializable/parcelable to all models - for (Object _mo : models) { - Map mo = (Map) _mo; - CodegenModel cm = (CodegenModel) mo.get("model"); + // add implements for serializable/parcelable to all models + for (Object _mo : models) { + Map mo = (Map) _mo; + CodegenModel cm = (CodegenModel) mo.get("model"); - cm.getVendorExtensions().putIfAbsent("x-implements", new ArrayList()); - if (JERSEY2.equals(getLibrary()) || NATIVE.equals(getLibrary())) { - cm.getVendorExtensions().put("x-implements", new ArrayList()); + cm.getVendorExtensions().putIfAbsent("x-implements", new ArrayList()); + if (JERSEY2.equals(getLibrary()) || NATIVE.equals(getLibrary())) { + cm.getVendorExtensions().put("x-implements", new ArrayList()); - if (cm.oneOf != null && !cm.oneOf.isEmpty() && cm.oneOf.contains("ModelNull")) { - // if oneOf contains "null" type - cm.isNullable = true; - cm.oneOf.remove("ModelNull"); - } - - if (cm.anyOf != null && !cm.anyOf.isEmpty() && cm.anyOf.contains("ModelNull")) { - // if anyOf contains "null" type - cm.isNullable = true; - cm.anyOf.remove("ModelNull"); - } + if (cm.oneOf != null && !cm.oneOf.isEmpty() && cm.oneOf.contains("ModelNull")) { + // if oneOf contains "null" type + cm.isNullable = true; + cm.oneOf.remove("ModelNull"); } - if (this.parcelableModel) { - ((ArrayList) cm.getVendorExtensions().get("x-implements")).add("Parcelable"); - } - if (this.serializableModel) { - ((ArrayList) cm.getVendorExtensions().get("x-implements")).add("Serializable"); + + if (cm.anyOf != null && !cm.anyOf.isEmpty() && cm.anyOf.contains("ModelNull")) { + // if anyOf contains "null" type + cm.isNullable = true; + cm.anyOf.remove("ModelNull"); } } + if (this.parcelableModel) { + ((ArrayList) cm.getVendorExtensions().get("x-implements")).add("Parcelable"); + } + if (this.serializableModel) { + ((ArrayList) cm.getVendorExtensions().get("x-implements")).add("Serializable"); + } } return objs; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java index 384d14d4ca1..92e5d2e1bea 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaUndertowServerCodegen.java @@ -106,6 +106,7 @@ public class JavaUndertowServerCodegen extends AbstractJavaCodegen { // keep the yaml in config folder for framework validation. supportingFiles.add(new SupportingFile("openapi.mustache", ("src.main.resources.config").replace(".", java.io.File.separator), "openapi.json")); + supportingFiles.add(new SupportingFile("interface.mustache", (String.format(Locale.ROOT, "src.main.java.%s", apiPackage)).replace(".", java.io.File.separator), "PathHandlerInterface.java")); supportingFiles.add(new SupportingFile("handler.mustache", (String.format(Locale.ROOT, "src.main.java.%s", apiPackage)).replace(".", java.io.File.separator), "PathHandlerProvider.java")); supportingFiles.add(new SupportingFile("service.mustache", ("src.main.resources.META-INF.services").replace(".", java.io.File.separator), "com.networknt.server.HandlerProvider")); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java index d2b4a8d1ed2..ccfcf6d55e7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java @@ -1082,7 +1082,12 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo if (StringUtils.isEmpty(codegenParameter.example)) { return "\"" + codegenParameter.example + "\""; } else { - return "\"" + codegenParameter.paramName + "_example\""; + if (Boolean.TRUE.equals(codegenParameter.isEnum)) { // enum + List enumValues = (List) codegenParameter.allowableValues.get("values"); + return "\"" + String.valueOf(enumValues.get(0)) + "\""; + } else { + return "\"" + codegenParameter.paramName + "_example\""; + } } } else if ("Boolean".equals(codegenParameter.dataType) || "System.Nullable[Boolean]".equals(codegenParameter.dataType)) { // boolean @@ -1124,7 +1129,12 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo if (StringUtils.isEmpty(codegenProperty.example)) { return "\"" + codegenProperty.example + "\""; } else { - return "\"" + codegenProperty.name + "_example\""; + if (Boolean.TRUE.equals(codegenProperty.isEnum)) { // enum + List enumValues = (List) codegenProperty.allowableValues.get("values"); + return "\"" + String.valueOf(enumValues.get(0)) + "\""; + } else { + return "\"" + codegenProperty.name + "_example\""; + } } } else if ("Boolean".equals(codegenProperty.dataType) || "System.Nullable[Boolean]".equals(codegenProperty.dataType)) { // boolean @@ -1173,7 +1183,7 @@ public class PowerShellClientCodegen extends DefaultCodegen implements CodegenCo processedModelMap.put(model, 1); } - example = "(Initialize-" + codegenModel.name; + example = "(Initialize-" + codegenModel.name + " "; List propertyExamples = new ArrayList<>(); for (CodegenProperty codegenProperty : codegenModel.allVars) { propertyExamples.add("-" + codegenProperty.name + " " + constructExampleCode(codegenProperty, modelMaps, processedModelMap)); 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 81b33ca2e94..2080fca66a7 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 @@ -22,6 +22,7 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.FileSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.XML; @@ -96,14 +97,11 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { SecurityFeature.OAuth2_Implicit )) .excludeGlobalFeatures( - GlobalFeature.XMLStructureDefinitions, GlobalFeature.LinkObjects, GlobalFeature.ParameterStyling ) .excludeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism, - SchemaSupportFeature.Union, - SchemaSupportFeature.Composite + SchemaSupportFeature.Polymorphism ) .excludeParameterFeatures( ParameterFeature.Cookie @@ -400,7 +398,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { } // model name starts with number - else if (name.matches("^\\d.*")) { + else if (camelizedName.matches("^\\d.*")) { // e.g. 200Response => Model200Response (after camelize) camelizedName = "Model" + camelizedName; LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + camelizedName); @@ -1191,8 +1189,11 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { @Override public CodegenModel fromModel(String name, Schema model) { + LOGGER.trace("Creating model from schema: {}", model); + Map allDefinitions = ModelUtils.getSchemas(this.openAPI); CodegenModel mdl = super.fromModel(name, model); + mdl.vendorExtensions.put("x-upper-case-name", name.toUpperCase(Locale.ROOT)); if (!StringUtils.isEmpty(model.get$ref())) { Schema schema = allDefinitions.get(ModelUtils.getSimpleRef(model.get$ref())); @@ -1233,6 +1234,8 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { } else { mdl.arrayModelType = toModelName(mdl.arrayModelType); } + } else if ((mdl.anyOf.size() > 0) || (mdl.oneOf.size() > 0)) { + mdl.dataType = getSchemaType(model); } if (mdl.xmlNamespace != null) { @@ -1245,6 +1248,8 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { mdl.additionalPropertiesType = getTypeDeclaration(additionalProperties); } + LOGGER.trace("Created model: {}", mdl); + return mdl; } @@ -1403,6 +1408,28 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { return defaultValue; } + @Override + public String toOneOfName(List names, ComposedSchema composedSchema) { + List schemas = ModelUtils.getInterfaces(composedSchema); + + List types = new ArrayList<>(); + for (Schema s : schemas) { + types.add(getTypeDeclaration(s)); + } + return "swagger::OneOf" + types.size() + "<" + String.join(",", types) + ">"; + } + + @Override + public String toAnyOfName(List names, ComposedSchema composedSchema) { + List schemas = ModelUtils.getInterfaces(composedSchema); + + List types = new ArrayList<>(); + for (Schema s : schemas) { + types.add(getTypeDeclaration(s)); + } + return "swagger::AnyOf" + types.size() + "<" + String.join(",", types) + ">"; + } + @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { super.postProcessModelProperty(model, property); @@ -1529,6 +1556,8 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { Map mo = (Map) _mo; CodegenModel cm = (CodegenModel) mo.get("model"); + LOGGER.trace("Post processing model: {}", cm); + if (cm.dataType != null && cm.dataType.equals("object")) { // Object isn't a sensible default. Instead, we set it to // 'null'. This ensures that we treat this model as a struct 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 fa8304e3ded..409267e3194 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 @@ -833,6 +833,11 @@ public class SpringCodegen extends AbstractJavaCodegen model.imports.add("JsonCreator"); } } + + // Add imports for java.util.Arrays + if (property.isByteArray) { + model.imports.add("Arrays"); + } } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index e0d7c235a77..636091c6208 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 @@ -540,9 +540,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode for (String name : cm.imports) { if (name.indexOf(" | ") >= 0) { String[] parts = name.split(" \\| "); - for (String s : parts) { - newImports.add(s); - } + Collections.addAll(newImports, parts); } else { newImports.add(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 cbadf484409..cc4eb8e0085 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 @@ -104,6 +104,7 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege supportingFiles.add(new SupportingFile("index.mustache", "", "index.ts")); supportingFiles.add(new SupportingFile("baseApi.mustache", "", "base.ts")); + supportingFiles.add(new SupportingFile("common.mustache", "", "common.ts")); supportingFiles.add(new SupportingFile("api.mustache", "", "api.ts")); supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.ts")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); 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 new file mode 100644 index 00000000000..f8749f72693 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNestjsClientCodegen.java @@ -0,0 +1,552 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import io.swagger.v3.oas.models.media.Schema; +import org.openapitools.codegen.*; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.utils.ModelUtils; +import org.openapitools.codegen.utils.SemVer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.*; + +import static org.apache.commons.lang3.StringUtils.capitalize; +import static org.openapitools.codegen.utils.StringUtils.*; + +public class TypeScriptNestjsClientCodegen extends AbstractTypeScriptClientCodegen { + private static final Logger LOGGER = LoggerFactory.getLogger(TypeScriptNestjsClientCodegen.class); + + private static String CLASS_NAME_SUFFIX_PATTERN = "^[a-zA-Z0-9]*$"; + private static String FILE_NAME_SUFFIX_PATTERN = "^[a-zA-Z0-9.-]*$"; + + public static final String NPM_REPOSITORY = "npmRepository"; + public static final String WITH_INTERFACES = "withInterfaces"; + public static final String TAGGED_UNIONS = "taggedUnions"; + public static final String NEST_VERSION = "nestVersion"; + public static final String SERVICE_SUFFIX = "serviceSuffix"; + public static final String SERVICE_FILE_SUFFIX = "serviceFileSuffix"; + public static final String MODEL_SUFFIX = "modelSuffix"; + public static final String MODEL_FILE_SUFFIX = "modelFileSuffix"; + public static final String FILE_NAMING = "fileNaming"; + public static final String STRING_ENUMS = "stringEnums"; + public static final String STRING_ENUMS_DESC = "Generate string enums instead of objects for enum values."; + + protected String nestVersion = "6.0.0"; + protected String npmRepository = null; + protected String serviceSuffix = "Service"; + protected String serviceFileSuffix = ".service"; + protected String modelSuffix = ""; + protected String modelFileSuffix = ""; + protected String fileNaming = "camelCase"; + protected Boolean stringEnums = false; + + private boolean taggedUnions = false; + + public TypeScriptNestjsClientCodegen() { + super(); + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.EXPERIMENTAL) + .build(); + + this.outputFolder = "generated-code/typescript-nestjs"; + + supportsMultipleInheritance = true; + + embeddedTemplateDir = templateDir = "typescript-nestjs"; + modelTemplateFiles.put("model.mustache", ".ts"); + apiTemplateFiles.put("api.service.mustache", ".ts"); + languageSpecificPrimitives.add("Blob"); + typeMapping.put("file", "Blob"); + apiPackage = "api"; + modelPackage = "model"; + + this.cliOptions.add(new CliOption(NPM_REPOSITORY, + "Use this property to set an url your private npmRepo in the package.json")); + this.cliOptions.add(CliOption.newBoolean(WITH_INTERFACES, + "Setting this property to true will generate interfaces next to the default class implementations.", + false)); + this.cliOptions.add(CliOption.newBoolean(TAGGED_UNIONS, + "Use discriminators to create tagged unions instead of extending interfaces.", + this.taggedUnions)); + this.cliOptions.add(new CliOption(NEST_VERSION, "The version of Nestjs.").defaultValue(this.nestVersion)); + this.cliOptions.add(new CliOption(SERVICE_SUFFIX, "The suffix of the generated service.").defaultValue(this.serviceSuffix)); + this.cliOptions.add(new CliOption(SERVICE_FILE_SUFFIX, "The suffix of the file of the generated service (service.ts).").defaultValue(this.serviceFileSuffix)); + this.cliOptions.add(new CliOption(MODEL_SUFFIX, "The suffix of the generated model.")); + this.cliOptions.add(new CliOption(MODEL_FILE_SUFFIX, "The suffix of the file of the generated model (model.ts).")); + this.cliOptions.add(new CliOption(FILE_NAMING, "Naming convention for the output files: 'camelCase', 'kebab-case'.").defaultValue(this.fileNaming)); + this.cliOptions.add(new CliOption(STRING_ENUMS, STRING_ENUMS_DESC).defaultValue(String.valueOf(this.stringEnums))); + } + + @Override + protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) { + codegenModel.additionalPropertiesType = getTypeDeclaration(getAdditionalProperties(schema)); + addImport(codegenModel, codegenModel.additionalPropertiesType); + } + + @Override + public String getName() { + return "typescript-nestjs"; + } + + @Override + public String getHelp() { + return "Generates a TypeScript Nestjs 6.x client library."; + } + + @Override + public void processOpts() { + super.processOpts(); + supportingFiles.add( + new SupportingFile("models.mustache", modelPackage().replace('.', File.separatorChar), "models.ts")); + supportingFiles + .add(new SupportingFile("apis.mustache", apiPackage().replace('.', File.separatorChar), "api.ts")); + supportingFiles.add(new SupportingFile("index.mustache", getIndexDirectory(), "index.ts")); + supportingFiles.add(new SupportingFile("api.module.mustache", getIndexDirectory(), "api.module.ts")); + supportingFiles.add(new SupportingFile("configuration.mustache", getIndexDirectory(), "configuration.ts")); + supportingFiles.add(new SupportingFile("variables.mustache", getIndexDirectory(), "variables.ts")); + //supportingFiles.add(new SupportingFile("encoder.mustache", getIndexDirectory(), "encoder.ts")); + supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); + supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); + supportingFiles.add(new SupportingFile("README.mustache", getIndexDirectory(), "README.md")); + + // determine Nestjs version + SemVer nestVersion; + if (additionalProperties.containsKey(NEST_VERSION)) { + nestVersion = new SemVer(additionalProperties.get(NEST_VERSION).toString()); + } else { + nestVersion = new SemVer(this.nestVersion); + LOGGER.info("generating code for Nestjs {} ...", nestVersion); + LOGGER.info(" (you can select the nestjs version by setting the additionalProperty nestVersion)"); + } + + if (additionalProperties.containsKey(NPM_NAME)) { + addNpmPackageGeneration(nestVersion); + } + + if (additionalProperties.containsKey(STRING_ENUMS)) { + setStringEnums(Boolean.valueOf(additionalProperties.get(STRING_ENUMS).toString())); + additionalProperties.put("stringEnums", getStringEnums()); + if (getStringEnums()) { + enumSuffix = ""; + classEnumSeparator = ""; + } + } + + if (additionalProperties.containsKey(WITH_INTERFACES)) { + boolean withInterfaces = Boolean.parseBoolean(additionalProperties.get(WITH_INTERFACES).toString()); + if (withInterfaces) { + apiTemplateFiles.put("apiInterface.mustache", "Interface.ts"); + } + } + + if (additionalProperties.containsKey(TAGGED_UNIONS)) { + taggedUnions = Boolean.parseBoolean(additionalProperties.get(TAGGED_UNIONS).toString()); + } + + additionalProperties.put(NEST_VERSION, nestVersion); + additionalProperties.put("injectionToken", nestVersion.atLeast("4.0.0") ? "InjectionToken" : "OpaqueToken"); + additionalProperties.put("injectionTokenTyped", nestVersion.atLeast("4.0.0")); + additionalProperties.put("useHttpClient", nestVersion.atLeast("4.3.0")); + if (additionalProperties.containsKey(SERVICE_SUFFIX)) { + serviceSuffix = additionalProperties.get(SERVICE_SUFFIX).toString(); + validateClassSuffixArgument("Service", serviceSuffix); + } + if (additionalProperties.containsKey(SERVICE_FILE_SUFFIX)) { + serviceFileSuffix = additionalProperties.get(SERVICE_FILE_SUFFIX).toString(); + validateFileSuffixArgument("Service", serviceFileSuffix); + } + if (additionalProperties.containsKey(MODEL_SUFFIX)) { + modelSuffix = additionalProperties.get(MODEL_SUFFIX).toString(); + validateClassSuffixArgument("Model", modelSuffix); + } + if (additionalProperties.containsKey(MODEL_FILE_SUFFIX)) { + modelFileSuffix = additionalProperties.get(MODEL_FILE_SUFFIX).toString(); + validateFileSuffixArgument("Model", modelFileSuffix); + } + if (additionalProperties.containsKey(FILE_NAMING)) { + this.setFileNaming(additionalProperties.get(FILE_NAMING).toString()); + } + } + + private void addNpmPackageGeneration(SemVer nestVersion) { + + if (additionalProperties.containsKey(NPM_REPOSITORY)) { + this.setNpmRepository(additionalProperties.get(NPM_REPOSITORY).toString()); + } + + additionalProperties.put("tsVersion", ">=3.6.0. <4.0.0"); + //Files for building our lib + supportingFiles.add(new SupportingFile("package.mustache", getIndexDirectory(), "package.json")); + supportingFiles.add(new SupportingFile("tsconfig.build.mustache", getIndexDirectory(), "tsconfig.build.json")); + supportingFiles.add(new SupportingFile("tsconfig.mustache", getIndexDirectory(), "tsconfig.json")); + supportingFiles.add(new SupportingFile("tslint.mustache", getIndexDirectory(), "tslint.json")); + } + + private String getIndexDirectory() { + String indexPackage = modelPackage.substring(0, Math.max(0, modelPackage.lastIndexOf('.'))); + return indexPackage.replace('.', File.separatorChar); + } + + public void setStringEnums(boolean value) { + stringEnums = value; + } + + public Boolean getStringEnums() { + return stringEnums; + } + + @Override + public boolean isDataTypeFile(final String dataType) { + return dataType != null && dataType.equals("Blob"); + } + + @Override + public String getTypeDeclaration(Schema p) { + if (ModelUtils.isFileSchema(p)) { + return "Blob"; + } else { + return super.getTypeDeclaration(p); + } + } + + @Override + public String getSchemaType(Schema p) { + String openAPIType = super.getSchemaType(p); + if (isLanguagePrimitive(openAPIType) || isLanguageGenericType(openAPIType)) { + return openAPIType; + } + applyLocalTypeMapping(openAPIType); + return openAPIType; + } + + private String applyLocalTypeMapping(String type) { + if (typeMapping.containsKey(type)) { + type = typeMapping.get(type); + } + return type; + } + + private boolean isLanguagePrimitive(String type) { + return languageSpecificPrimitives.contains(type); + } + + private boolean isLanguageGenericType(String type) { + for (String genericType : languageGenericTypes) { + if (type.startsWith(genericType + "<")) { + return true; + } + } + return false; + } + + @Override + public void postProcessParameter(CodegenParameter parameter) { + super.postProcessParameter(parameter); + parameter.dataType = applyLocalTypeMapping(parameter.dataType); + } + + @Override + public Map postProcessOperationsWithModels(Map operations, List allModels) { + Map objs = (Map) operations.get("operations"); + + // Add filename information for api imports + objs.put("apiFilename", getApiFilenameFromClassname(objs.get("classname").toString())); + + List ops = (List) objs.get("operation"); + boolean hasSomeFormParams = false; + for (CodegenOperation op : ops) { + if (op.getHasFormParams()) { + hasSomeFormParams = true; + } + op.httpMethod = op.httpMethod.toLowerCase(Locale.ENGLISH); + + // Prep a string buffer where we're going to set up our new version of the string. + StringBuilder pathBuffer = new StringBuilder(); + StringBuilder parameterName = new StringBuilder(); + int insideCurly = 0; + + // Iterate through existing string, one character at a time. + for (int i = 0; i < op.path.length(); i++) { + switch (op.path.charAt(i)) { + case '{': + // We entered curly braces, so track that. + insideCurly++; + + // Add the more complicated component instead of just the brace. + pathBuffer.append("${encodeURIComponent(String("); + break; + case '}': + // We exited curly braces, so track that. + insideCurly--; + + // Add the more complicated component instead of just the brace. + CodegenParameter parameter = findPathParameterByName(op, parameterName.toString()); + pathBuffer.append(toVarName(parameterName.toString())); + if (parameter != null && parameter.isDateTime) { + pathBuffer.append(".toISOString()"); + } + pathBuffer.append("))}"); + parameterName.setLength(0); + break; + default: + char nextChar = op.path.charAt(i); + if (insideCurly > 0) { + parameterName.append(nextChar); + } else { + pathBuffer.append(nextChar); + } + break; + } + } + + // Overwrite path to TypeScript template string, after applying everything we just did. + op.path = pathBuffer.toString(); + } + + operations.put("hasSomeFormParams", hasSomeFormParams); + + // Add additional filename information for model imports in the services + List> imports = (List>) operations.get("imports"); + for (Map im : imports) { + im.put("filename", im.get("import")); + im.put("classname", im.get("classname")); + } + + return operations; + } + + /** + * Finds and returns a path parameter of an operation by its name + * + * @param operation the operation + * @param parameterName the name of the parameter + * @return param + */ + private CodegenParameter findPathParameterByName(CodegenOperation operation, String parameterName) { + for (CodegenParameter param : operation.pathParams) { + if (param.baseName.equals(parameterName)) { + return param; + } + } + return null; + } + + @Override + public Map postProcessModels(Map objs) { + Map result = super.postProcessModels(objs); + return postProcessModelsEnum(result); + } + + @Override + public Map postProcessAllModels(Map objs) { + Map result = super.postProcessAllModels(objs); + for (Map.Entry entry : result.entrySet()) { + Map inner = (Map) entry.getValue(); + List> models = (List>) inner.get("models"); + for (Map mo : models) { + CodegenModel cm = (CodegenModel) mo.get("model"); + if (taggedUnions) { + mo.put(TAGGED_UNIONS, true); + if (cm.discriminator != null && cm.children != null) { + for (CodegenModel child : cm.children) { + cm.imports.add(child.classname); + } + } + if (cm.parent != null) { + cm.imports.remove(cm.parent); + } + } + // Add additional filename information for imports + Set parsedImports = parseImports(cm); + mo.put("tsImports", toTsImports(cm, parsedImports)); + } + } + return result; + } + + /** + * Parse imports + */ + private Set parseImports(CodegenModel cm) { + Set newImports = new HashSet(); + if (cm.imports.size() > 0) { + for (String name : cm.imports) { + if (name.indexOf(" | ") >= 0) { + String[] parts = name.split(" \\| "); + for (String s : parts) { + newImports.add(s); + } + } else { + newImports.add(name); + } + } + } + return newImports; + } + + private List> toTsImports(CodegenModel cm, Set imports) { + List> tsImports = new ArrayList<>(); + for (String im : imports) { + if (!im.equals(cm.classname)) { + HashMap tsImport = new HashMap<>(); + // TVG: This is used as class name in the import statements of the model file + tsImport.put("classname", im); + tsImport.put("filename", toModelFilename(removeModelPrefixSuffix(im))); + tsImports.add(tsImport); + } + } + return tsImports; + } + + @Override + public String toApiName(String name) { + if (name.length() == 0) { + return "DefaultService"; + } + return camelize(name) + serviceSuffix; + } + + @Override + public String toApiFilename(String name) { + if (name.length() == 0) { + return "default.service"; + } + return this.convertUsingFileNamingConvention(name) + serviceFileSuffix; + } + + @Override + public String toApiImport(String name) { + return apiPackage() + "/" + toApiFilename(name); + } + + @Override + public String toModelFilename(String name) { + return this.convertUsingFileNamingConvention(this.sanitizeName(name)) + modelFileSuffix; + } + + @Override + public String toModelImport(String name) { + return modelPackage() + "/" + toModelFilename(name); + } + + public String getNpmRepository() { + return npmRepository; + } + + public void setNpmRepository(String npmRepository) { + this.npmRepository = npmRepository; + } + + private String getApiFilenameFromClassname(String classname) { + String name = classname.substring(0, classname.length() - serviceSuffix.length()); + return toApiFilename(name); + } + + @Override + public String toModelName(String name) { + String modelName = super.toModelName(name); + if (modelSuffix.length() == 0 || modelName.endsWith(modelSuffix)) { + return modelName; + } + return modelName + modelSuffix; + } + + public String removeModelPrefixSuffix(String name) { + String result = name; + if (modelSuffix.length() > 0 && result.endsWith(modelSuffix)) { + result = result.substring(0, result.length() - modelSuffix.length()); + } + String prefix = capitalize(this.modelNamePrefix); + String suffix = capitalize(this.modelNameSuffix); + if (prefix.length() > 0 && result.startsWith(prefix)) { + result = result.substring(prefix.length()); + } + if (suffix.length() > 0 && result.endsWith(suffix)) { + result = result.substring(0, result.length() - suffix.length()); + } + + return result; + } + + /** + * Validates that the given string value only contains '-', '.' and alpha numeric characters. + * Throws an IllegalArgumentException, if the string contains any other characters. + * + * @param argument The name of the argument being validated. This is only used for displaying an error message. + * @param value The value that is being validated. + */ + private void validateFileSuffixArgument(String argument, String value) { + if (!value.matches(FILE_NAME_SUFFIX_PATTERN)) { + throw new IllegalArgumentException( + String.format(Locale.ROOT, "%s file suffix only allows '.', '-' and alphanumeric characters.", argument) + ); + } + } + + /** + * Validates that the given string value only contains alpha numeric characters. + * Throws an IllegalArgumentException, if the string contains any other characters. + * + * @param argument The name of the argument being validated. This is only used for displaying an error message. + * @param value The value that is being validated. + */ + private void validateClassSuffixArgument(String argument, String value) { + if (!value.matches(CLASS_NAME_SUFFIX_PATTERN)) { + throw new IllegalArgumentException( + String.format(Locale.ROOT, "%s class suffix only allows alphanumeric characters.", argument) + ); + } + } + + /** + * Set the file naming type. + * + * @param fileNaming the file naming to use + */ + private void setFileNaming(String fileNaming) { + if ("camelCase".equals(fileNaming) || "kebab-case".equals(fileNaming)) { + this.fileNaming = fileNaming; + } else { + throw new IllegalArgumentException("Invalid file naming '" + + fileNaming + "'. Must be 'camelCase' or 'kebab-case'"); + } + } + + /** + * Converts the original name according to the current fileNaming strategy. + * + * @param originalName the original name to transform + * @return the transformed name + */ + private String convertUsingFileNamingConvention(String originalName) { + String name = this.removeModelPrefixSuffix(originalName); + if ("kebab-case".equals(fileNaming)) { + name = dashize(underscore(name)); + } else { + name = camelize(name, true); + } + return name; + } + +} + diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index 2ad0470bc15..f570c562930 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -1489,30 +1489,89 @@ public class ModelUtils { public static void syncValidationProperties(Schema schema, IJsonSchemaValidationProperties target) { if (schema != null && target != null) { - target.setPattern(schema.getPattern()); - BigDecimal minimum = schema.getMinimum(); - BigDecimal maximum = schema.getMaximum(); - Boolean exclusiveMinimum = schema.getExclusiveMinimum(); - Boolean exclusiveMaximum = schema.getExclusiveMaximum(); - Integer minLength = schema.getMinLength(); - Integer maxLength = schema.getMaxLength(); + if (isNullType(schema) || schema.get$ref() != null || isBooleanSchema(schema)) { + return; + } + boolean isAnyType = (schema.getClass().equals(Schema.class) && schema.get$ref() == null && schema.getType() == null && + (schema.getProperties() == null || schema.getProperties().isEmpty()) && + schema.getAdditionalProperties() == null && schema.getNot() == null && + schema.getEnum() == null); + if (isAnyType) { + return; + } Integer minItems = schema.getMinItems(); Integer maxItems = schema.getMaxItems(); Boolean uniqueItems = schema.getUniqueItems(); Integer minProperties = schema.getMinProperties(); Integer maxProperties = schema.getMaxProperties(); + Integer minLength = schema.getMinLength(); + Integer maxLength = schema.getMaxLength(); + String pattern = schema.getPattern(); + BigDecimal multipleOf = schema.getMultipleOf(); + BigDecimal minimum = schema.getMinimum(); + BigDecimal maximum = schema.getMaximum(); + Boolean exclusiveMinimum = schema.getExclusiveMinimum(); + Boolean exclusiveMaximum = schema.getExclusiveMaximum(); - if (minimum != null) target.setMinimum(String.valueOf(minimum)); - if (maximum != null) target.setMaximum(String.valueOf(maximum)); + if (isArraySchema(schema)) { + setArrayValidations(minItems, maxItems, uniqueItems, target); + } else if (isMapSchema(schema) || isObjectSchema(schema)) { + setObjectValidations(minProperties, maxProperties, target); + } else if (isStringSchema(schema)) { + setStringValidations(minLength, maxLength, pattern, target); + if (isDecimalSchema(schema)) { + setNumericValidations(schema, multipleOf, minimum, maximum, exclusiveMinimum, exclusiveMaximum, target); + } + } else if (isNumberSchema(schema) || isIntegerSchema(schema)) { + setNumericValidations(schema, multipleOf, minimum, maximum, exclusiveMinimum, exclusiveMaximum, target); + } else if (isComposedSchema(schema)) { + // this could be composed out of anything so set all validations here + setArrayValidations(minItems, maxItems, uniqueItems, target); + setObjectValidations(minProperties, maxProperties, target); + setStringValidations(minLength, maxLength, pattern, target); + setNumericValidations(schema, multipleOf, minimum, maximum, exclusiveMinimum, exclusiveMaximum, target); + } + + if (maxItems != null || minItems != null || minProperties != null || maxProperties != null || minLength != null || maxLength != null || multipleOf != null || pattern != null || minimum != null || maximum != null || exclusiveMinimum != null || exclusiveMaximum != null || uniqueItems != null) { + target.setHasValidation(true); + } + } + } + + private static void setArrayValidations(Integer minItems, Integer maxItems, Boolean uniqueItems, IJsonSchemaValidationProperties target) { + if (minItems != null) target.setMinItems(minItems); + if (maxItems != null) target.setMaxItems(maxItems); + if (uniqueItems != null) target.setUniqueItems(uniqueItems); + } + + private static void setObjectValidations(Integer minProperties, Integer maxProperties, IJsonSchemaValidationProperties target) { + if (minProperties != null) target.setMinProperties(minProperties); + if (maxProperties != null) target.setMaxProperties(maxProperties); + } + + private static void setStringValidations(Integer minLength, Integer maxLength, String pattern, IJsonSchemaValidationProperties target) { + if (minLength != null) target.setMinLength(minLength); + if (maxLength != null) target.setMaxLength(maxLength); + if (pattern != null) target.setPattern(pattern); + } + + private static void setNumericValidations(Schema schema, BigDecimal multipleOf, BigDecimal minimum, BigDecimal maximum, Boolean exclusiveMinimum, Boolean exclusiveMaximum, IJsonSchemaValidationProperties target) { + if (multipleOf != null) target.setMultipleOf(multipleOf); + if (minimum != null) { + if (isIntegerSchema(schema)) { + target.setMinimum(String.valueOf(minimum.longValue())); + } else { + target.setMinimum(String.valueOf(minimum)); + } if (exclusiveMinimum != null) target.setExclusiveMinimum(exclusiveMinimum); + } + if (maximum != null) { + if (isIntegerSchema(schema)) { + target.setMaximum(String.valueOf(maximum.longValue())); + } else { + target.setMaximum(String.valueOf(maximum)); + } if (exclusiveMaximum != null) target.setExclusiveMaximum(exclusiveMaximum); - if (minLength != null) target.setMinLength(minLength); - if (maxLength != null) target.setMaxLength(maxLength); - if (minItems != null) target.setMinItems(minItems); - if (maxItems != null) target.setMaxItems(maxItems); - if (uniqueItems != null) target.setUniqueItems(uniqueItems); - if (minProperties != null) target.setMinProperties(minProperties); - if (maxProperties != null) target.setMaxProperties(maxProperties); } } diff --git a/modules/openapi-generator/src/main/resources/Java/README.mustache b/modules/openapi-generator/src/main/resources/Java/README.mustache index 40d272ed318..fd9abd28241 100644 --- a/modules/openapi-generator/src/main/resources/Java/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/README.mustache @@ -20,7 +20,7 @@ Building the API client library requires: -1. Java {{#supportJava6}}1.6{{/supportJava6}}{{^supportJava6}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/supportJava6}}+ +1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+ 2. Maven/Gradle ## Installation diff --git a/modules/openapi-generator/src/main/resources/Java/auth/OAuthFlow.mustache b/modules/openapi-generator/src/main/resources/Java/auth/OAuthFlow.mustache index 002e9572f33..07b7f3aa673 100644 --- a/modules/openapi-generator/src/main/resources/Java/auth/OAuthFlow.mustache +++ b/modules/openapi-generator/src/main/resources/Java/auth/OAuthFlow.mustache @@ -2,6 +2,10 @@ package {{invokerPackage}}.auth; +{{>generatedAnnotation}} public enum OAuthFlow { - accessCode, implicit, password, application + accessCode, //called authorizationCode in OpenAPI 3.0 + implicit, + password, + application //called clientCredentials in OpenAPI 3.0 } 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 0982932dfb0..a14862d3a81 100644 --- a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache @@ -34,11 +34,6 @@ if(hasProperty('target') && target == 'android') { } compileOptions { - {{#supportJava6}} - sourceCompatibility JavaVersion.VERSION_1_6 - targetCompatibility JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -47,7 +42,6 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 {{/java8}} - {{/supportJava6}} } // Rename the aar correctly @@ -92,11 +86,6 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' - {{#supportJava6}} - sourceCompatibility = JavaVersion.VERSION_1_6 - targetCompatibility = JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -105,7 +94,6 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 {{/java8}} - {{/supportJava6}} install { repositories.mavenInstaller { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache index 691f337c7c5..4e094dfccbe 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache @@ -2,15 +2,13 @@ package {{invokerPackage}}; import java.util.LinkedHashMap; import java.util.Map; - -{{#hasOAuthMethods}} -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -{{/hasOAuthMethods}} +import java.util.logging.Level; +import java.util.logging.Logger; {{#threetenbp}} import org.threeten.bp.*; {{/threetenbp}} +import feign.okhttp.OkHttpClient; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; @@ -41,6 +39,8 @@ import {{invokerPackage}}.auth.OAuth.AccessTokenListener; {{>generatedAnnotation}} public class ApiClient { + private static final Logger log = Logger.getLogger(ApiClient.class.getName()); + public interface Api {} protected ObjectMapper objectMapper; @@ -52,6 +52,7 @@ public class ApiClient { objectMapper = createObjectMapper(); apiAuthorizations = new LinkedHashMap(); feignBuilder = Feign.builder() + .client(new OkHttpClient()) .encoder(new FormEncoder(new JacksonEncoder(objectMapper))) .decoder(new JacksonDecoder(objectMapper)) .logger(new Slf4jLogger()); @@ -60,6 +61,7 @@ public class ApiClient { public ApiClient(String[] authNames) { this(); for(String authName : authNames) { + log.log(Level.FINE, "Creating authentication {0}", authName); {{#hasAuthMethods}} RequestInterceptor auth; {{#authMethods}}if ("{{name}}".equals(authName)) { @@ -75,7 +77,7 @@ public class ApiClient { auth = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"); {{/isApiKey}} {{#isOAuth}} - auth = new OAuth(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); + auth = buildOauthRequestInterceptor(OAuthFlow.{{flow}}, "{{authorizationUrl}}", "{{tokenUrl}}", "{{#scopes}}{{scope}}{{^-last}}, {{/-last}}{{/scopes}}"); {{/isOAuth}} } else {{/authMethods}}{ throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); @@ -106,36 +108,6 @@ public class ApiClient { this.setApiKey(apiKey); } - /** - * Helper constructor for single basic auth or password oauth2 - * @param authName - * @param username - * @param password - */ - public ApiClient(String authName, String username, String password) { - this(authName); - this.setCredentials(username, password); - } - - {{#hasOAuthMethods}} - /** - * Helper constructor for single password oauth2 - * @param authName - * @param clientId - * @param secret - * @param username - * @param password - */ - public ApiClient(String authName, String clientId, String secret, String username, String password) { - this(authName); - this.getTokenEndPoint() - .setClientId(clientId) - .setClientSecret(secret) - .setUsername(username) - .setPassword(password); - } - - {{/hasOAuthMethods}} public String getBasePath() { return basePath; } @@ -190,10 +162,25 @@ public class ApiClient { return objectMapper; } + private RequestInterceptor buildOauthRequestInterceptor(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { + switch (flow) { + case password: + return new OauthPasswordGrant(tokenUrl, scopes); + case application: + return new OauthClientCredentialsGrant(authorizationUrl, tokenUrl, scopes); + default: + throw new RuntimeException("Oauth flow \"" + flow + "\" is not implemented"); + } + } + public ObjectMapper getObjectMapper(){ return objectMapper; } + public void setObjectMapper(ObjectMapper objectMapper) { + this.objectMapper = objectMapper; + } + /** * Creates a feign client for given API interface. * @@ -240,19 +227,13 @@ public class ApiClient { return contentTypes[0]; } - /** * Helper method to configure the bearer token. * @param bearerToken the bearer token. */ public void setBearerToken(String bearerToken) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof HttpBearerAuth) { - ((HttpBearerAuth) apiAuthorization).setBearerToken(bearerToken); - return; - } - } - throw new RuntimeException("No Bearer authentication configured!"); + HttpBearerAuth apiAuthorization = getAuthorization(HttpBearerAuth.class); + apiAuthorization.setBearerToken(bearerToken); } /** @@ -260,66 +241,39 @@ public class ApiClient { * @param apiKey API key */ public void setApiKey(String apiKey) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof ApiKeyAuth) { - ApiKeyAuth keyAuth = (ApiKeyAuth) apiAuthorization; - keyAuth.setApiKey(apiKey); - return ; - } - } - throw new RuntimeException("No API key authentication configured!"); + ApiKeyAuth apiAuthorization = getAuthorization(ApiKeyAuth.class); + apiAuthorization.setApiKey(apiKey); } /** - * Helper method to configure the username/password for basic auth or password OAuth + * Helper method to configure the username/password for basic auth * @param username Username * @param password Password */ public void setCredentials(String username, String password) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof HttpBasicAuth) { - HttpBasicAuth basicAuth = (HttpBasicAuth) apiAuthorization; - basicAuth.setCredentials(username, password); - return; - } - {{#hasOAuthMethods}} - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.getTokenRequestBuilder().setUsername(username).setPassword(password); - return; - } - {{/hasOAuthMethods}} - } - throw new RuntimeException("No Basic authentication or OAuth configured!"); + HttpBasicAuth apiAuthorization = getAuthorization(HttpBasicAuth.class); + apiAuthorization.setCredentials(username, password); } {{#hasOAuthMethods}} /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder + * Helper method to configure the client credentials for Oauth + * @param username Username + * @param password Password */ - public TokenRequestBuilder getTokenEndPoint() { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - return oauth.getTokenRequestBuilder(); - } - } - return null; + public void setClientCredentials(String clientId, String clientSecret) { + OauthClientCredentialsGrant authorization = getAuthorization(OauthClientCredentialsGrant.class); + authorization.configure(clientId, clientSecret); } /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder + * Helper method to configure the username/password for Oauth password grant + * @param username Username + * @param password Password */ - public AuthenticationRequestBuilder getAuthorizationEndPoint() { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - return oauth.getAuthenticationRequestBuilder(); - } - } - return null; + public void setOauthPassword(String username, String password, String clientId, String clientSecret) { + OauthPasswordGrant apiAuthorization = getAuthorization(OauthPasswordGrant.class); + apiAuthorization.configure(username, password, clientId, clientSecret); } /** @@ -327,14 +281,9 @@ public class ApiClient { * @param accessToken Access Token * @param expiresIn Validity period in seconds */ - public void setAccessToken(String accessToken, Long expiresIn) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.setAccessToken(accessToken, expiresIn); - return; - } - } + public void setAccessToken(String accessToken, Integer expiresIn) { + OAuth apiAuthorization = getAuthorization(OAuth.class); + apiAuthorization.setAccessToken(accessToken, expiresIn); } /** @@ -344,19 +293,7 @@ public class ApiClient { * @param redirectURI Redirect URI */ public void configureAuthorizationFlow(String clientId, String clientSecret, String redirectURI) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.getTokenRequestBuilder() - .setClientId(clientId) - .setClientSecret(clientSecret) - .setRedirectURI(redirectURI); - oauth.getAuthenticationRequestBuilder() - .setClientId(clientId) - .setRedirectURI(redirectURI); - return; - } - } + throw new RuntimeException("Not implemented"); } /** @@ -364,13 +301,8 @@ public class ApiClient { * @param accessTokenListener Acesss token listener */ public void registerAccessTokenListener(AccessTokenListener accessTokenListener) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.registerAccessTokenListener(accessTokenListener); - return; - } - } + OAuth apiAuthorization = getAuthorization(OAuth.class); + apiAuthorization.registerAccessTokenListener(accessTokenListener); } {{/hasOAuthMethods}} @@ -396,4 +328,11 @@ public class ApiClient { feignBuilder.requestInterceptor(authorization); } + private T getAuthorization(Class type) { + return (T) apiAuthorizations.values() + .stream() + .filter(requestInterceptor -> type.isAssignableFrom(requestInterceptor.getClass())) + .findFirst() + .orElseThrow(() -> new RuntimeException("No Oauth authentication or OAuth configured!")); + } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/README.mustache index a0fac9d41df..acab659406d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/README.mustache @@ -32,6 +32,41 @@ After the client library is installed/deployed, you can use it in your Maven pro ``` +And to use the api you can follow the examples bellow: + +```java + + //Set bearer token manually + ApiClient apiClient = new ApiClient("petstore_auth_client"); + apiClient.setBasePath("https://localhost:8243/petstore/1/"); + apiClient.setAccessToken("TOKEN", 10000); + + //Use api key + ApiClient apiClient = new ApiClient("api_key", "API KEY"); + apiClient.setBasePath("https://localhost:8243/petstore/1/"); + + //Use http basic authentication + ApiClient apiClient = new ApiClient("basicAuth"); + apiClient.setBasePath("https://localhost:8243/petstore/1/"); + apiClient.setCredentials("username", "password"); + + //Oauth password + ApiClient apiClient = new ApiClient("oauth_password"); + apiClient.setBasePath("https://localhost:8243/petstore/1/"); + apiClient.setOauthPassword("username", "password", "client_id", "client_secret"); + + //Oauth client credentials flow + ApiClient apiClient = new ApiClient("oauth_client_credentials"); + apiClient.setBasePath("https://localhost:8243/petstore/1/"); + apiClient.setClientCredentials("client_id", "client_secret"); + + PetApi petApi = apiClient.buildClient(PetApi.class); + Pet petById = petApi.getPetById(12345L); + + System.out.println(petById); + } +``` + ## Recommendation It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. @@ -40,4 +75,3 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea {{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} {{/-last}}{{/apis}}{{/apiInfo}} - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache index b24c9327129..e9f9d055e02 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache @@ -3,8 +3,8 @@ package {{package}}; import {{invokerPackage}}.ApiClient; {{#imports}}import {{import}}; {{/imports}} -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.BeforeEach; {{^fullJavaUtil}} import java.util.ArrayList; @@ -16,11 +16,11 @@ import java.util.Map; /** * API tests for {{classname}} */ -public class {{classname}}Test { +class {{classname}}Test { private {{classname}} api; - @Before + @BeforeEach public void setup() { api = new ApiClient().buildClient({{classname}}.class); } @@ -32,7 +32,7 @@ public class {{classname}}Test { * {{notes}} */ @Test - public void {{operationId}}Test() { + void {{operationId}}Test() { {{#allParams}} {{{dataType}}} {{paramName}} = null; {{/allParams}} @@ -51,7 +51,7 @@ public class {{classname}}Test { * listing them out individually. */ @Test - public void {{operationId}}TestQueryMap() { + void {{operationId}}TestQueryMap() { {{#allParams}} {{^isQueryParam}} {{{dataType}}} {{paramName}} = null; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/DefaultApi20Impl.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/DefaultApi20Impl.mustache new file mode 100644 index 00000000000..72b0a00495e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/DefaultApi20Impl.mustache @@ -0,0 +1,47 @@ +package {{invokerPackage}}.auth; + +import com.github.scribejava.core.builder.api.DefaultApi20; +import com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor; +import com.github.scribejava.core.extractors.TokenExtractor; +import com.github.scribejava.core.model.OAuth2AccessToken; +import com.github.scribejava.core.oauth2.bearersignature.BearerSignature; +import com.github.scribejava.core.oauth2.bearersignature.BearerSignatureURIQueryParameter; +import com.github.scribejava.core.oauth2.clientauthentication.ClientAuthentication; +import com.github.scribejava.core.oauth2.clientauthentication.RequestBodyAuthenticationScheme; + +{{>generatedAnnotation}} +public class DefaultApi20Impl extends DefaultApi20 { + + private final String accessTokenEndpoint; + private final String authorizationBaseUrl; + + protected DefaultApi20Impl(String authorizationBaseUrl, String accessTokenEndpoint) { + this.authorizationBaseUrl = authorizationBaseUrl; + this.accessTokenEndpoint = accessTokenEndpoint; + } + + @Override + public String getAccessTokenEndpoint() { + return accessTokenEndpoint; + } + + @Override + protected String getAuthorizationBaseUrl() { + return authorizationBaseUrl; + } + + @Override + public BearerSignature getBearerSignature() { + return BearerSignatureURIQueryParameter.instance(); + } + + @Override + public ClientAuthentication getClientAuthentication() { + return RequestBodyAuthenticationScheme.instance(); + } + + @Override + public TokenExtractor getAccessTokenExtractor() { + return OAuth2AccessTokenJsonExtractor.instance(); + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OAuth.mustache index b451e97ae6e..864ee3fe3a5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OAuth.mustache @@ -1,198 +1,81 @@ package {{invokerPackage}}.auth; -import java.io.IOException; -import java.util.Collection; -import java.util.Map; -import java.util.Map.Entry; - -import org.apache.oltu.oauth2.client.HttpClient; -import org.apache.oltu.oauth2.client.OAuthClient; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.client.response.OAuthClientResponse; -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory; -import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; -import org.apache.oltu.oauth2.common.message.types.GrantType; -import org.apache.oltu.oauth2.common.token.BasicOAuthToken; - -import feign.Client; +import com.github.scribejava.core.model.OAuth2AccessToken; +import com.github.scribejava.core.oauth.OAuth20Service; import feign.Request.HttpMethod; -import feign.Request.Options; import feign.RequestInterceptor; import feign.RequestTemplate; -import feign.Response; import feign.RetryableException; -import feign.Util; -import {{invokerPackage}}.StringUtil; +{{>generatedAnnotation}} +public abstract class OAuth implements RequestInterceptor { -public class OAuth implements RequestInterceptor { + static final int MILLIS_PER_SECOND = 1000; - static final int MILLIS_PER_SECOND = 1000; + public interface AccessTokenListener { + void notify(OAuth2AccessToken token); + } - public interface AccessTokenListener { - void notify(BasicOAuthToken token); + private volatile String accessToken; + private Long expirationTimeMillis; + private AccessTokenListener accessTokenListener; + + protected OAuth20Service service; + protected String scopes; + protected String authorizationUrl; + protected String tokenUrl; + + public OAuth(String authorizationUrl, String tokenUrl, String scopes) { + this.scopes = scopes; + this.authorizationUrl = authorizationUrl; + this.tokenUrl = tokenUrl; + } + + @Override + public void apply(RequestTemplate template) { + // If the request already have an authorization (eg. Basic auth), do nothing + if (template.headers().containsKey("Authorization")) { + return; } - - private volatile String accessToken; - private Long expirationTimeMillis; - private OAuthClient oauthClient; - private TokenRequestBuilder tokenRequestBuilder; - private AuthenticationRequestBuilder authenticationRequestBuilder; - private AccessTokenListener accessTokenListener; - - public OAuth(Client client, TokenRequestBuilder requestBuilder) { - this.oauthClient = new OAuthClient(new OAuthFeignClient(client)); - this.tokenRequestBuilder = requestBuilder; + // If first time, get the token + if (expirationTimeMillis == null || System.currentTimeMillis() >= expirationTimeMillis) { + updateAccessToken(template); } - - public OAuth(Client client, OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { - this(client, OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes)); - - switch(flow) { - case accessCode: - case implicit: - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); - break; - case password: - tokenRequestBuilder.setGrantType(GrantType.PASSWORD); - break; - case application: - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); - break; - default: - break; - } - authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl); + if (getAccessToken() != null) { + template.header("Authorization", "Bearer " + getAccessToken()); } + } - public OAuth(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { - this(new Client.Default(null, null), flow, authorizationUrl, tokenUrl, scopes); + private synchronized void updateAccessToken(RequestTemplate template) { + OAuth2AccessToken accessTokenResponse; + try { + accessTokenResponse = getOAuth2AccessToken(); + } catch (Exception e) { + throw new RetryableException(0, e.getMessage(), HttpMethod.POST, e, null, template.request()); } - - @Override - public void apply(RequestTemplate template) { - // If the request already have an authorization (eg. Basic auth), do nothing - if (template.headers().containsKey("Authorization")) { - return; - } - // If first time, get the token - if (expirationTimeMillis == null || System.currentTimeMillis() >= expirationTimeMillis) { - updateAccessToken(template); - } - if (getAccessToken() != null) { - template.header("Authorization", "Bearer " + getAccessToken()); - } + if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { + setAccessToken(accessTokenResponse.getAccessToken(), accessTokenResponse.getExpiresIn()); + if (accessTokenListener != null) { + accessTokenListener.notify(accessTokenResponse); + } } + } - public synchronized void updateAccessToken(RequestTemplate template) { - OAuthJSONAccessTokenResponse accessTokenResponse; - try { - accessTokenResponse = oauthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); - } catch (Exception e) { - throw new RetryableException(0, e.getMessage(), HttpMethod.POST, e, null, template.request()); - } - if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { - setAccessToken(accessTokenResponse.getAccessToken(), accessTokenResponse.getExpiresIn()); - if (accessTokenListener != null) { - accessTokenListener.notify((BasicOAuthToken) accessTokenResponse.getOAuthToken()); - } - } - } + abstract OAuth2AccessToken getOAuth2AccessToken(); - public synchronized void registerAccessTokenListener(AccessTokenListener accessTokenListener) { - this.accessTokenListener = accessTokenListener; - } + abstract OAuthFlow getFlow(); - public synchronized String getAccessToken() { - return accessToken; - } + public synchronized void registerAccessTokenListener(AccessTokenListener accessTokenListener) { + this.accessTokenListener = accessTokenListener; + } - public synchronized void setAccessToken(String accessToken, Long expiresIn) { - this.accessToken = accessToken; - this.expirationTimeMillis = expiresIn == null ? null : System.currentTimeMillis() + expiresIn * MILLIS_PER_SECOND; - } + public synchronized String getAccessToken() { + return accessToken; + } - public TokenRequestBuilder getTokenRequestBuilder() { - return tokenRequestBuilder; - } + public synchronized void setAccessToken(String accessToken, Integer expiresIn) { + this.accessToken = accessToken; + this.expirationTimeMillis = expiresIn == null ? null : System.currentTimeMillis() + expiresIn * MILLIS_PER_SECOND; + } - public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { - this.tokenRequestBuilder = tokenRequestBuilder; - } - - public AuthenticationRequestBuilder getAuthenticationRequestBuilder() { - return authenticationRequestBuilder; - } - - public void setAuthenticationRequestBuilder(AuthenticationRequestBuilder authenticationRequestBuilder) { - this.authenticationRequestBuilder = authenticationRequestBuilder; - } - - public OAuthClient getOauthClient() { - return oauthClient; - } - - public void setOauthClient(OAuthClient oauthClient) { - this.oauthClient = oauthClient; - } - - public void setOauthClient(Client client) { - this.oauthClient = new OAuthClient( new OAuthFeignClient(client)); - } - - public static class OAuthFeignClient implements HttpClient { - - private Client client; - - public OAuthFeignClient() { - this.client = new Client.Default(null, null); - } - - public OAuthFeignClient(Client client) { - this.client = client; - } - - public T execute(OAuthClientRequest request, Map headers, - String requestMethod, Class responseClass) - throws OAuthSystemException, OAuthProblemException { - - RequestTemplate req = new RequestTemplate() - .append(request.getLocationUri()) - .method(requestMethod) - .body(request.getBody()); - - for (Entry entry : headers.entrySet()) { - req.header(entry.getKey(), entry.getValue()); - } - Response feignResponse; - String body = ""; - try { - feignResponse = client.execute(req.request(), new Options()); - body = Util.toString(feignResponse.body().asReader()); - } catch (IOException e) { - throw new OAuthSystemException(e); - } - - String contentType = null; - Collection contentTypeHeader = feignResponse.headers().get("Content-Type"); - if(contentTypeHeader != null) { - contentType = StringUtil.join(contentTypeHeader.toArray(new String[0]), ";"); - } - - return OAuthClientResponseFactory.createCustomResponse( - body, - contentType, - feignResponse.status(), - responseClass - ); - } - - public void shutdown() { - // Nothing to do here - } - } -} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OauthClientCredentialsGrant.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OauthClientCredentialsGrant.mustache new file mode 100644 index 00000000000..ef22c211637 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OauthClientCredentialsGrant.mustache @@ -0,0 +1,39 @@ +package {{invokerPackage}}.auth; + +import com.github.scribejava.core.builder.ServiceBuilder; +import com.github.scribejava.core.model.OAuth2AccessToken; + +{{>generatedAnnotation}} +public class OauthClientCredentialsGrant extends OAuth { + + public OauthClientCredentialsGrant(String authorizationUrl, String tokenUrl, String scopes) { + super(authorizationUrl, tokenUrl, scopes); + } + + @Override + protected OAuth2AccessToken getOAuth2AccessToken() { + try { + return service.getAccessTokenClientCredentialsGrant(scopes); + } catch (Exception e) { + throw new RuntimeException("Failed to get oauth token", e); + } + } + + @Override + protected OAuthFlow getFlow() { + return OAuthFlow.application; + } + + /** + * Configures the client credentials flow + * + * @param clientId + * @param clientSecret + */ + public void configure(String clientId, String clientSecret) { + service = new ServiceBuilder(clientId) + .apiSecret(clientSecret) + .defaultScope(scopes) + .build(new DefaultApi20Impl(authorizationUrl, tokenUrl)); + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OauthPasswordGrant.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OauthPasswordGrant.mustache new file mode 100644 index 00000000000..870c3755a8b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/OauthPasswordGrant.mustache @@ -0,0 +1,48 @@ +package {{invokerPackage}}.auth; + +import com.github.scribejava.core.builder.ServiceBuilder; +import com.github.scribejava.core.model.OAuth2AccessToken; + +{{>generatedAnnotation}} +public class OauthPasswordGrant extends OAuth { + + private String username; + private String password; + + public OauthPasswordGrant(String tokenUrl, String scopes) { + super(null, tokenUrl, scopes); + } + + @Override + protected OAuth2AccessToken getOAuth2AccessToken() { + try { + return service.getAccessTokenPasswordGrant(username, password); + } catch (Exception e) { + throw new RuntimeException("Failed to get oauth token", e); + } + } + + @Override + protected OAuthFlow getFlow() { + return OAuthFlow.password; + } + + /** + * Configures Oauth password grant flow + * Note: this flow is deprecated. + * + * @param username + * @param password + * @param clientId + * @param clientSecret + */ + public void configure(String username, String password, String clientId, String clientSecret) { + this.username = username; + this.password = password; + //TODO the clientId and secret are optional according with the RFC + service = new ServiceBuilder(clientId) + .apiSecret(clientSecret) + .defaultScope(scopes) + .build(new DefaultApi20Impl(authorizationUrl, tokenUrl)); + } +} \ No newline at end of file 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 3e00fb91797..eda36125e37 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 @@ -33,20 +33,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { - {{#supportJava6}} - sourceCompatibility JavaVersion.VERSION_1_6 - targetCompatibility JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} - {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - {{/java8}} - {{/supportJava6}} } // Rename the aar correctly @@ -91,20 +79,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' - {{#supportJava6}} - sourceCompatibility = JavaVersion.VERSION_1_6 - targetCompatibility = JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} - {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 - {{/java8}} - {{^java8}} - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - {{/java8}} - {{/supportJava6}} install { repositories.mavenInstaller { @@ -118,6 +94,10 @@ if(hasProperty('target') && target == 'android') { } } +test { + useJUnitPlatform() +} + ext { swagger_annotations_version = "1.5.24" jackson_version = "2.10.3" @@ -130,8 +110,8 @@ ext { {{/threetenbp}} feign_version = "10.11" feign_form_version = "3.8.0" - junit_version = "4.13.1" - oltu_version = "1.0.1" + junit_version = "5.7.0" + scribejava_version = "8.0.0" } dependencies { @@ -140,6 +120,7 @@ dependencies { implementation "io.github.openfeign:feign-core:$feign_version" implementation "io.github.openfeign:feign-jackson:$feign_version" implementation "io.github.openfeign:feign-slf4j:$feign_version" + implementation "io.github.openfeign:feign-okhttp:$feign_version" implementation "io.github.openfeign.form:feign-form:$feign_form_version" implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" @@ -156,8 +137,15 @@ dependencies { {{#threetenbp}} implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" {{/threetenbp}} - implementation "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" + implementation "com.brsanthu:migbase64:2.2" + implementation "com.github.scribejava:scribejava-core:$scribejava_version" implementation "com.brsanthu:migbase64:2.2" implementation 'javax.annotation:javax.annotation-api:1.3.2' - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version" + testImplementation "com.github.tomakehurst:wiremock-jre8:2.27.2" + testImplementation "org.hamcrest:hamcrest:2.2" + testImplementation "commons-io:commons-io:2.8.0" + testImplementation "ch.qos.logback:logback-classic:1.2.3" } 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 322abb2a5cb..95745cdad26 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 @@ -10,19 +10,25 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.5.24" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "io.github.openfeign" % "feign-core" % "10.11" % "compile", "io.github.openfeign" % "feign-jackson" % "10.11" % "compile", "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.10.3" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}}" % "2.9.10" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", + "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", "javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile", - "junit" % "junit" % "4.13.1" % "test", + "org.junit.jupiter" % "junit-jupiter" % "5.7.0" % "test", + "org.junit.jupiter" % "junit-jupiter-params" % "5.7.0" % "test", + "com.github.tomakehurst" % "wiremock-jre8" % "2.27.2" % "test", + "org.hamcrest" % "hamcrest" % "2.2" % "test", + "commons-io" % "commons-io" % "2.8.0" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/model_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/model_test.mustache new file mode 100644 index 00000000000..0d75e120b09 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/model_test.mustache @@ -0,0 +1,48 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} +import org.junit.jupiter.api.Test; + +{{#fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +{{/fullJavaUtil}} + +/** + * Model tests for {{classname}} + */ +class {{classname}}Test { + {{#models}} + {{#model}} + {{^vendorExtensions.x-is-one-of-interface}} + {{^isEnum}} + private final {{classname}} model = new {{classname}}(); + + {{/isEnum}} + /** + * Model tests for {{classname}} + */ + @Test + void test{{classname}}() { + // TODO: test {{classname}} + } + + {{#allVars}} + /** + * Test the property '{{name}}' + */ + @Test + void {{name}}Test() { + // TODO: test {{name}} + } + + {{/allVars}} + {{/vendorExtensions.x-is-one-of-interface}} + {{/model}} + {{/models}} +} 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 e9abe7dbaad..65b3cc3c214 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 @@ -161,17 +161,7 @@ 3.1.1 none - {{#supportJava6}} - 1.6 - {{/supportJava6}} - {{^supportJava6}} - {{#java8}} - 1.8 - {{/java8}} - {{^java8}} - 1.7 - {{/java8}} - {{/supportJava6}} + 1.8 @@ -257,6 +247,11 @@ feign-form ${feign-form-version} + + io.github.openfeign + feign-okhttp + ${feign-version} + @@ -282,40 +277,38 @@ {{/openApiNullable}} {{#withXml}} - - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - ${jackson-version} - - + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + {{/withXml}} {{#joda}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + {{/joda}} {{#java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + {{/java8}} {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-threetenbp-version} + {{/threetenbp}} - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} + com.github.scribejava + scribejava-core + ${scribejava-version} javax.annotation @@ -326,27 +319,45 @@ - junit - junit + ch.qos.logback + logback-classic + 1.2.3 + test + + + org.junit.jupiter + junit-jupiter ${junit-version} test - com.squareup.okhttp3 - mockwebserver - 3.6.0 + org.junit.jupiter + junit-jupiter-params + ${junit-version} test - org.assertj - assertj-core - 1.7.1 + org.hamcrest + hamcrest + 2.2 + test + + + com.github.tomakehurst + wiremock-jre8 + 2.27.2 + test + + + commons-io + commons-io + 2.8.0 test UTF-8 - {{#supportJava6}}1.6{{/supportJava6}}{{^supportJava6}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/supportJava6}} + 1.8 ${java.version} ${java.version} 1.5.24 @@ -361,8 +372,8 @@ 2.9.10 {{/threetenbp}} 1.3.2 - 4.13.1 + 5.7.0 1.0.0 - 1.0.1 + 8.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 496ff42fcce..14d93d588dc 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 @@ -33,11 +33,6 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 22 } compileOptions { - {{#supportJava6}} - sourceCompatibility JavaVersion.VERSION_1_6 - targetCompatibility JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -46,7 +41,6 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 {{/java8}} - {{/supportJava6}} } // Rename the aar correctly @@ -91,11 +85,6 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' - {{#supportJava6}} - sourceCompatibility = JavaVersion.VERSION_1_6 - targetCompatibility = JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -104,7 +93,6 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 {{/java8}} - {{/supportJava6}} install { repositories.mavenInstaller { 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 17a87a012d4..3a4b62e203b 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 @@ -144,11 +144,6 @@ maven-compiler-plugin 3.6.1 - {{#supportJava6}} - 1.6 - 1.6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} 1.8 1.8 @@ -157,7 +152,6 @@ 1.7 1.7 {{/java8}} - {{/supportJava6}} @@ -166,17 +160,12 @@ 3.1.1 none - {{#supportJava6}} - 1.6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} 1.8 {{/java8}} {{^java8}} 1.7 {{/java8}} - {{/supportJava6}} 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 e8833c12611..69727cd0ace 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 @@ -34,15 +34,9 @@ import java.security.cert.X509Certificate; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; -{{^supportJava6}} import java.nio.file.Files; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; -{{/supportJava6}} -{{#supportJava6}} -import org.apache.commons.io.FileUtils; -import org.glassfish.jersey.filter.LoggingFilter; -{{/supportJava6}} import java.util.logging.Level; import java.util.logging.Logger; import java.util.Collection; @@ -997,13 +991,7 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} { public File downloadFileFromResponse(Response response) throws ApiException { try { File file = prepareDownloadFile(response); -{{^supportJava6}} Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING); -{{/supportJava6}} -{{#supportJava6}} - // Java6 falls back to commons.io for file copying - FileUtils.copyToFile(response.readEntity(InputStream.class), file); -{{/supportJava6}} return file; } catch (IOException e) { throw new ApiException(e); @@ -1259,15 +1247,10 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} { // turn off compliance validation to be able to send payloads with DELETE calls clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); if (debugging) { -{{^supportJava6}} clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); // Set logger to ALL java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL); -{{/supportJava6}} -{{#supportJava6}} - clientConfig.register(new LoggingFilter(java.util.logging.Logger.getLogger(LoggingFilter.class.getName()), true)); -{{/supportJava6}} } else { // suppress warnings for payloads with DELETE calls: java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); 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 9292d599cad..a15919fb9bb 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 @@ -33,11 +33,6 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { - {{#supportJava6}} - sourceCompatibility JavaVersion.VERSION_1_6 - targetCompatibility JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -46,7 +41,6 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 {{/java8}} - {{/supportJava6}} } // Rename the aar correctly @@ -90,11 +84,6 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' - {{#supportJava6}} - sourceCompatibility = JavaVersion.VERSION_1_6 - targetCompatibility = JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -103,7 +92,6 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 {{/java8}} - {{/supportJava6}} install { repositories.mavenInstaller { @@ -124,14 +112,7 @@ ext { {{#openApiNullable}} jackson_databind_nullable_version = "0.2.1" {{/openApiNullable}} - {{#supportJava6}} - jersey_version = "2.6" - commons_io_version=2.5 - commons_lang3_version=3.6 - {{/supportJava6}} - {{^supportJava6}} jersey_version = "2.27" - {{/supportJava6}} junit_version = "4.13.1" {{#threetenbp}} threetenbp_version = "2.9.10" @@ -170,10 +151,6 @@ dependencies { {{#hasHttpSignatureMethods}} implementation "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" {{/hasHttpSignatureMethods}} - {{#supportJava6}} - implementation "commons-io:commons-io:$commons_io_version" - implementation "org.apache.commons:commons-lang3:$commons_lang3_version" - {{/supportJava6}} {{#threetenbp}} implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" {{/threetenbp}} 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 42afc6016ba..52f17959a63 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 @@ -10,11 +10,11 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.5.22", - "org.glassfish.jersey.core" % "jersey-client" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.27"{{/supportJava6}},{{^supportJava6}} - "org.glassfish.jersey.inject" % "jersey-hk2" % "2.27",{{/supportJava6}} - "org.glassfish.jersey.media" % "jersey-media-multipart" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.27"{{/supportJava6}}, - "org.glassfish.jersey.media" % "jersey-media-json-jackson" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.27"{{/supportJava6}}, - "org.glassfish.jersey.connectors" % "jersey-apache-connector" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.27"{{/supportJava6}}, + "org.glassfish.jersey.core" % "jersey-client" % "2.27", + "org.glassfish.jersey.inject" % "jersey-hk2" % "2.27", + "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.27", + "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.27", + "org.glassfish.jersey.connectors" % "jersey-apache-connector" % "2.27", "com.fasterxml.jackson.core" % "jackson-core" % "2.10.4" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.4" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile", @@ -36,10 +36,6 @@ lazy val root = (project in file(".")). {{^java8}} "com.brsanthu" % "migbase64" % "2.2", {{/java8}} - {{#supportJava6}} - "org.apache.commons" % "commons-lang3" % "3.6", - "commons-io" % "commons-io" % "2.5", - {{/supportJava6}} "javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile", "junit" % "junit" % "4.13.1" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/model.mustache index c0664be10de..18ee1211785 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/model.mustache @@ -16,15 +16,10 @@ import com.fasterxml.jackson.annotation.JsonAnySetter; {{/additionalPropertiesType}} {{/model}} {{/models}} -{{^supportJava6}} import java.util.Objects; import java.util.Arrays; import java.util.Map; import java.util.HashMap; -{{/supportJava6}} -{{#supportJava6}} -import org.apache.commons.lang3.ObjectUtils; -{{/supportJava6}} {{#imports}} import {{import}}; {{/imports}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache index 3d1c6cf59db..70fadd299bc 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache @@ -251,7 +251,6 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{/vars}} {{>libraries/jersey2/additional_properties}} -{{^supportJava6}} /** * Return true if this {{name}} object is equal to o. */ @@ -286,30 +285,6 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{/useReflectionEqualsHashCode}} } -{{/supportJava6}} -{{#supportJava6}} - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - }{{#hasVars}} - {{classname}} {{classVarName}} = ({{classname}}) o; - return {{#vars}}ObjectUtils.equals(this.{{name}}, {{classVarName}}.{{name}}){{^-last}} && - {{/-last}}{{/vars}}{{#parent}} && - super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} - return true;{{/hasVars}} - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti({{#vars}}{{name}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); - } - -{{/supportJava6}} - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 293356545b0..e7765a50d1b 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 @@ -145,11 +145,6 @@ maven-compiler-plugin 3.8.1 - {{#supportJava6}} - 1.6 - 1.6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} 1.8 1.8 @@ -158,7 +153,6 @@ 1.7 1.7 {{/java8}} - {{/supportJava6}} true 128m 512m @@ -182,17 +176,12 @@ none - {{#supportJava6}} - 1.6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} 1.8 {{/java8}} {{^java8}} 1.7 {{/java8}} - {{/supportJava6}} http.response.details @@ -262,13 +251,11 @@ jersey-client ${jersey-version} - {{^supportJava6}} org.glassfish.jersey.inject jersey-hk2 ${jersey-version} - {{/supportJava6}} org.glassfish.jersey.media jersey-media-multipart @@ -340,18 +327,6 @@ 2.2 {{/java8}} - {{#supportJava6}} - - org.apache.commons - commons-lang3 - ${commons-lang3-version} - - - commons-io - commons-io - ${commons-io-version} - - {{/supportJava6}} {{#hasHttpSignatureMethods}} org.tomitribe @@ -397,14 +372,7 @@ UTF-8 1.6.1 - {{^supportJava6}} 2.30.1 - {{/supportJava6}} - {{#supportJava6}} - 2.6 - 2.5 - 3.6 - {{/supportJava6}} 2.10.4 2.10.4 0.2.1 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache index 6da087078f0..5b4ff7e38f5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache @@ -18,7 +18,7 @@ ## Requirements Building the API client library requires: -1. Java {{#supportJava6}}1.6{{/supportJava6}}{{^supportJava6}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/supportJava6}}+ +1. Java {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}+ 2. Maven/Gradle ## Installation 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 104fe6d0ff1..c027064edd4 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 @@ -40,11 +40,6 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { - {{#supportJava6}} - sourceCompatibility JavaVersion.VERSION_1_6 - targetCompatibility JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -53,7 +48,6 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 {{/java8}} - {{/supportJava6}} } // Rename the aar correctly @@ -98,11 +92,6 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' - {{#supportJava6}} - sourceCompatibility = JavaVersion.VERSION_1_6 - targetCompatibility = JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -111,7 +100,6 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 {{/java8}} - {{/supportJava6}} install { repositories.mavenInstaller { 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 598312cad6c..d99f278244e 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 @@ -327,7 +327,7 @@ - {{#supportJava6}}1.6{{/supportJava6}}{{^supportJava6}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/supportJava6}} + {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} 1.8.4 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache index 8f3486eb5db..a4489c1e8d1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache @@ -560,13 +560,7 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} { public File downloadFileFromResponse(Response response) throws ApiException { try { File file = prepareDownloadFile(response); -{{^supportJava6}} Files.copy(response.readEntity(InputStream.class), file.toPath()); -{{/supportJava6}} -{{#supportJava6}} - // Java6 falls back to commons.io for file copying - FileUtils.copyToFile(response.readEntity(InputStream.class), file); -{{/supportJava6}} return file; } catch (IOException e) { throw new ApiException(e); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache index ed3020519df..3823153acc7 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 @@ -33,11 +33,6 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 23 } compileOptions { - {{#supportJava6}} - sourceCompatibility JavaVersion.VERSION_1_6 - targetCompatibility JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -46,7 +41,6 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 {{/java8}} - {{/supportJava6}} } // Rename the aar correctly @@ -90,11 +84,6 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' - {{#supportJava6}} - sourceCompatibility = JavaVersion.VERSION_1_6 - targetCompatibility = JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -103,7 +92,6 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 {{/java8}} - {{/supportJava6}} install { repositories.mavenInstaller { @@ -129,10 +117,6 @@ ext { {{^java8}} jodatime_version = "2.9.9" {{/java8}} - {{#supportJava6}} - commons_io_version=2.5 - commons_lang3_version=3.5 - {{/supportJava6}} junit_version = "4.13" } @@ -157,10 +141,6 @@ dependencies { implementation "joda-time:joda-time:$jodatime_version" implementation "com.brsanthu:migbase64:2.2" {{/java8}} - {{#supportJava6}} - implementation "commons-io:commons-io:$commons_io_version" - implementation "org.apache.commons:commons-lang3:$commons_lang3_version" - {{/supportJava6}} implementation 'javax.annotation:javax.annotation-api:1.3.2' testImplementation "junit:junit:$junit_version" } 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 721e4620057..79600b7754c 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 @@ -25,10 +25,6 @@ lazy val root = (project in file(".")). "joda-time" % "joda-time" % "2.9.9" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", {{/java8}} - {{#supportJava6}} - "org.apache.commons" % "commons-lang3" % "3.5" % "compile", - "commons-io" % "commons-io" % "2.5" % "compile", - {{/supportJava6}} "javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile", "junit" % "junit" % "4.13" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" 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 738f438da60..82c5a036087 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 @@ -142,11 +142,6 @@ maven-compiler-plugin 2.5.1 - {{#supportJava6}} - 1.6 - 1.6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} 1.8 1.8 @@ -155,7 +150,6 @@ 1.7 1.7 {{/java8}} - {{/supportJava6}} @@ -164,17 +158,12 @@ 3.1.1 none - {{#supportJava6}} - 1.6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} 1.8 {{/java8}} {{^java8}} 1.7 {{/java8}} - {{/supportJava6}} @@ -263,19 +252,6 @@ {{/java8}} - {{#supportJava6}} - - org.apache.commons - commons-lang3 - ${commons_lang3_version} - - - - commons-io - commons-io - ${commons_io_version} - - {{/supportJava6}} org.jboss.resteasy resteasy-jackson2-provider @@ -317,10 +293,6 @@ {{^java8}} 2.9.9 {{/java8}} - {{#supportJava6}} - 2.5 - 3.6 - {{/supportJava6}} 1.0.0 4.13 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 d41aa90de15..11235a89bb7 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 @@ -33,11 +33,6 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 22 } compileOptions { - {{#supportJava6}} - sourceCompatibility JavaVersion.VERSION_1_6 - targetCompatibility JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -46,7 +41,6 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 {{/java8}} - {{/supportJava6}} } // Rename the aar correctly @@ -91,11 +85,6 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' - {{#supportJava6}} - sourceCompatibility = JavaVersion.VERSION_1_6 - targetCompatibility = JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -104,7 +93,6 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 {{/java8}} - {{/supportJava6}} install { repositories.mavenInstaller { 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 2fdd99cf76f..ca273093471 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 @@ -144,11 +144,6 @@ maven-compiler-plugin 3.6.1 - {{#supportJava6}} - 1.6 - 1.6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} 1.8 1.8 @@ -157,7 +152,6 @@ 1.7 1.7 {{/java8}} - {{/supportJava6}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache index cd1096e5723..ec85f6ec71b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache @@ -33,11 +33,6 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { - {{#supportJava6}} - sourceCompatibility JavaVersion.VERSION_1_6 - targetCompatibility JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -46,7 +41,6 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 {{/java8}} - {{/supportJava6}} } // Rename the aar correctly diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache index d2d5bf60249..b495864db77 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/pom.mustache @@ -144,11 +144,6 @@ maven-compiler-plugin 3.6.1 - {{#supportJava6}} - 1.6 - 1.6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} 1.8 1.8 @@ -157,7 +152,6 @@ 1.7 1.7 {{/java8}} - {{/supportJava6}} @@ -166,17 +160,12 @@ 3.1.1 none - {{#supportJava6}} - 1.6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} 1.8 {{/java8}} {{^java8}} 1.7 {{/java8}} - {{/supportJava6}} 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 517d6a4e844..2bb2fb35613 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 @@ -33,11 +33,6 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { - {{#supportJava6}} - sourceCompatibility JavaVersion.VERSION_1_6 - targetCompatibility JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -46,7 +41,6 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 {{/java8}} - {{/supportJava6}} } // Rename the aar correctly @@ -91,11 +85,6 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' - {{#supportJava6}} - sourceCompatibility = JavaVersion.VERSION_1_6 - targetCompatibility = JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -104,7 +93,6 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 {{/java8}} - {{/supportJava6}} install { repositories.mavenInstaller { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache index a80cefc31dc..c43f800a42c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/ApiClient.mustache @@ -44,7 +44,7 @@ public class ApiClient { public ApiClient() { // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap<{{#supportJava6}}String, Authentication{{/supportJava6}}>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + authentications = new HashMap<>();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} // authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"cookie"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} @@ -62,9 +62,9 @@ public class ApiClient { basePath = basePath + "/"; } - Map extraHeaders = new HashMap<{{#supportJava6}}String, String{{/supportJava6}}>(); - Map extraCookies = new HashMap<{{#supportJava6}}String, String{{/supportJava6}}>(); - List extraQueryParams = new ArrayList<{{#supportJava6}}Pair{{/supportJava6}}>(); + Map extraHeaders = new HashMap<>(); + Map extraCookies = new HashMap<>(); + List extraQueryParams = new ArrayList<>(); for (String authName : authentications.keySet()) { Authentication auth = authentications.get(authName); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache index dcb9e2c58e0..849e0665e8c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/ApiClient.mustache @@ -44,7 +44,7 @@ public class ApiClient { public ApiClient() { // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap<{{#supportJava6}}String, Authentication{{/supportJava6}}>();{{#authMethods}}{{#isBasic}} + authentications = new HashMap<>();{{#authMethods}}{{#isBasic}} // authentications.put("{{name}}", new HttpBasicAuth());{{/isBasic}}{{#isApiKey}} authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{#isKeyInQuery}}"query"{{/isKeyInQuery}}{{#isKeyInCookie}}"query"{{/isKeyInCookie}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} // authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} @@ -61,9 +61,9 @@ public class ApiClient { basePath = basePath + "/"; } - Map extraHeaders = new HashMap<{{#supportJava6}}String, String{{/supportJava6}}>(); - Map extraCookies = new HashMap<{{#supportJava6}}String, String{{/supportJava6}}>(); - List extraQueryParams = new ArrayList<{{#supportJava6}}Pair{{/supportJava6}}>(); + Map extraHeaders = new HashMap<>(); + Map extraCookies = new HashMap<>(); + List extraQueryParams = new ArrayList<>(); for (String authName : authentications.keySet()) { Authentication auth = authentications.get(authName); 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 7cb390987b3..32d395bf02e 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 @@ -144,11 +144,6 @@ maven-compiler-plugin 3.6.1 - {{#supportJava6}} - 1.6 - 1.6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} 1.8 1.8 @@ -157,7 +152,6 @@ 1.7 1.7 {{/java8}} - {{/supportJava6}} @@ -166,17 +160,12 @@ 3.1.1 none - {{#supportJava6}} - 1.6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} 1.8 {{/java8}} {{^java8}} 1.7 {{/java8}} - {{/supportJava6}} @@ -414,7 +403,7 @@ UTF-8 - {{#supportJava6}}1.6{{/supportJava6}}{{^supportJava6}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/supportJava6}} + {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} 1.8.3 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache index 3c17645d6c8..83b6e863ae2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache @@ -123,10 +123,10 @@ public class ApiClient{{#java8}} extends JavaTimeFormatter{{/java8}} { public synchronized WebClient getWebClient() { String webClientIdentifier = "web-client-" + identifier; - WebClient webClient = Vertx.currentContext().get(webClientIdentifier); + WebClient webClient = this.vertx.getOrCreateContext().get(webClientIdentifier); if (webClient == null) { webClient = buildWebClient(vertx, config); - Vertx.currentContext().put(webClientIdentifier, webClient); + this.vertx.getOrCreateContext().put(webClientIdentifier, webClient); } return webClient; } 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 d9882a1866c..b4064662a98 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 @@ -154,17 +154,12 @@ 3.1.1 none - {{#supportJava6}} - 1.6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} 1.8 {{/java8}} {{^java8}} 1.7 {{/java8}} - {{/supportJava6}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache index 83178188549..5fbef45db81 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache @@ -62,7 +62,7 @@ public class {{classname}} { * @see {{summary}} Documentation {{/externalDocs}} */ - public {{#returnType}}{{#isArray}}Flux<{{{returnBaseType}}}>{{/isArray}}{{^isArray}}Mono<{{{returnType}}}>{{/isArray}} {{/returnType}}{{^returnType}}Mono {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { + public {{#returnType}}{{#isArray}}Flux<{{{returnBaseType}}}>{{/isArray}}{{^isArray}}Mono<{{{returnType}}}>{{/isArray}} {{/returnType}}{{^returnType}}Mono {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}} {{#required}} @@ -109,7 +109,7 @@ public class {{classname}} { {{#formParams}} if ({{paramName}} != null) - formParams.add{{#collectionFormat}}All{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}new FileSystemResource({{paramName}}){{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream().map(FileSystemResource::new).collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}); + formParams.add{{#collectionFormat}}All{{/collectionFormat}}("{{baseName}}", {{#isFile}}{{^collectionFormat}}{{#useAbstractionForFiles}}{{paramName}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}new FileSystemResource({{paramName}}){{/useAbstractionForFiles}}{{/collectionFormat}}{{/isFile}}{{#isFile}}{{#collectionFormat}}{{paramName}}.stream(){{^useAbstractionForFiles}}.map(FileSystemResource::new){{/useAbstractionForFiles}}.collect(Collectors.toList()){{/collectionFormat}}{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}); {{/formParams}} {{/hasFormParams}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache index 301acf8f244..c2b491aedc1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache @@ -31,7 +31,7 @@ public class {{classname}}Test { @Test public void {{operationId}}Test() { {{#allParams}} - {{{dataType}}} {{paramName}} = null; + {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; {{/allParams}} {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#isArray}}.collectList().block(){{/isArray}}{{^isArray}}.block(){{/isArray}}; 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 028d9e5cc51..c892d189243 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 @@ -34,11 +34,6 @@ if(hasProperty('target') && target == 'android') { } compileOptions { - {{#supportJava6}} - sourceCompatibility JavaVersion.VERSION_1_6 - targetCompatibility JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -47,7 +42,6 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 {{/java8}} - {{/supportJava6}} } // Rename the aar correctly @@ -92,11 +86,6 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' - {{#supportJava6}} - sourceCompatibility = JavaVersion.VERSION_1_6 - targetCompatibility = JavaVersion.VERSION_1_6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -105,7 +94,6 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 {{/java8}} - {{/supportJava6}} install { repositories.mavenInstaller { diff --git a/modules/openapi-generator/src/main/resources/Java/model.mustache b/modules/openapi-generator/src/main/resources/Java/model.mustache index d4d1447a1d4..dec0b7dc8ac 100644 --- a/modules/openapi-generator/src/main/resources/Java/model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/model.mustache @@ -6,13 +6,8 @@ package {{package}}; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; {{/useReflectionEqualsHashCode}} -{{^supportJava6}} import java.util.Objects; import java.util.Arrays; -{{/supportJava6}} -{{#supportJava6}} -import org.apache.commons.lang3.ObjectUtils; -{{/supportJava6}} {{#imports}} import {{import}}; {{/imports}} diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache index 03cf219b760..81eeb24af08 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache @@ -228,7 +228,6 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{/vars}} -{{^supportJava6}} @Override public boolean equals(Object o) { {{#useReflectionEqualsHashCode}} @@ -259,30 +258,6 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{/useReflectionEqualsHashCode}} } -{{/supportJava6}} -{{#supportJava6}} - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - }{{#hasVars}} - {{classname}} {{classVarName}} = ({{classname}}) o; - return {{#vars}}ObjectUtils.equals(this.{{name}}, {{classVarName}}.{{name}}){{^-last}} && - {{/-last}}{{/vars}}{{#parent}} && - super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} - return true;{{/hasVars}} - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti({{#vars}}{{name}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); - } - -{{/supportJava6}} - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/modules/openapi-generator/src/main/resources/Java/pom.mustache b/modules/openapi-generator/src/main/resources/Java/pom.mustache index 75b0e9ef5c6..efe442bef78 100644 --- a/modules/openapi-generator/src/main/resources/Java/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pom.mustache @@ -159,11 +159,6 @@ maven-compiler-plugin 3.6.1 - {{#supportJava6}} - 1.6 - 1.6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} 1.8 1.8 @@ -172,7 +167,6 @@ 1.7 1.7 {{/java8}} - {{/supportJava6}} @@ -181,17 +175,12 @@ 3.1.1 none - {{#supportJava6}} - 1.6 - {{/supportJava6}} - {{^supportJava6}} {{#java8}} 1.8 {{/java8}} {{^java8}} 1.7 {{/java8}} - {{/supportJava6}} @@ -329,18 +318,6 @@ 2.2 {{/java8}} - {{#supportJava6}} - - org.apache.commons - commons-lang3 - ${commons_lang3_version} - - - commons-io - commons-io - ${commons_io_version} - - {{/supportJava6}} {{#useBeanValidation}} @@ -385,10 +362,6 @@ UTF-8 1.5.21 1.19.4 - {{#supportJava6}} - 2.5 - 3.6 - {{/supportJava6}} 2.10.3 {{#threetenbp}} 2.9.10 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache index 714dbf9d1db..9eb362285cb 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache @@ -71,9 +71,11 @@ public class {{classname}} { }{{/isOAuth}}){{^-last}}, {{/-last}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) - @io.swagger.annotations.ApiResponses(value = { {{#responses}} - @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}}, - {{/-last}}{{/responses}} }) + @io.swagger.annotations.ApiResponses(value = { + {{#responses}} + @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}},{{/-last}} + {{/responses}} + }) public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}},{{/allParams}}@Context SecurityContext securityContext) throws NotFoundException { return delegate.{{nickname}}({{#allParams}}{{#isFormParam}}{{#isFile}}{{paramName}}Bodypart{{/isFile}}{{/isFormParam}}{{^isFile}}{{paramName}}{{/isFile}}{{^isFormParam}}{{#isFile}}{{paramName}}{{/isFile}}{{/isFormParam}}, {{/allParams}}securityContext); diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidation.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidation.mustache index 56b047acef0..978069fbeec 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidation.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidation.mustache @@ -53,4 +53,4 @@ {{/isInteger}} {{^isPrimitiveType}} @Valid -{{/isPrimitiveType}} +{{/isPrimitiveType}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/build.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/build.mustache index 379521797a2..df0dace75ba 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/build.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/build.mustache @@ -10,6 +10,6 @@ scalaVersion := "2.12.6" libraryDependencies += "org.webjars" % "swagger-ui" % "3.32.5" {{/useSwaggerUI}} {{#useBeanValidation}} -libraryDependencies += "javax.validation" % "validation-api" % "1.1.0.Final" +libraryDependencies += "javax.validation" % "validation-api" % "2.0.1.Final" {{/useBeanValidation}} libraryDependencies += guice diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache index 8eb2397060e..d25b2b8be69 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache @@ -26,9 +26,15 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali @SerializedName("{{baseName}}") {{/gson}} {{#isContainer}} + {{#useBeanValidation}} + {{>beanValidation}} + {{/useBeanValidation}} private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}}; {{/isContainer}} {{^isContainer}} + {{#useBeanValidation}} + {{>beanValidation}} + {{/useBeanValidation}} private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/isContainer}} @@ -78,10 +84,10 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/maximum}} * @return {{name}} **/ - {{#vendorExtensions.x-extra-annotation}} + {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} - {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { + public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index a07d9a62f1d..3938d4d289e 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -132,7 +132,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{^parent}} return false; }{{#hasVars}} {{classname}} {{classVarName}} = ({{classname}}) o; - return {{#vars}}Objects.equals(this.{{name}}, {{classVarName}}.{{name}}){{^-last}} && + return {{#vars}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{^-last}} && {{/-last}}{{/vars}}{{#parent}} && super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} return true;{{/hasVars}} @@ -140,7 +140,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{^parent}} @Override public int hashCode() { - return Objects.hash({{#vars}}{{name}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); + return Objects.hash({{#vars}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); } @Override diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/apiVerticle.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/apiVerticle.mustache index 884426b8d5f..84a896245fb 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/apiVerticle.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/apiVerticle.mustache @@ -52,7 +52,7 @@ public class {{classname}}Verticle extends AbstractVerticle { Json.mapper.getTypeFactory().constructCollectionType(List.class, {{{baseType}}}.class)); {{/required}} {{^required}} - {{{dataType}}} {{paramName}} = ({{paramName}}Param == null) ? {{#defaultValue}}{{defaultValue}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} : Json.mapper.readValue({{paramName}}Param.encode(), + {{{dataType}}} {{paramName}} = ({{paramName}}Param == null) ? {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} : Json.mapper.readValue({{paramName}}Param.encode(), Json.mapper.getTypeFactory().constructCollectionType(List.class, {{{baseType}}}.class)); {{/required}} {{/isArray}} @@ -81,7 +81,7 @@ public class {{classname}}Verticle extends AbstractVerticle { {{{dataType}}} {{paramName}} = Json.mapper.readValue({{paramName}}Param, {{{dataType}}}.class); {{/required}} {{^required}} - {{{dataType}}} {{paramName}} = ({{paramName}}Param == null) ? {{#defaultValue}}{{defaultValue}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} : Json.mapper.readValue({{paramName}}Param, {{{dataType}}}.class); + {{{dataType}}} {{paramName}} = ({{paramName}}Param == null) ? {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} : Json.mapper.readValue({{paramName}}Param, {{{dataType}}}.class); {{/required}} {{/isString}} {{/isPrimitiveType}} diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/apiHandler.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/apiHandler.mustache index b8cab88ea44..e9a6bbf0663 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/apiHandler.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/apiHandler.mustache @@ -5,7 +5,7 @@ package {{package}}; import com.fasterxml.jackson.core.type.TypeReference; import io.vertx.core.json.jackson.DatabindCodec; -import io.vertx.ext.web.openapi.RouterFactory; +import io.vertx.ext.web.openapi.RouterBuilder; import io.vertx.ext.web.validation.RequestParameters; import io.vertx.ext.web.validation.RequestParameter; import io.vertx.ext.web.validation.ValidationHandler; @@ -27,10 +27,10 @@ public class {{classname}}Handler { this.apiImpl = new {{classname}}Impl(); } - public void mount(RouterFactory factory) { + public void mount(RouterBuilder builder) { {{#operations}} {{#operation}} - factory.operation("{{operationId}}").handler(this::{{operationId}}); + builder.operation("{{operationId}}").handler(this::{{operationId}}); {{/operation}} {{/operations}} } diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/HttpServerVerticle.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/HttpServerVerticle.mustache index 51de8394f1a..03001005bca 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/HttpServerVerticle.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/HttpServerVerticle.mustache @@ -5,8 +5,8 @@ import io.vertx.core.Promise; import io.vertx.core.http.HttpServerOptions; import io.vertx.ext.web.Router; import io.vertx.ext.web.RoutingContext; -import io.vertx.ext.web.openapi.RouterFactory; -import io.vertx.ext.web.openapi.RouterFactoryOptions; +import io.vertx.ext.web.openapi.RouterBuilder; +import io.vertx.ext.web.openapi.RouterBuilderOptions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; {{#apiInfo}}{{#apis}} @@ -22,16 +22,16 @@ public class HttpServerVerticle extends AbstractVerticle { @Override public void start(Promise startPromise) { - RouterFactory.create(vertx, specFile) - .map(factory -> { - factory.setOptions(new RouterFactoryOptions() + RouterBuilder.create(vertx, specFile) + .map(builder -> { + builder.setOptions(new RouterBuilderOptions() // For production use case, you need to enable this flag and provide the proper security handler .setRequireSecurityHandlers(false) ); {{#apiInfo}}{{#apis}} - {{classVarName}}Handler.mount(factory);{{/apis}}{{/apiInfo}} + {{classVarName}}Handler.mount(builder);{{/apis}}{{/apiInfo}} - Router router = factory.createRouter(); + Router router = builder.createRouter(); router.errorHandler(400, this::validationFailureHandler); return router; diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/pom.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/pom.mustache index 6f3497cd231..da3bb233cf8 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/pom.mustache @@ -17,8 +17,8 @@ 2.22.2 1.5.0 - 4.0.0.Beta3 - 5.6.2 + 4.0.0 + 5.7.0 1.7.30 2.11.2 diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/api.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/api.mustache index 87b27a51ad9..63cb101aadb 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/api.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/api.mustache @@ -53,7 +53,8 @@ export default class <&classname> extends ApiClient { let queryParams = {<#queryParams> '': <#collectionFormat>this.buildCollectionParam(<#required><^required>opts[''], '')<^collectionFormat><#required><^required>opts['']<^-last>, }; - let headerParams = {<#headerParams> + let headerParams = { + 'User-Agent': '<#httpUserAgent><.><^httpUserAgent>OpenAPI-Generator/<&projectVersion>/Javascript',<#headerParams> '': <#required><^required>opts['']<^-last>, }; let formParams = {<#formParams> diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache index c356fd6f45e..a226cfc08aa 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache @@ -52,7 +52,9 @@ class ApiClient { * @type {Array.} * @default {} */{{/emitJSDoc}} - this.defaultHeaders = {}; + this.defaultHeaders = { + 'User-Agent': '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{projectVersion}}/Javascript{{/httpUserAgent}}' + }; /** * The default HTTP timeout for all API calls. diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 7a0d6556be6..18bfd3dc556 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -126,6 +126,7 @@ org.openapitools.codegen.languages.TypeScriptAxiosClientCodegen org.openapitools.codegen.languages.TypeScriptFetchClientCodegen org.openapitools.codegen.languages.TypeScriptInversifyClientCodegen org.openapitools.codegen.languages.TypeScriptJqueryClientCodegen +org.openapitools.codegen.languages.TypeScriptNestjsClientCodegen org.openapitools.codegen.languages.TypeScriptNodeClientCodegen org.openapitools.codegen.languages.TypeScriptReduxQueryClientCodegen org.openapitools.codegen.languages.TypeScriptRxjsClientCodegen diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpFileElement.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpFileElement.cpp.mustache index ff515e56989..4163b8be316 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpFileElement.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpFileElement.cpp.mustache @@ -57,9 +57,13 @@ QJsonValue {{prefix}}HttpFileElement::asJsonValue() const { if (!result) { qDebug() << "Error opening file " << local_filename; } - return QJsonDocument::fromBinaryData(bArray.data()).object(); +#if QT_VERSION >= 0x051500 + return QJsonDocument::fromJson(bArray.data()).object(); +#else + return QJsonDocument::fromBinaryData(bArray.data()).object(); +#endif } - + bool {{prefix}}HttpFileElement::fromStringValue(const QString &instr) { QFile file(local_filename); bool result = false; @@ -82,7 +86,11 @@ bool {{prefix}}HttpFileElement::fromJsonValue(const QJsonValue &jval) { file.remove(); } result = file.open(QIODevice::WriteOnly); +#if QT_VERSION >= 0x051500 + file.write(QJsonDocument(jval.toObject()).toJson()); +#else file.write(QJsonDocument(jval.toObject()).toBinaryData()); +#endif file.close(); if (!result) { qDebug() << "Error creating file " << local_filename; diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache index 57692b69d8a..4ce0cfb2d6d 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache @@ -6,7 +6,12 @@ #include #include #include -#include {{#contentCompression}} +#include +#if QT_VERSION >= 0x051500 + #define SKIP_EMPTY_PARTS Qt::SkipEmptyParts +#else + #define SKIP_EMPTY_PARTS QString::SkipEmptyParts +#endif{{#contentCompression}} #include {{/contentCompression}} #include "{{prefix}}HttpRequest.h" @@ -46,7 +51,13 @@ void {{prefix}}HttpRequestInput::add_file(QString variable_name, QString local_f {{prefix}}HttpRequestWorker::{{prefix}}HttpRequestWorker(QObject *parent, QNetworkAccessManager *_manager) : QObject(parent), manager(_manager), timeOutTimer(this), isResponseCompressionEnabled(false), isRequestCompressionEnabled(false), httpResponseCode(-1) { + +#if QT_VERSION >= 0x051500 + randomGenerator = QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch()); +#else qsrand(QDateTime::currentDateTime().toTime_t()); +#endif + if (manager == nullptr) { manager = new QNetworkAccessManager(this); } @@ -205,31 +216,36 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) { // variable layout is MULTIPART boundary = QString("__-----------------------%1%2") - .arg(QDateTime::currentDateTime().toTime_t()) - .arg(qrand()); + #if QT_VERSION >= 0x051500 + .arg(QDateTime::currentDateTime().toSecsSinceEpoch()) + .arg(randomGenerator.generate()); + #else + .arg(QDateTime::currentDateTime().toTime_t()) + .arg(qrand()); + #endif QString boundary_delimiter = "--"; QString new_line = "\r\n"; // add variables foreach (QString key, input->vars.keys()) { // add boundary - request_content.append(boundary_delimiter); - request_content.append(boundary); - request_content.append(new_line); + request_content.append(boundary_delimiter.toUtf8()); + request_content.append(boundary.toUtf8()); + request_content.append(new_line.toUtf8()); // add header request_content.append("Content-Disposition: form-data; "); - request_content.append(http_attribute_encode("name", key)); - request_content.append(new_line); + request_content.append(http_attribute_encode("name", key).toUtf8()); + request_content.append(new_line.toUtf8()); request_content.append("Content-Type: text/plain"); - request_content.append(new_line); + request_content.append(new_line.toUtf8()); // add header to body splitter - request_content.append(new_line); + request_content.append(new_line.toUtf8()); // add variable content - request_content.append(input->vars.value(key)); - request_content.append(new_line); + request_content.append(input->vars.value(key).toUtf8()); + request_content.append(new_line.toUtf8()); } // add files @@ -263,38 +279,38 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) { } // add boundary - request_content.append(boundary_delimiter); - request_content.append(boundary); - request_content.append(new_line); + request_content.append(boundary_delimiter.toUtf8()); + request_content.append(boundary.toUtf8()); + request_content.append(new_line.toUtf8()); // add header request_content.append( - QString("Content-Disposition: form-data; %1; %2").arg(http_attribute_encode("name", file_info->variable_name), http_attribute_encode("filename", file_info->request_filename))); - request_content.append(new_line); + QString("Content-Disposition: form-data; %1; %2").arg(http_attribute_encode("name", file_info->variable_name), http_attribute_encode("filename", file_info->request_filename)).toUtf8()); + request_content.append(new_line.toUtf8()); if (file_info->mime_type != nullptr && !file_info->mime_type.isEmpty()) { request_content.append("Content-Type: "); - request_content.append(file_info->mime_type); - request_content.append(new_line); + request_content.append(file_info->mime_type.toUtf8()); + request_content.append(new_line.toUtf8()); } request_content.append("Content-Transfer-Encoding: binary"); - request_content.append(new_line); + request_content.append(new_line.toUtf8()); // add header to body splitter - request_content.append(new_line); + request_content.append(new_line.toUtf8()); // add file content request_content.append(file.readAll()); - request_content.append(new_line); + request_content.append(new_line.toUtf8()); file.close(); } // add end of body - request_content.append(boundary_delimiter); - request_content.append(boundary); - request_content.append(boundary_delimiter); + request_content.append(boundary_delimiter.toUtf8()); + request_content.append(boundary.toUtf8()); + request_content.append(boundary_delimiter.toUtf8()); } if (input->request_body.size() > 0) { @@ -408,14 +424,14 @@ void {{prefix}}HttpRequestWorker::on_reply_timeout(QNetworkReply *reply) { void {{prefix}}HttpRequestWorker::process_response(QNetworkReply *reply) { if (getResponseHeaders().contains(QString("Content-Disposition"))) { - auto contentDisposition = getResponseHeaders().value(QString("Content-Disposition").toUtf8()).split(QString(";"), QString::SkipEmptyParts); + auto contentDisposition = getResponseHeaders().value(QString("Content-Disposition").toUtf8()).split(QString(";"), SKIP_EMPTY_PARTS); auto contentType = - getResponseHeaders().contains(QString("Content-Type")) ? getResponseHeaders().value(QString("Content-Type").toUtf8()).split(QString(";"), QString::SkipEmptyParts).first() : QString(); + getResponseHeaders().contains(QString("Content-Type")) ? getResponseHeaders().value(QString("Content-Type").toUtf8()).split(QString(";"), SKIP_EMPTY_PARTS).first() : QString(); if ((contentDisposition.count() > 0) && (contentDisposition.first() == QString("attachment"))) { QString filename = QUuid::createUuid().toString(); for (const auto &file : contentDisposition) { if (file.contains(QString("filename"))) { - filename = file.split(QString("="), QString::SkipEmptyParts).at(1); + filename = file.split(QString("="), SKIP_EMPTY_PARTS).at(1); break; } } @@ -425,14 +441,14 @@ void {{prefix}}HttpRequestWorker::process_response(QNetworkReply *reply) { } } else if (getResponseHeaders().contains(QString("Content-Type"))) { - auto contentType = getResponseHeaders().value(QString("Content-Type").toUtf8()).split(QString(";"), QString::SkipEmptyParts); + auto contentType = getResponseHeaders().value(QString("Content-Type").toUtf8()).split(QString(";"), SKIP_EMPTY_PARTS); if ((contentType.count() > 0) && (contentType.first() == QString("multipart/form-data"))) { // TODO : Handle Multipart responses } else { if(headers.contains("Content-Encoding")){ - auto encoding = headers.value("Content-Encoding").split(QString(";"), QString::SkipEmptyParts); + auto encoding = headers.value("Content-Encoding").split(QString(";"), SKIP_EMPTY_PARTS); if(encoding.count() > 0){ - auto compressionTypes = encoding.first().split(',', QString::SkipEmptyParts); + auto compressionTypes = encoding.first().split(',', SKIP_EMPTY_PARTS); if(compressionTypes.contains("gzip", Qt::CaseInsensitive) || compressionTypes.contains("deflate", Qt::CaseInsensitive)){ response = decompress(reply->readAll()); } else if(compressionTypes.contains("identity", Qt::CaseInsensitive)){ diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache index e04b1eeb187..a853306225d 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache @@ -14,6 +14,9 @@ #include #include #include +#if QT_VERSION >= 0x051500 + #include +#endif #include "{{prefix}}HttpFileElement.h" @@ -86,6 +89,9 @@ private: bool isResponseCompressionEnabled; bool isRequestCompressionEnabled; int httpResponseCode; +#if QT_VERSION >= 0x051500 + QRandomGenerator randomGenerator; +#endif void on_reply_timeout(QNetworkReply *reply); void on_reply_finished(QNetworkReply *reply); diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache index 9dbb60f4eeb..fb48260ace7 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache @@ -165,7 +165,7 @@ void {{classname}}::{{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName {{/isBasicBearer}}{{#isBasicBasic}} if(!_username.isEmpty() && !_password.isEmpty()){ QByteArray b64; - b64.append(_username + ":" + _password); + b64.append(_username.toUtf8() + ":" + _password.toUtf8()); addHeaders("Authorization","Basic " + b64.toBase64()); }{{/isBasicBasic}}{{/authMethods}} {{#queryParams}}{{^collectionFormat}} @@ -230,7 +230,7 @@ void {{classname}}::{{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName QString output({{paramName}});{{/isString}}{{#isByteArray}}QString output({{paramName}});{{/isByteArray}}{{^isString}}{{^isByteArray}}{{^isFile}} QString output = {{paramName}}.asJson();{{/isFile}}{{/isByteArray}}{{/isString}}{{#isFile}}{{#hasConsumes}}input.headers.insert("Content-Type", {{#consumes}}{{^-first}}, {{/-first}}"{{mediaType}}"{{/consumes}});{{/hasConsumes}} QByteArray output = {{paramName}}.asByteArray();{{/isFile}} - input.request_body.append(output); + input.request_body.append(output.toUtf8()); {{/isContainer}}{{/bodyParams}}{{#headerParams}} if (!::{{cppNamespace}}::toStringValue({{paramName}}).isEmpty()) { input.headers.insert("{{baseName}}", ::{{cppNamespace}}::toStringValue({{paramName}})); diff --git a/modules/openapi-generator/src/main/resources/crystal/README.mustache b/modules/openapi-generator/src/main/resources/crystal/README.mustache index 20705236b9c..56a8bbf09d8 100644 --- a/modules/openapi-generator/src/main/resources/crystal/README.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/README.mustache @@ -1,6 +1,6 @@ # {{shardName}} -The Crystsal module for the {{appName}} +The Crystal module for the {{appName}} {{#appDescriptionWithNewLines}} {{{appDescriptionWithNewLines}}} diff --git a/modules/openapi-generator/src/main/resources/dart-dio/api.mustache b/modules/openapi-generator/src/main/resources/dart-dio/api.mustache index ee4b9a0579c..dcfedc065ed 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/api.mustache @@ -33,7 +33,8 @@ class {{classname}} { final String _path = '{{{path}}}'{{#pathParams}}.replaceAll('{' r'{{baseName}}' '}', {{{paramName}}}.toString()){{/pathParams}}; final queryParams = {}; - final headerParams = { + final headerParams = { {{#httpUserAgent}} + 'User-Agent': '{{{.}}}',{{/httpUserAgent}} if (headers != null) ...headers, }; dynamic bodyData; @@ -52,26 +53,15 @@ class {{classname}} { ];{{/hasConsumes}} {{#hasFormParams}} - final formData = {}; + final formData = { + {{#formParams}} + {{^required}}{{^nullable}}if ({{paramName}} != null) {{/nullable}}{{/required}}r'{{baseName}}': {{#isFile}}MultipartFile.fromBytes({{paramName}}, filename: r'{{baseName}}'){{/isFile}}{{^isFile}}parameterToString(_serializers, {{paramName}}){{/isFile}}, + {{/formParams}} + }; {{#isMultipart}} - {{#formParams}} - {{^isFile}} - if ({{paramName}} != null) { - formData[r'{{baseName}}'] = parameterToString(_serializers, {{paramName}}); - } - {{/isFile}} - {{#isFile}} - if ({{paramName}} != null) { - formData[r'{{baseName}}'] = MultipartFile.fromBytes({{paramName}}, filename: r'{{baseName}}'); - } - {{/isFile}} - {{/formParams}} bodyData = FormData.fromMap(formData); {{/isMultipart}} {{^isMultipart}} - {{#formParams}} - formData['{{baseName}}'] = parameterToString(_serializers, {{paramName}}); - {{/formParams}} bodyData = formData; {{/isMultipart}} {{/hasFormParams}} @@ -89,7 +79,7 @@ class {{classname}} { {{/isContainer}} {{^isContainer}} {{#isPrimitiveType}} - var serializedBody = {{paramName}}; + final serializedBody = {{paramName}}; {{/isPrimitiveType}} {{^isPrimitiveType}} final bodySerializer = _serializers.serializerForType({{{baseType}}}) as Serializer<{{{baseType}}}>; diff --git a/modules/openapi-generator/src/main/resources/dart/api_client.mustache b/modules/openapi-generator/src/main/resources/dart/api_client.mustache index 0e240523542..9bb3d59bc52 100644 --- a/modules/openapi-generator/src/main/resources/dart/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/dart/api_client.mustache @@ -23,6 +23,7 @@ class ApiClient { _authentications['{{name}}'] = new HttpBasicAuth();{{/isBasic}}{{#isApiKey}} _authentications['{{name}}'] = new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}");{{/isApiKey}}{{#isOAuth}} _authentications['{{name}}'] = new OAuth();{{/isOAuth}}{{/authMethods}} + {{#httpUserAgent}}addDefaultHeader('User-Agent', '{{{.}}}');{{/httpUserAgent}} } void addDefaultHeader(String key, String value) { diff --git a/modules/openapi-generator/src/main/resources/dart2/enum.mustache b/modules/openapi-generator/src/main/resources/dart2/enum.mustache index 0af2b0a47fe..d3ba3f350a8 100644 --- a/modules/openapi-generator/src/main/resources/dart2/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/enum.mustache @@ -6,13 +6,6 @@ class {{{classname}}} { /// The underlying value of this enum member. final {{{dataType}}} value; - @override - bool operator ==(Object other) => identical(this, other) || - other is {{{classname}}} && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value{{^isString}}.toString(){{/isString}}; diff --git a/modules/openapi-generator/src/main/resources/dart2/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart2/enum_inline.mustache index 7daf6dea1f7..7d6fbed5c4f 100644 --- a/modules/openapi-generator/src/main/resources/dart2/enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/enum_inline.mustache @@ -6,13 +6,6 @@ class {{{classname}}}{{{enumName}}} { /// The underlying value of this enum member. final {{{dataType}}} value; - @override - bool operator ==(Object other) => identical(this, other) || - other is {{{classname}}}{{{enumName}}} && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value{{^isString}}.toString(){{/isString}}; diff --git a/modules/openapi-generator/src/main/resources/elixir/api.mustache b/modules/openapi-generator/src/main/resources/elixir/api.mustache index 999b7a661a6..7979112f560 100644 --- a/modules/openapi-generator/src/main/resources/elixir/api.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/api.mustache @@ -35,8 +35,8 @@ defmodule {{moduleName}}.Api.{{classname}} do {{/optionalParams}} ## Returns - {:ok, {{#isArray}}[%{{&returnBaseType}}{}, ...]{{/isArray}}{{#isMap}}%{}{{/isMap}}{{^returnType}}%{}{{/returnType}}{{#returnSimpleType}}%{{#returnType}}{{#isMap}}{{/isMap}}{{{moduleName}}}.Model.{{{returnType}}}{{/returnType}}{}{{/returnSimpleType}}} on success - {:error, info} on failure + {:ok, {{#isArray}}[%{{&returnBaseType}}{}, ...]{{/isArray}}{{#isMap}}%{}{{/isMap}}{{^returnType}}nil{{/returnType}}{{#returnSimpleType}}{{#returnType}}{{#isMap}}{{/isMap}}{{{returnType}}}{{/returnType}}{{/returnSimpleType}}} on success + {:error, Tesla.Env.t} on failure """ {{{typespec}}} def {{{operationId}}}(connection, {{#requiredParams}}{{#underscored}}{{{paramName}}}{{/underscored}}, {{/requiredParams}}{{^hasOptionalParams}}_{{/hasOptionalParams}}opts \\ []) do @@ -67,6 +67,9 @@ defmodule {{moduleName}}.Api.{{classname}} do |> add_optional_params(optional_params, opts) {{/-first}} {{/optionalParams}} +{{#requiresHttpcWorkaround}} + |> ensure_body() +{{/requiresHttpcWorkaround}} |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> evaluate_response({{#responses}}{{#-first}}[ diff --git a/modules/openapi-generator/src/main/resources/elixir/model.mustache b/modules/openapi-generator/src/main/resources/elixir/model.mustache index a990149ea3e..8f9c6fe0d17 100644 --- a/modules/openapi-generator/src/main/resources/elixir/model.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/model.mustache @@ -23,8 +23,8 @@ defimpl Poison.Decoder, for: {{&moduleName}}.Model.{{&classname}} do value {{#vars}} {{^isPrimitiveType}} - {{#datatype}}|> deserialize(:"{{&baseName}}", {{#isArray}}:list, {{&moduleName}}.Model.{{{items.datatype}}}{{/isArray}}{{#isMap}}:map, {{&moduleName}}.Model.{{{items.datatype}}}{{/isMap}}{{#isDate}}:date, nil{{/isDate}}{{#isDateTime}}:date, nil{{/isDateTime}}{{^isDate}}{{^isDateTime}}{{^isMap}}{{^isArray}}:struct, {{moduleName}}.Model.{{dataType}}{{/isArray}}{{/isMap}}{{/isDateTime}}{{/isDate}}, options) - {{/datatype}} + {{#baseType}}|> deserialize(:"{{&baseName}}", {{#isArray}}:list, {{&moduleName}}.Model.{{{items.baseType}}}{{/isArray}}{{#isMap}}:map, {{&moduleName}}.Model.{{{items.baseType}}}{{/isMap}}{{#isDate}}:date, nil{{/isDate}}{{#isDateTime}}:date, nil{{/isDateTime}}{{^isDate}}{{^isDateTime}}{{^isMap}}{{^isArray}}:struct, {{moduleName}}.Model.{{baseType}}{{/isArray}}{{/isMap}}{{/isDateTime}}{{/isDate}}, options) + {{/baseType}} {{/isPrimitiveType}} {{/vars}} {{/hasComplexVars}} diff --git a/modules/openapi-generator/src/main/resources/elixir/request_builder.ex.mustache b/modules/openapi-generator/src/main/resources/elixir/request_builder.ex.mustache index 1345cf78928..70e6fe297cd 100644 --- a/modules/openapi-generator/src/main/resources/elixir/request_builder.ex.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/request_builder.ex.mustache @@ -102,6 +102,28 @@ defmodule {{moduleName}}.RequestBuilder do Map.update(request, location, [{key, value}], &(&1 ++ [{key, value}])) end + @doc """ + Due to a bug in httpc, POST, PATCH and PUT requests will fail, if the body is empty + + This function will ensure, that the body param is always set + + ## Parameters + + - request (Map) - Collected request options + + ## Returns + + Map + """ + @spec ensure_body(map()) :: map() + def ensure_body(%{body: nil} = request) do + %{request | body: ""} + end + + def ensure_body(request) do + Map.put_new(request, :body, "") + end + @doc """ Handle the response for a Tesla request diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/README.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/README.mustache index a983dba343c..f452d35095a 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/README.mustache @@ -10,15 +10,13 @@ mvn package exec:exec ## Test -By default, all endpoints are protected by OAuth jwt token verifier. It can be turned off with config change through for development. - +By default, all endpoints are protected by the OAuth JWT token verifier. It can be turned off with a config change, when required. In order to access the server, there is a long lived token below issued by my -oauth2 server [undertow-server-oauth2](https://github.com/networknt/undertow-server-oauth2) +OAuth2 server [undertow-server-oauth2](https://github.com/networknt/undertow-server-oauth2). ``` Bearer eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJ1cm46Y29tOm5ldHdvcmtudDpvYXV0aDI6djEiLCJhdWQiOiJ1cm46Y29tLm5ldHdvcmtudCIsImV4cCI6MTc4ODEzMjczNSwianRpIjoiNWtyM2ZWOHJaelBZNEJrSnNYZzFpQSIsImlhdCI6MTQ3Mjc3MjczNSwibmJmIjoxNDcyNzcyNjE1LCJ2ZXJzaW9uIjoiMS4wIiwidXNlcl9pZCI6InN0ZXZlIiwidXNlcl90eXBlIjoiRU1QTE9ZRUUiLCJjbGllbnRfaWQiOiJkZGNhZjBiYS0xMTMxLTIyMzItMzMxMy1kNmYyNzUzZjI1ZGMiLCJzY29wZSI6WyJhcGkuciIsImFwaS53Il19.gteJiy1uao8HLeWRljpZxHWUgQfofwmnFP-zv3EPUyXjyCOy3xclnfeTnTE39j8PgBwdFASPcDLLk1YfZJbsU6pLlmYXLtdpHDBsVmIRuch6LFPCVQ3JdqSQVci59OhSK0bBThGWqCD3UzDI_OnX4IVCAahcT9Bu94m5u_H_JNmwDf1XaP3Lt4I34buYMuRD9stchsnZi-tuIRkL13FARm1XA9aPZUMUXFdedBWDXo1zMREQ_qCJXOpaZDJM9Im0rIkq9wTEVU00pbRp_Vcdya3dfkFteBMHiwFVt6VNQaco5BXURDAIzXidwQxNEbX1ek03wra8AIani65ZK7fy_w ``` Add "Authorization" header with value as above token and a dummy message will return from the generated stub. - diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/bodyParams.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/bodyParams.mustache index c7d1abfe527..cf3f9c3add9 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/bodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}{{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}{{{dataType}}} {{{paramName}}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/enumOuterClass.mustache index 5333fff8c06..f2805b0f72a 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/enumOuterClass.mustache @@ -3,8 +3,8 @@ {{/jackson}} /** -* {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} -*/ + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + */ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/generatedAnnotation.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/generatedAnnotation.mustache index 875d7b97afe..10843695a9a 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/generatedAnnotation.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/generatedAnnotation.mustache @@ -1 +1 @@ -@javax.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) \ No newline at end of file +@javax.annotation.Generated(value = "{{{generatorClass}}}"{{^hideGenerationTimestamp}}, date = "{{{generatedDate}}}"{{/hideGenerationTimestamp}}) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/handler.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/handler.mustache index 4cb411f79d6..acf876b7975 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/handler.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/handler.mustache @@ -1,34 +1,161 @@ +{{>licenseInfo}} package org.openapitools.handler; -import com.networknt.config.Config; import com.networknt.server.HandlerProvider; import io.undertow.Handlers; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; +import io.undertow.server.RoutingHandler; +import io.undertow.server.handlers.PathHandler; import io.undertow.util.Methods; -public class PathHandlerProvider implements HandlerProvider { +/** + * The default implementation for {@link HandlerProvider} and {@link PathHandlerInterface}. + * + *

    There are two flavors of {@link HttpHandler}s to choose from, depending on your needs:

    + * + *
      + *
    • + * Stateless: if a specific endpoint is called more than once from multiple sessions, + * its state is not retained – a different {@link HttpHandler} is instantiated for every new + * session. This is the default behavior. + *
    • + *
    • + * Stateful: if a specific endpoint is called more than once from multiple sessions, + * its state is retained properly. For example, if you want to keep a class property that counts + * the number of requests or the last time a request was received. + *
    • + *
    + *

    Note: Stateful flavor is more performant than Stateless.

    + */ +@SuppressWarnings("TooManyFunctions") +abstract public class PathHandlerProvider implements HandlerProvider, PathHandlerInterface { + /** + * Returns the default base path to access this server. + */ + @javax.annotation.Nonnull + public String getBasePath() { + return "{{{basePathWithoutHost}}}"; + } + /** + * Returns a stateless {@link HttpHandler} that configures all endpoints in this server. + * + *

    Endpoints bound in this method do NOT start with "{{{basePathWithoutHost}}}", and + * it's your responsibility to configure a {@link PathHandler} with a prefix path + * by calling {@link PathHandler#addPrefixPath} like so:

    + * + * pathHandler.addPrefixPath("{{{basePathWithoutHost}}}", handler) + * + *

    Note: the endpoints bound to the returned {@link HttpHandler} are stateless and won't + * retain any state between multiple sessions.

    + * + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + @Override public HttpHandler getHandler() { - HttpHandler handler = Handlers.routing() + return getHandler(false); + } + /** + * Returns a stateless {@link HttpHandler} that configures all endpoints in this server. + * + *

    Note: the endpoints bound to the returned {@link HttpHandler} are stateless and won't + * retain any state between multiple sessions.

    + * + * @param withBasePath if true, all endpoints would start with "{{{basePathWithoutHost}}}" + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + public HttpHandler getHandler(final boolean withBasePath) { + return getHandler(withBasePath ? getBasePath() : ""); + } + + /** + * Returns a stateless {@link HttpHandler} that configures all endpoints in this server. + * + *

    Note: the endpoints bound to the returned {@link HttpHandler} are stateless and won't + * retain any state between multiple sessions.

    + * + * @param basePath base path to set for all endpoints + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @SuppressWarnings("Convert2Lambda") + @javax.annotation.Nonnull + public HttpHandler getHandler(final String basePath) { + return Handlers.routing() {{#apiInfo}} -{{#apis}} -{{#operations}} -{{#operation}} - - .add(Methods.{{httpMethod}}, "{{{basePathWithoutHost}}}{{{path}}}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("{{operationId}}"); - } - }) - -{{/operation}} -{{/operations}} -{{/apis}} + {{#apis}} + {{#operations}} + {{#operation}} + .add(Methods.{{{httpMethod}}}, basePath + "{{{path}}}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + {{{operationId}}}().handleRequest(exchange); + } + }) + {{/operation}} + {{/operations}} + {{/apis}} + ; +{{/apiInfo}} + } + + /** + * Returns a stateful {@link HttpHandler} that configures all endpoints in this server. + * + *

    Endpoints bound in this method do NOT start with "{{{basePathWithoutHost}}}", and + * it's your responsibility to configure a {@link PathHandler} with a prefix path + * by calling {@link PathHandler#addPrefixPath} like so:

    + * + * pathHandler.addPrefixPath("{{{basePathWithoutHost}}}", handler) + * + *

    Note: the endpoints bound to the returned {@link HttpHandler} are stateful and will + * retain any state between multiple sessions.

    + * + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + public HttpHandler getStatefulHandler() { + return getStatefulHandler(false); + } + + /** + * Returns a stateful {@link HttpHandler} that configures all endpoints in this server. + * + *

    Note: the endpoints bound to the returned {@link HttpHandler} are stateful and will + * retain any state between multiple sessions.

    + * + * @param withBasePath if true, all endpoints would start with "{{{basePathWithoutHost}}}" + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + public HttpHandler getStatefulHandler(final boolean withBasePath) { + return getStatefulHandler(withBasePath ? getBasePath() : ""); + } + + /** + * Returns a stateful {@link HttpHandler} that configures all endpoints in this server. + * + *

    Note: the endpoints bound to the returned {@link HttpHandler} are stateful and will + * retain any state between multiple sessions.

    + * + * @param basePath base path to set for all endpoints + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + public HttpHandler getStatefulHandler(final String basePath) { + return Handlers.routing() +{{#apiInfo}} + {{#apis}} + {{#operations}} + {{#operation}} + .add(Methods.{{{httpMethod}}}, basePath + "{{{path}}}", {{{operationId}}}()) + {{/operation}} + {{/operations}} + {{/apis}} + ; {{/apiInfo}} - ; - return handler; } } - diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/inflector.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/inflector.mustache index 87fc5581316..c4b62bbd8a9 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/inflector.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/inflector.mustache @@ -1,10 +1,10 @@ -controllerPackage: {{invokerPackage}} -modelPackage: {{modelPackage}} +controllerPackage: {{{invokerPackage}}} +modelPackage: {{{modelPackage}}} swaggerUrl: ./src/main/swagger/swagger.yaml modelMappings: # to enable explicit mappings, use this syntax: DefinitionFromSwaggerSpecification: fully.qualified.path.to.Model - {{#models}}{{#model}}{{classname}} : {{modelPackage}}.{{classname}}{{/model}} + {{#models}}{{#model}}{{{classname}}} : {{{modelPackage}}}.{{{classname}}}{{/model}} {{/models}} entityProcessors: diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/interface.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/interface.mustache new file mode 100644 index 00000000000..7dfd94228a8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/interface.mustache @@ -0,0 +1,76 @@ +{{>licenseInfo}} +package org.openapitools.handler; + +import io.undertow.server.*; +import io.undertow.util.*; + +import {{modelPackage}}.*; + +@SuppressWarnings("TooManyFunctions") +public interface PathHandlerInterface { +{{#apiInfo}} + {{#apis}} + {{#operations}} + {{#operation}} + + /** +{{#summary}} *

    {{{summary}}}

    + * +{{/summary}} +{{#notes}} *

    {{{notes}}}

    + * +{{/notes}} + *

    Endpoint: {@link Methods#{{{httpMethod}}} {{{httpMethod}}}} "{{{basePathWithoutHost}}}{{{path}}}" (privileged: {{{hasAuthMethods}}})

    +{{#hasParams}} + * + *

    Request parameters:

    + *
      + {{#allParams}} + {{^isBodyParam}} + *
    • + *

      "{{{baseName}}}" +{{#description}} *

      {{{description}}}

      +{{/description}} + *

      + * - Parameter type: {{>isContainerDoc}}{{#isModel}}{@link {{{dataType}}}}{{/isModel}}{{^isModel}}{{#isFile}}{{#isBinary}}Binary{{/isBinary}}File{{/isFile}}{{^isFile}}{@link {{dataType}}}{{/isFile}}{{/isModel}}
      + * - Appears in: {{#isFormParam}}{@link io.undertow.server.handlers.form.FormDataParser Form}{{/isFormParam}}{{#isQueryParam}}{@link HttpServerExchange#getQueryParameters Query}{{/isQueryParam}}{{#isPathParam}}{@link HttpServerExchange#getPathParameters Path}{{/isPathParam}}{{#isHeaderParam}}{@link Headers Header}{{/isHeaderParam}}{{#isCookieParam}}{@link HttpServerExchange#getRequestCookie Cookie}{{/isCookieParam}}{{#isBodyParam}}{@link HttpServerExchange#getRequestChannel Body}{{/isBodyParam}}
      +{{#defaultValue}} * - Default value: {{{defaultValue}}}
      +{{/defaultValue}} + * - Required: {{{required}}} + *

      + *
    • + {{/isBodyParam}} + {{/allParams}} + *
    +{{/hasParams}} +{{#hasResponseHeaders}} + *

    Response headers: [{{#responseHeaders}}{{{.}}}{{^-last}}, {{/-last}}{{/responseHeaders}}]

    +{{/hasResponseHeaders}} +{{#hasConsumes}} + * + *

    Consumes: {{{consumes}}}

    +{{#hasBodyParam}}{{#bodyParam}} *

    Payload: {{>isContainerDoc}}{{#isModel}}{@link {{{dataType}}}}{{/isModel}}{{^isModel}}{{#isFile}}{{#isBinary}}Binary {{/isBinary}}File{{/isFile}}{{^isFile}}{@link {{baseType}}}{{/isFile}}{{/isModel}} (required: {{{required}}}{{/bodyParam}})

    +{{/hasBodyParam}} +{{/hasConsumes}} + * +{{#hasProduces}} *

    Produces: {{{produces}}}

    +{{/hasProduces}} +{{#returnBaseType}} *

    Returns: {{>isContainerDoc}}{@link {{{returnBaseType}}}}

    +{{/returnBaseType}} + * + *

    Responses:

    + *
      +{{#responses}} + *
    • {{#isDefault}}Default{{/isDefault}}{{^isDefault}}{{{code}}} ({{#is1xx}}informative{{/is1xx}}{{#is2xx}}success{{/is2xx}}{{#is3xx}}redirection{{/is3xx}}{{#is4xx}}client error{{/is4xx}}{{#is5xx}}server error{{/is5xx}}){{/isDefault}}{{#message}}: {{{message}}}{{/message}}
    • +{{/responses}} + *
    + */ + @javax.annotation.Nonnull +{{#isDeprecated}} @Deprecated +{{/isDeprecated}} + HttpHandler {{{operationId}}}(); + {{/operation}} + {{/operations}} + {{/apis}} +{{/apiInfo}} +} diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/isContainerDoc.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/isContainerDoc.mustache new file mode 100644 index 00000000000..d219fde2cc3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/isContainerDoc.mustache @@ -0,0 +1 @@ +{{#isArray}}{@link java.util.List List} of {{/isArray}}{{#isMap}}{@link java.util.Map Map} of {{/isMap}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/licenseInfo.mustache new file mode 100644 index 00000000000..09f65c73d83 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/licenseInfo.mustache @@ -0,0 +1,10 @@ +/* + * {{{appName}}} + * + * {{{appDescription}}} + * + * {{#version}}OpenAPI document version: {{{version}}}{{/version}} + * {{#infoEmail}}Maintained by: {{{infoEmail}}}{{/infoEmail}} + * + * AUTO-GENERATED FILE, DO NOT MODIFY! + */ \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/model.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/model.mustache index b9512d2b83c..addae4dd4d4 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/model.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/model.mustache @@ -1,15 +1,16 @@ +{{>licenseInfo}} package {{package}}; import java.util.Objects; -{{#imports}}import {{import}}; +{{#imports}}import {{{import}}}; {{/imports}} {{#serializableModel}}import java.io.Serializable;{{/serializableModel}} {{#models}} {{#model}}{{#description}} /** - * {{description}} - **/{{/description}} + * {{{description}}} + */{{/description}} {{#isEnum}}{{>enumOuterClass}}{{/isEnum}} {{^isEnum}}{{>pojo}}{{/isEnum}} {{/model}} diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/pathParams.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/pathParams.mustache index 6829cf8c7a6..e31bf798d10 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}{{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{{dataType}}} {{{paramName}}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/pojo.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/pojo.mustache index 03c38d0ed77..f40d5b3de4a 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/pojo.mustache @@ -4,23 +4,23 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} - + {{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} - private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};{{/vars}} + private {{{datatypeWithEnum}}} {{{name}}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};{{/vars}} {{#vars}} /**{{#description}} * {{{description}}}{{/description}}{{#minimum}} - * minimum: {{minimum}}{{/minimum}}{{#maximum}} - * maximum: {{maximum}}{{/maximum}} - **/ - public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { - this.{{name}} = {{name}}; + * minimum: {{{minimum}}}{{/minimum}}{{#maximum}} + * maximum: {{{maximum}}}{{/maximum}} + */ + public {{{classname}}} {{{name}}}({{{datatypeWithEnum}}} {{{name}}}) { + this.{{{name}}} = {{{name}}}; return this; } {{#vendorExtensions.x-extra-annotation}}{{{vendorExtensions.x-extra-annotation}}}{{/vendorExtensions.x-extra-annotation}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{{required}}}, {{/required}}value = "{{{description}}}") @JsonProperty("{{baseName}}") public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; @@ -39,23 +39,23 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali if (o == null || getClass() != o.getClass()) { return false; } - {{classname}} {{classVarName}} = ({{classname}}) o;{{#hasVars}} - return {{#vars}}Objects.equals({{name}}, {{classVarName}}.{{name}}){{^-last}} && + {{{classname}}} {{{classVarName}}} = ({{{classname}}}) o;{{#hasVars}} + return {{#vars}}Objects.equals({{{name}}}, {{{classVarName}}}.{{{name}}}){{^-last}} && {{/-last}}{{#-last}};{{/-last}}{{/vars}}{{/hasVars}}{{^hasVars}} return true;{{/hasVars}} } @Override public int hashCode() { - return Objects.hash({{#vars}}{{name}}{{^-last}}, {{/-last}}{{/vars}}); + return Objects.hash({{#vars}}{{{name}}}{{^-last}}, {{/-last}}{{/vars}}); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class {{classname}} {\n"); + sb.append("class {{{classname}}} {\n"); {{#parent}}sb.append(" ").append(toIndentedString(super.toString())).append("\n");{{/parent}} - {{#vars}}sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + {{#vars}}sb.append(" {{{name}}}: ").append(toIndentedString({{{name}}})).append("\n"); {{/vars}}sb.append("}"); return sb.toString(); } diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache index 3a63b72d59d..12ee539f8a3 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache @@ -6,11 +6,11 @@ 5 4.0.0 - {{groupId}} - {{artifactId}} + {{{groupId}}} + {{{artifactId}}} jar - {{artifactId}} - {{artifactVersion}} + {{{artifactId}}} + {{{artifactVersion}}} 1.8 diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/queryParams.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/queryParams.mustache index ff79730471d..711bb3cf918 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{{dataType}}} {{{paramName}}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/jmeter-client/api.mustache b/modules/openapi-generator/src/main/resources/jmeter-client/api.mustache index 02675582c10..1717071e100 100644 --- a/modules/openapi-generator/src/main/resources/jmeter-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/jmeter-client/api.mustache @@ -93,7 +93,23 @@ accept {{{mediaType}}} - {{/produces.0}} + {{/produces.0}}{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + + Authorization + Basic ${__P(basicBasicToken,token)} + {{/isBasicBasic}}{{#isBasicBearer}} + + Authorization + Bearer ${__P(basicBearerToken,token)} + {{/isBasicBearer}}{{/isBasic}}{{#isApiKey}}{{#isKeyInHeader}} + + {{keyParamName}} + ${__P(apiKey,key)} + {{/isKeyInHeader}}{{/isApiKey}}{{#isOAuth}} + + {{keyParamName}} + Bearer ${__P(oathToken,token)} + {{/isOAuth}}{{/authMethods}} @@ -110,9 +126,16 @@ {{/queryParams}}{{#bodyParam}} false - {{=<% %>=}}${<% paramName %>}<%={{ }}=%> + {{=<% %>=}}${__javaScript("${<% paramName %>}".replace(/'/g\, '"'),)}<%={{ }}=%> = - {{/bodyParam}} + {{/bodyParam}}{{#authMethods}}{{#isApiKey}}{{#isKeyInQuery}} + + false + ${__P(apiKey,key)} + = + true + {{keyParamName}} + {{/isKeyInQuery}}{{/isApiKey}}{{/authMethods}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache index ec3c8fd6983..0fca42a0ad8 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache @@ -1,4 +1,4 @@ {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swaggerAnnotations}} @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swaggerAnnotations}}{{#deprecated}} @Deprecated(message = ""){{/deprecated}} - @field:JsonProperty("{{{baseName}}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{nameInCamelCase}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}} \ No newline at end of file + @field:JsonProperty("{{{baseName}}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{nameInCamelCase}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultValue}}{{defaultValue}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache index 963baa8f9af..27e16f95fca 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache @@ -1,3 +1,3 @@ {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swaggerAnnotations}} @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swaggerAnnotations}} - @field:JsonProperty("{{{baseName}}}", required = true){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{nameInCamelCase}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isReadOnly}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}}{{/isReadOnly}} \ No newline at end of file + @field:JsonProperty("{{{baseName}}}", required = true){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{nameInCamelCase}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isReadOnly}}?{{/isReadOnly}}{{#defaultValue}} = {{defaultValue}}{{/defaultValue}}{{#isReadOnly}}{{^defaultValue}} = null{{/defaultValue}}{{/isReadOnly}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/nestjs-client/README.mustache b/modules/openapi-generator/src/main/resources/nestjs-client/README.mustache new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/openapi-generator/src/main/resources/nestjs-client/api.mustache b/modules/openapi-generator/src/main/resources/nestjs-client/api.mustache new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/openapi-generator/src/main/resources/nestjs-client/model.mustache b/modules/openapi-generator/src/main/resources/nestjs-client/model.mustache new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/openapi-generator/src/main/resources/nim-client/api.mustache b/modules/openapi-generator/src/main/resources/nim-client/api.mustache index 55e57bc4752..9e464f8661d 100644 --- a/modules/openapi-generator/src/main/resources/nim-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/nim-client/api.mustache @@ -48,8 +48,8 @@ proc {{{operationId}}}*(httpClient: HttpClient{{#allParams}}, {{{paramName}}}: { {{/formParams}} }){{/isMultipart}}{{/hasFormParams}}{{#returnType}} - let response = httpClient.{{{httpMethod}}}(basepath & {{^pathParams}}"{{{path}}}"{{/pathParams}}{{#pathParams}}fmt"{{{path}}}"{{/pathParams}}{{#hasQueryParams}} & "?" & query_for_api_call{{/hasQueryParams}}{{#hasBodyParam}}{{#bodyParams}}, $(%{{{paramName}}}){{/bodyParams}}{{/hasBodyParam}}{{#hasFormParams}}, {{^isMultipart}}$query_for_api_call{{/isMultipart}}{{#isMultipart}}multipart=query_for_api_call{{/isMultipart}}{{/hasFormParams}}) + let response = httpClient.{{{httpMethod}}}(basepath & {{^pathParams}}"{{{path}}}"{{/pathParams}}{{#hasPathParams}}fmt"{{{path}}}"{{/hasPathParams}}{{#hasQueryParams}} & "?" & query_for_api_call{{/hasQueryParams}}{{#hasBodyParam}}{{#bodyParams}}, $(%{{{paramName}}}){{/bodyParams}}{{/hasBodyParam}}{{#hasFormParams}}, {{^isMultipart}}$query_for_api_call{{/isMultipart}}{{#isMultipart}}multipart=query_for_api_call{{/isMultipart}}{{/hasFormParams}}) constructResult[{{{returnType}}}](response){{/returnType}}{{^returnType}} - httpClient.{{{httpMethod}}}(basepath & {{^pathParams}}"{{{path}}}"{{/pathParams}}{{#pathParams}}fmt"{{{path}}}"{{/pathParams}}{{#hasQueryParams}} & "?" & query_for_api_call{{/hasQueryParams}}{{#hasBodyParam}}{{#bodyParams}}, $(%{{{paramName}}}){{/bodyParams}}{{/hasBodyParam}}{{#hasFormParams}}, {{^isMultipart}}$query_for_api_call{{/isMultipart}}{{#isMultipart}}multipart=query_for_api_call{{/isMultipart}}{{/hasFormParams}}){{/returnType}} + httpClient.{{{httpMethod}}}(basepath & {{^pathParams}}"{{{path}}}"{{/pathParams}}{{#hasPathParams}}fmt"{{{path}}}"{{/hasPathParams}}{{#hasQueryParams}} & "?" & query_for_api_call{{/hasQueryParams}}{{#hasBodyParam}}{{#bodyParams}}, $(%{{{paramName}}}){{/bodyParams}}{{/hasBodyParam}}{{#hasFormParams}}, {{^isMultipart}}$query_for_api_call{{/isMultipart}}{{#isMultipart}}multipart=query_for_api_call{{/isMultipart}}{{/hasFormParams}}){{/returnType}} {{/operation}}{{/operations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/powershell/api_doc.mustache b/modules/openapi-generator/src/main/resources/powershell/api_doc.mustache index e12e7e2b749..14f96341ead 100644 --- a/modules/openapi-generator/src/main/resources/powershell/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/api_doc.mustache @@ -26,24 +26,24 @@ Method | HTTP request | Description Import-Module -Name {{{packageName}}} {{#hasAuthMethods}} -$Configuration = Get-{{{packageName}}}Configuration +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration {{#authMethods}} {{#isBasic}} # Configure HTTP basic authorization: {{{name}}} -$Configuration["Username"] = "YOUR_USERNAME"; -$Configuration["Password"] = "YOUR_PASSWORD"; +$Configuration.Username = "YOUR_USERNAME" +$Configuration.Password = "YOUR_PASSWORD" {{/isBasic}} {{#isApiKey}} # Configure API key authorization: {{{name}}} -$Configuration["ApiKey"]["{{{keyParamName}}}"] = "YOUR_API_KEY" +$Configuration.ApiKey.{{{keyParamName}}} = "YOUR_API_KEY" # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -#$Configuration["ApiKeyPrefix"]["{{{keyParamName}}}"] = "Bearer" +#$Configuration.ApiKeyPrefix.{{{keyParamName}}} = "Bearer" {{/isApiKey}} {{#isOAuth}} # Configure OAuth2 access token for authorization: {{{name}}} -$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; +$Configuration.AccessToken = "YOUR_ACCESS_TOKEN" {{/isOAuth}} - {{#isHttpSignature}} # Configure HttpSignature for authorization :{{name}} $httpSigningParams = @{ @@ -52,11 +52,10 @@ $httpSigningParams = @{ HttpSigningHeader = @("(request-target)","Host","Date","Digest") HashAlgorithm = "sha256" } -Set-{{{packageName}}}ConfigurationHttpSigning @httpSigningParams - +Set-ConfigurationHttpSigning $httpSigningParams {{/isHttpSignature}} -{{/authMethods}} +{{/authMethods}} {{/hasAuthMethods}} {{#allParams}} ${{paramName}} = {{{vendorExtensions.x-powershell-example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} 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 6625d274b0a..4c733fbafe4 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache @@ -15,7 +15,7 @@ client = [ "mime_0_2", {{/apiUsesMultipart}} {{#apiUsesMultipartFormData}} - "multipart", "multipart/client", "swagger/multipart", + "multipart", "multipart/client", "swagger/multipart_form", {{/apiUsesMultipartFormData}} {{#apiUsesMultipartRelated}} "hyper_0_10", "mime_multipart", @@ -60,7 +60,7 @@ openssl = {version = "0.10", optional = true } async-trait = "0.1.24" chrono = { version = "0.4", features = ["serde"] } futures = "0.3" -swagger = "5.0.0-alpha-1" +swagger = "5.0.2" log = "0.4.0" mime = "0.3" diff --git a/modules/openapi-generator/src/main/resources/rust-server/models.mustache b/modules/openapi-generator/src/main/resources/rust-server/models.mustache index 6b4f9ffbb84..746e5dbd6cd 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/models.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/models.mustache @@ -4,10 +4,14 @@ use crate::models; #[cfg(any(feature = "client", feature = "server"))] use crate::header; {{! Don't "use" structs here - they can conflict with the names of models, and mean that the code won't compile }} +{{#models}} +{{#model}} -{{#models}}{{#model}} -{{#description}}/// {{{description}}} -{{/description}}{{#isEnum}}/// Enumeration of values. +{{#description}} +/// {{{description}}} +{{/description}} +{{#isEnum}} +/// Enumeration of values. /// Since this enum's variants do not hold data, we can easily define them them as `#[repr(C)]` /// which helps with FFI. #[allow(non_camel_case_types)] @@ -15,15 +19,23 @@ use crate::header; #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk_enum_derive::LabelledGenericEnum))]{{#xmlName}} #[serde(rename = "{{{xmlName}}}")]{{/xmlName}} -pub enum {{{classname}}} { {{#allowableValues}}{{#enumVars}} +pub enum {{{classname}}} { +{{#allowableValues}} + {{#enumVars}} #[serde(rename = {{{value}}})] - {{{name}}},{{/enumVars}}{{/allowableValues}} + {{{name}}}, + {{/enumVars}} +{{/allowableValues}} } impl std::fmt::Display for {{{classname}}} { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match *self { {{#allowableValues}}{{#enumVars}} - {{{classname}}}::{{{name}}} => write!(f, "{}", {{{value}}}),{{/enumVars}}{{/allowableValues}} + match *self { +{{#allowableValues}} + {{#enumVars}} + {{{classname}}}::{{{name}}} => write!(f, "{}", {{{value}}}), + {{/enumVars}} +{{/allowableValues}} } } } @@ -62,8 +74,8 @@ impl std::convert::From<{{{dataType}}}> for {{{classname}}} { {{{classname}}}(x) } } - {{#vendorExtensions.x-is-string}} + impl std::string::ToString for {{{classname}}} { fn to_string(&self) -> String { self.0.to_string() @@ -121,45 +133,8 @@ impl ::std::str::FromStr for {{{classname}}} { {{/additionalPropertiesType}} {{/dataType}} {{^dataType}} -// Methods for converting between header::IntoHeaderValue<{{{classname}}}> and hyper::header::HeaderValue - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { - type Error = String; - - fn try_from(hdr_value: header::IntoHeaderValue<{{{classname}}}>) -> std::result::Result { - let hdr_value = hdr_value.to_string(); - match hyper::header::HeaderValue::from_str(&hdr_value) { - std::result::Result::Ok(value) => std::result::Result::Ok(value), - std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for {{classname}} - value: {} is invalid {}", - hdr_value, e)) - } - } -} - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue<{{{classname}}}> { - type Error = String; - - fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { - match hdr_value.to_str() { - std::result::Result::Ok(value) => { - match <{{{classname}}} as std::str::FromStr>::from_str(value) { - std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), - std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into {{classname}} - {}", - value, err)) - } - }, - std::result::Result::Err(e) => std::result::Result::Err( - format!("Unable to convert header: {:?} to string: {}", - hdr_value, e)) - } - } -} - -{{#arrayModelType}}{{#vendorExtensions}}{{#x-item-xml-name}}// Utility function for wrapping list elements when serializing xml +{{#arrayModelType}} +{{#vendorExtensions}}{{#x-item-xml-name}}// Utility function for wrapping list elements when serializing xml #[allow(non_snake_case)] fn wrap_in_{{{x-item-xml-name}}}(item: &Vec<{{{arrayModelType}}}>, serializer: S) -> std::result::Result where @@ -265,7 +240,9 @@ impl std::str::FromStr for {{{classname}}} { } } -{{/arrayModelType}}{{^arrayModelType}}{{! general struct}} +{{/arrayModelType}} +{{^arrayModelType}} +{{! general struct}} #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] {{#xmlName}} @@ -417,7 +394,7 @@ impl std::str::FromStr for {{{classname}}} { "{{{baseName}}}" => return std::result::Result::Err("Parsing a nullable type in this style is not supported in {{{classname}}}".to_string()), {{/isNullable}} {{^isNullable}} - "{{{baseName}}}" => intermediate_rep.{{{name}}}.push({{{dataType}}}::from_str(val).map_err(|x| format!("{}", x))?), + "{{{baseName}}}" => intermediate_rep.{{{name}}}.push(<{{{dataType}}} as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?), {{/isNullable}} {{/isContainer}} {{/isByteArray}} @@ -444,22 +421,60 @@ impl std::str::FromStr for {{{classname}}} { }) } } - {{/arrayModelType}} + +// Methods for converting between header::IntoHeaderValue<{{{classname}}}> and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue<{{{classname}}}>) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for {{classname}} - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue<{{{classname}}}> { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match <{{{classname}}} as std::str::FromStr>::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into {{classname}} - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} + {{/dataType}} {{/isEnum}} - {{#usesXml}} {{#usesXmlNamespaces}} {{#xmlNamespace}} + impl {{{classname}}} { /// Associated constant for this model's XML namespace. #[allow(dead_code)] pub const NAMESPACE: &'static str = "{{{xmlNamespace}}}"; } - {{/xmlNamespace}} {{/usesXmlNamespaces}} + impl {{{classname}}} { /// Helper function to allow us to convert this model to an XML string. /// Will panic if serialisation fails. @@ -478,4 +493,4 @@ impl {{{classname}}} { } {{/usesXml}} {{/model}} -{{/models}} \ No newline at end of file +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/rust-server/response.mustache b/modules/openapi-generator/src/main/resources/rust-server/response.mustache index 9269eea6386..39ff2782165 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/response.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/response.mustache @@ -42,7 +42,7 @@ pub enum {{{operationId}}}Response { {{^required}} Option< {{/required}} - {{{datatype}}} + {{{dataType}}} {{^required}} > {{/required}} diff --git a/modules/openapi-generator/src/main/resources/rust-server/server-operation.mustache b/modules/openapi-generator/src/main/resources/rust-server/server-operation.mustache index 6399da844aa..cbb812e4f26 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/server-operation.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/server-operation.mustache @@ -39,7 +39,7 @@ {{/hasAuthMethods}} {{#vendorExtensions}} {{#x-consumes-multipart}} - let boundary = match swagger::multipart::boundary(&headers) { + let boundary = match swagger::multipart::form::boundary(&headers) { Some(boundary) => boundary.to_string(), None => return Ok(Response::builder() .status(StatusCode::BAD_REQUEST) diff --git a/modules/openapi-generator/src/main/resources/swift5/api.mustache b/modules/openapi-generator/src/main/resources/swift5/api.mustache index 18d3e6b3045..f1e181e2524 100644 --- a/modules/openapi-generator/src/main/resources/swift5/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/api.mustache @@ -8,7 +8,9 @@ import Foundation{{#usePromiseKit}} import PromiseKit{{/usePromiseKit}}{{#useRxSwift}} import RxSwift{{/useRxSwift}}{{#useCombine}} -import Combine{{/useCombine}}{{#swiftUseApiNamespace}} +#if canImport(Combine) +import Combine +#endif{{/useCombine}}{{#swiftUseApiNamespace}} extension {{projectName}}API { {{/swiftUseApiNamespace}} @@ -140,6 +142,7 @@ extension {{projectName}}API { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}, Error> */ + #if canImport(Combine) {{#isDeprecated}} @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} @@ -162,6 +165,7 @@ extension {{projectName}}API { } }.eraseToAnyPublisher() } + #endif {{/useCombine}} {{#useResult}} /** diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache index 896871b8d7e..95733f9d546 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache @@ -132,15 +132,11 @@ private var urlSessionStore = SynchronizedDictionary() do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache b/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache index 36d1eb6e78b..661bb479b48 100644 --- a/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache @@ -1,5 +1,5 @@ {{^objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct {{classname}}: Codable{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}} { -{{/objcCompatible}}{{#objcCompatible}}@objc {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} class {{classname}}: NSObject, Codable{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}} { +{{/objcCompatible}}{{#objcCompatible}}@objc {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} class {{classname}}: NSObject, Codable { {{/objcCompatible}} {{#allVars}} diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache index a723da26004..da873845d8a 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache @@ -7,6 +7,8 @@ import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; // Some imports not used depending on template conditions // @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; {{#models}} diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache index b8321a3f41f..71981cf8fca 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -7,6 +7,8 @@ import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; import { Configuration } from '{{apiRelativeToRoot}}configuration'; // Some imports not used depending on template conditions // @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '{{apiRelativeToRoot}}common'; +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '{{apiRelativeToRoot}}base'; {{#imports}} // @ts-ignore @@ -39,15 +41,13 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur {{#allParams}} {{#required}} // verify required parameter '{{paramName}}' is not null or undefined - if ({{paramName}} === null || {{paramName}} === undefined) { - throw new RequiredError('{{paramName}}','Required parameter {{paramName}} was null or undefined when calling {{nickname}}.'); - } + assertParamExists('{{nickname}}', '{{paramName}}', {{paramName}}) {{/required}} {{/allParams}} const localVarPath = `{{{path}}}`{{#pathParams}} .replace(`{${"{{baseName}}"}}`, encodeURIComponent(String({{paramName}}))){{/pathParams}}; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -62,45 +62,23 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur // authentication {{name}} required {{#isApiKey}} {{#isKeyInHeader}} - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey("{{keyParamName}}") - : await configuration.apiKey; - localVarHeaderParameter["{{keyParamName}}"] = localVarApiKeyValue; - } + await setApiKeyToObject(localVarHeaderParameter, "{{keyParamName}}", configuration) {{/isKeyInHeader}} {{#isKeyInQuery}} - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey("{{keyParamName}}") - : await configuration.apiKey; - localVarQueryParameter["{{keyParamName}}"] = localVarApiKeyValue; - } + await setApiKeyToObject(localVarQueryParameter, "{{keyParamName}}", configuration) {{/isKeyInQuery}} {{/isApiKey}} {{#isBasicBasic}} // http basic authentication required - if (configuration && (configuration.username || configuration.password)) { - localVarRequestOptions["auth"] = { username: configuration.username, password: configuration.password }; - } + setBasicAuthToObject(localVarRequestOptions, configuration) {{/isBasicBasic}} {{#isBasicBearer}} // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } + await setBearerAuthToObject(localVarHeaderParameter, configuration) {{/isBasicBearer}} {{#isOAuth}} // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("{{name}}", [{{#scopes}}"{{{scope}}}"{{^-last}}, {{/-last}}{{/scopes}}]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "{{name}}", [{{#scopes}}"{{{scope}}}"{{^-last}}, {{/-last}}{{/scopes}}], configuration) {{/isOAuth}} {{/authMethods}} @@ -188,31 +166,18 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur {{/consumes.0}} {{/bodyParam}} - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; {{#hasFormParams}} localVarRequestOptions.data = localVarFormParams{{#vendorExtensions}}{{^multipartFormData}}.toString(){{/multipartFormData}}{{/vendorExtensions}}; {{/hasFormParams}} {{#bodyParam}} - const nonString = typeof {{paramName}} !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify({{paramName}} !== undefined ? {{paramName}} : {}) - : ({{paramName}} || ""); + localVarRequestOptions.data = serializeDataIfNeeded({{paramName}}, localVarRequestOptions, configuration) {{/bodyParam}} return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -226,6 +191,7 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur * @export */ export const {{classname}}Fp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = {{classname}}AxiosParamCreator(configuration) return { {{#operation}} /** @@ -240,11 +206,8 @@ export const {{classname}}Fp = function(configuration?: Configuration) { * @throws {RequiredError} */ async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}>> { - const localVarAxiosArgs = await {{classname}}AxiosParamCreator(configuration).{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, {{/operation}} } @@ -256,6 +219,7 @@ export const {{classname}}Fp = function(configuration?: Configuration) { * @export */ export const {{classname}}Factory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = {{classname}}Fp(configuration) return { {{#operation}} /** @@ -270,7 +234,7 @@ export const {{classname}}Factory = function (configuration?: Configuration, bas * @throws {RequiredError} */ {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): AxiosPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> { - return {{classname}}Fp(configuration).{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options).then((request) => request(axios, basePath)); + return localVarFp.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options).then((request) => request(axios, basePath)); }, {{/operation}} }; diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/common.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/common.mustache new file mode 100644 index 00000000000..2e0578c2a2e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-axios/common.mustache @@ -0,0 +1,120 @@ +/* tslint:disable */ +/* eslint-disable */ +{{>licenseInfo}} + +import { Configuration } from "./configuration"; +import { RequiredError, RequestArgs } from "./base"; +import { AxiosInstance } from 'axios'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + for (const object of objects) { + for (const key in object) { + searchParams.set(key, object[key]); + } + } + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/README.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/README.mustache new file mode 100644 index 00000000000..c5ae5f3530c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/README.mustache @@ -0,0 +1,137 @@ +## {{npmName}}@{{npmVersion}} + +### Building + +To install the required dependencies and to build the typescript sources run: +``` +npm install +npm run build +``` + +#### General usage + +In your Nestjs project: + + +``` +// without configuring providers +import { ApiModule } from '{{npmName}}'; +import { HttpModule } from '@nestjs/common'; + +@Module({ + imports: [ + ApiModule, + HttpModule + ], + providers: [] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from '{{npmName}}'; + +export function apiConfigFactory (): Configuration => { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@Module({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from '{{npmName}}'; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule a dynamic module and instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple swagger files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different swagger files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpModule } from '@nestjs/common'; + +@Module({ + imports: [ + ApiModule, + OtherApiModule, + HttpModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from '{{npmName}}'; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from '{{npmName}}'; + +@Module({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @nestjs/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from '{{npmName}}'; +import { environment } from '../environments/environment'; + +@Module({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [ + { + provide: 'BASE_PATH', + useValue: environment.API_BASE_PATH + } + ] +}) +export class AppModule { } +``` \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/api.module.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.module.mustache new file mode 100644 index 00000000000..0226f69fb1f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.module.mustache @@ -0,0 +1,32 @@ +import { DynamicModule, HttpService, HttpModule, Module, Global } from '@nestjs/common'; +import { Configuration } from './configuration'; +import { BASE_PATH } from './variables'; + +{{#apiInfo}} +{{#apis}} +import { {{classname}} } from './{{importPath}}'; +{{/apis}} +{{/apiInfo}} + +@Global +@Module({ + imports: [ HttpModule ], + exports: [ + {{#apiInfo}}{{#apis}}{{classname}}{{#hasMore}}, + {{/hasMore}}{{/apis}}{{/apiInfo}} + ], + providers: [ + {{#apiInfo}}{{#apis}}{{classname}}{{#hasMore}}, + {{/hasMore}}{{/apis}}{{/apiInfo}} + ] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): DynamicModule { + return { + module: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( httpService: HttpService) { } +} diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache new file mode 100644 index 00000000000..3bc043bddb1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache @@ -0,0 +1,227 @@ +{{>licenseInfo}} +/* tslint:disable:no-unused-variable member-ordering */ + +import { HttpService, Inject, Injectable } from '@nestjs/common'; +import { AxiosResponse } from 'axios'; +import { Observable } from 'rxjs'; +{{#imports}} +import { {{classname}} } from '../{{filename}}'; +{{/imports}} +import { Configuration } from '../configuration'; +import { COLLECTION_FORMATS } from '../variables'; +{{#withInterfaces}} +import { {{classname}}Interface } from './{{classFilename}}Interface'; +{{/withInterfaces}} + +{{#operations}} + +{{#description}} +/** + * {{&description}} + */ +{{/description}} +@Injectable() +{{#withInterfaces}} +export class {{classname}} implements {{classname}}Interface { +{{/withInterfaces}} +{{^withInterfaces}} +export class {{classname}} { +{{/withInterfaces}} + + protected basePath = '{{{basePath}}}'; + public defaultHeaders = new Map() + public configuration = new Configuration(); + + constructor(protected httpClient: HttpService, configuration: Configuration) { + this.configuration = configuration; + this.basePath = basePath || configuration.basePath || this.basePath; + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + return consumes.includes(form); + } + +{{#operation}} + /** + * {{summary}} + * {{notes}} + {{#allParams}}* @param {{paramName}} {{description}} + {{/allParams}}* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}): Observable>; + public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}): Observable { +{{#allParams}} + +{{#required}} + {{#isConstEnumParam}} + let {{paramName}} = {{{dataType}}}; + {{/isConstEnumParam}} + {{^isConstEnumParam}} + if ({{paramName}} === null || {{paramName}} === undefined) { + throw new Error('Required parameter {{paramName}} was null or undefined when calling {{nickname}}.'); + } + {{/isConstEnumParam}} +{{/required}} +{{/allParams}} + +{{#hasQueryParams}} + let queryParameters = {}; +{{#queryParams}} + {{#isListContainer}} + if ({{paramName}}) { + {{#isCollectionFormatMulti}} + {{paramName}}.forEach((element) => { + queryParameters.append('{{baseName}}', element); + }) + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} + queryParameters['{{baseName}}'] = {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']); + {{/isCollectionFormatMulti}} + } + {{/isListContainer}} + {{^isListContainer}} + if ({{paramName}} !== undefined && {{paramName}} !== null) { + {{#isDateTime}} + queryParameters['{{baseName}}'] = {{paramName}}.toISOString(); + {{/isDateTime}} + {{^isDateTime}} + queryParameters['{{baseName}}'] {{paramName}}; + {{/isDateTime}} + } + {{/isListContainer}} +{{/queryParams}} + +{{/hasQueryParams}} + let headers = this.defaultHeaders; +{{#headerParams}} + {{#isListContainer}} + if ({{paramName}}) { + headers['{{baseName}}'] = {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']); + } + {{/isListContainer}} + {{^isListContainer}} + if ({{paramName}} !== undefined && {{paramName}} !== null) { + headers['{{baseName}}'] String({{paramName}}); + } + {{/isListContainer}} +{{/headerParams}} + +{{#authMethods}} + // authentication ({{name}}) required +{{#isApiKey}} +{{#isKeyInHeader}} + if (this.configuration.apiKeys["{{keyParamName}}"]) { + headers['{{keyParamName}}'] = this.configuration.apiKeys["{{keyParamName}}"]; + } + +{{/isKeyInHeader}} +{{#isKeyInQuery}} + if (this.configuration.apiKeys["{{keyParamName}}"]) { + queryParameters['{{keyParamName}}'] = this.configuration.apiKeys["{{keyParamName}}"]; + } + +{{/isKeyInQuery}} +{{/isApiKey}} +{{#isBasic}} + if (this.configuration.username || this.configuration.password) { + headers['Authorization'] = 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password); + } + +{{/isBasic}} +{{#isOAuth}} + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers['Authorization'] = 'Bearer ' + accessToken; + } + +{{/isOAuth}} +{{/authMethods}} + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + {{#produces}} + '{{{mediaType}}}'{{#hasMore}},{{/hasMore}} + {{/produces}} + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + {{#consumes}} + '{{{mediaType}}}'{{#hasMore}},{{/hasMore}} + {{/consumes}} + ]; +{{#bodyParam}} + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected != undefined) { + headers['Content-Type'] = httpContentTypeSelected; + } +{{/bodyParam}} + +{{#hasFormParams}} + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; + let useForm = false; + let convertFormParamsToString = false; +{{#formParams}} +{{#isFile}} + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + useForm = canConsumeForm; +{{/isFile}} +{{/formParams}} + if (useForm) { + formParams = new FormData(); + } else { + // formParams = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + } + +{{#formParams}} + {{#isListContainer}} + if ({{paramName}}) { + {{#isCollectionFormatMulti}} + {{paramName}}.forEach((element) => { + formParams.append('{{baseName}}', element); + }) + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} + formParams.append('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])); + {{/isCollectionFormatMulti}} + } + {{/isListContainer}} + {{^isListContainer}} + if ({{paramName}} !== undefined) { + formParams.append('{{baseName}}', {{paramName}}); + } + {{/isListContainer}} +{{/formParams}} + +{{/hasFormParams}} + return this.httpClient.{{httpMethod}}{{^isResponseFile}}<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>{{/isResponseFile}}(`${this.basePath}{{{path}}}`,{{#isBodyAllowed}} + {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}convertFormParamsToString ? formParams.toString() : formParams{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}}{{/bodyParam}},{{/isBodyAllowed}} + { +{{#hasQueryParams}} + params: queryParameters, +{{/hasQueryParams}} +{{#isResponseFile}} + responseType: "blob", +{{/isResponseFile}} + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } +{{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/apiInterface.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/apiInterface.mustache new file mode 100644 index 00000000000..5d0ae503915 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/apiInterface.mustache @@ -0,0 +1,33 @@ +{{>licenseInfo}} + +import { Observable } from 'rxjs'; + +{{#imports}} +import { {{classname}} } from '../{{filename}}'; +{{/imports}} + + +import { Configuration } from '../configuration'; + +{{#operations}} + +{{#description}} + /** + * {{&description}} + */ +{{/description}} +export interface {{classname}}Interface { + defaultHeaders: {}; + configuration: Configuration; + +{{#operation}} + /** + * {{summary}} + * {{notes}} + {{#allParams}}* @param {{paramName}} {{description}} + {{/allParams}}*/ + {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any): Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}>; + +{{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/apis.mustache new file mode 100644 index 00000000000..514b5e0d10f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/apis.mustache @@ -0,0 +1,12 @@ +{{#apiInfo}} +{{#apis}} +{{#operations}} +export * from './{{ classFilename }}'; +import { {{ classname }} } from './{{ classFilename }}'; +{{/operations}} +{{#withInterfaces}} +export * from './{{ classFilename }}Interface' +{{/withInterfaces}} +{{/apis}} +export const APIS = [{{#apis}}{{#operations}}{{ classname }}{{/operations}}{{^-last}}, {{/-last}}{{/apis}}]; +{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/configuration.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/configuration.mustache new file mode 100644 index 00000000000..82e8458f39e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/configuration.mustache @@ -0,0 +1,79 @@ +export interface ConfigurationParameters { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; +} + +export class Configuration { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length == 0) { + return undefined; + } + + let type = contentTypes.find(x => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length == 0) { + return undefined; + } + + let type = accepts.find(x => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } +} diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/git_push.sh.mustache new file mode 100755 index 00000000000..8b3f689c912 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/git_push.sh.mustache @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="{{{gitUserId}}}" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="{{{gitRepoId}}}" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="{{{releaseNote}}}" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/gitignore b/modules/openapi-generator/src/main/resources/typescript-nestjs/gitignore new file mode 100644 index 00000000000..149b5765472 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/index.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/index.mustache new file mode 100644 index 00000000000..c312b70fa3e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/index.mustache @@ -0,0 +1,5 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/licenseInfo.mustache new file mode 100644 index 00000000000..835764cfc72 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/licenseInfo.mustache @@ -0,0 +1,11 @@ +/** + * {{{appName}}} + * {{{appDescription}}} + * + * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} + * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/model.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/model.mustache new file mode 100644 index 00000000000..0afee532731 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/model.mustache @@ -0,0 +1,16 @@ +{{>licenseInfo}} +{{#models}} +{{#model}} +{{#tsImports}} +import { {{classname}} } from './{{filename}}'; +{{/tsImports}} + + +{{#description}} +/** + * {{{description}}} + */ +{{/description}} +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#isAlias}}{{>modelAlias}}{{/isAlias}}{{^isAlias}}{{#taggedUnions}}{{>modelTaggedUnion}}{{/taggedUnions}}{{^taggedUnions}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{^oneOf}}{{>modelGeneric}}{{/oneOf}}{{/taggedUnions}}{{/isAlias}}{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/modelAlias.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelAlias.mustache new file mode 100644 index 00000000000..c1c6bf7a5da --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelAlias.mustache @@ -0,0 +1 @@ +export type {{classname}} = {{dataType}}; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/modelEnum.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelEnum.mustache new file mode 100644 index 00000000000..4695a611e79 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelEnum.mustache @@ -0,0 +1,20 @@ +{{#stringEnums}} +export enum {{classname}} { +{{#allowableValues}} +{{#enumVars}} + {{name}} = {{{value}}}{{^-last}},{{/-last}} +{{/enumVars}} +{{/allowableValues}} +}; +{{/stringEnums}} +{{^stringEnums}} +export type {{classname}} = {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}} | {{/-last}}{{/enumVars}}{{/allowableValues}}; + +export const {{classname}} = { +{{#allowableValues}} +{{#enumVars}} + {{name}}: {{{value}}} as {{classname}}{{^-last}},{{/-last}} +{{/enumVars}} +{{/allowableValues}} +}; +{{/stringEnums}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelGeneric.mustache new file mode 100644 index 00000000000..93d0fb629db --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelGeneric.mustache @@ -0,0 +1,10 @@ +export interface {{classname}}{{#allParents}}{{#-first}} extends {{/-first}}{{{.}}}{{^-last}}, {{/-last}}{{/allParents}} { {{>modelGenericAdditionalProperties}} +{{#vars}} + {{#description}} + /** + * {{{description}}} + */ + {{/description}} + {{#isReadOnly}}readonly {{/isReadOnly}}{{{name}}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}}; +{{/vars}} +}{{>modelGenericEnums}} diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/modelGenericAdditionalProperties.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelGenericAdditionalProperties.mustache new file mode 100644 index 00000000000..e6499ce9d63 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelGenericAdditionalProperties.mustache @@ -0,0 +1,5 @@ +{{#additionalPropertiesType}} + + [key: string]: {{{additionalPropertiesType}}}{{#hasVars}} | any{{/hasVars}}; + +{{/additionalPropertiesType}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/modelGenericEnums.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelGenericEnums.mustache new file mode 100644 index 00000000000..a824e55ec53 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelGenericEnums.mustache @@ -0,0 +1,30 @@ +{{#hasEnums}} + +{{^stringEnums}} +export namespace {{classname}} { +{{/stringEnums}} +{{#vars}} + {{#isEnum}} +{{#stringEnums}} +export enum {{classname}}{{enumName}} { +{{#allowableValues}} +{{#enumVars}} + {{name}} = {{{value}}}{{^-last}},{{/-last}} +{{/enumVars}} +{{/allowableValues}} +}; +{{/stringEnums}} +{{^stringEnums}} + export type {{enumName}} = {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}} | {{/-last}}{{/enumVars}}{{/allowableValues}}; + export const {{enumName}} = { + {{#allowableValues}} + {{#enumVars}} + {{name}}: {{{value}}} as {{enumName}}{{^-last}},{{/-last}} + {{/enumVars}} + {{/allowableValues}} + }; +{{/stringEnums}} + {{/isEnum}} +{{/vars}} +{{^stringEnums}}}{{/stringEnums}} +{{/hasEnums}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelOneOf.mustache new file mode 100644 index 00000000000..0763eaacf1e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelOneOf.mustache @@ -0,0 +1,14 @@ +{{#hasImports}} +import { + {{#imports}} + {{{.}}}, + {{/imports}} +} from './'; + +{{/hasImports}} +/** + * @type {{classname}}{{#description}} + * {{{description}}}{{/description}} + * @export + */ +export type {{classname}} = {{#oneOf}}{{{.}}}{{^-last}} | {{/-last}}{{/oneOf}}; diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/modelTaggedUnion.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelTaggedUnion.mustache new file mode 100644 index 00000000000..0189ea8b0ec --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/modelTaggedUnion.mustache @@ -0,0 +1,21 @@ +{{#discriminator}} +export type {{classname}} = {{#children}}{{^-first}} | {{/-first}}{{classname}}{{/children}}; +{{/discriminator}} +{{^discriminator}} +{{#parent}} +export interface {{classname}} { {{>modelGenericAdditionalProperties}} +{{#allVars}} + {{#description}} + /** + * {{{description}}} + */ + {{/description}} + {{name}}{{^required}}?{{/required}}: {{#discriminatorValue}}'{{discriminatorValue}}'{{/discriminatorValue}}{{^discriminatorValue}}{{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{/discriminatorValue}}{{#isNullable}} | null{{/isNullable}}; +{{/allVars}} +} +{{>modelGenericEnums}} +{{/parent}} +{{^parent}} +{{>modelGeneric}} +{{/parent}} +{{/discriminator}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/models.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/models.mustache new file mode 100644 index 00000000000..02a39c248c4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/models.mustache @@ -0,0 +1,5 @@ +{{#models}} +{{#model}} +export * from './{{{ classFilename }}}'; +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/nest-cli.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/nest-cli.mustache new file mode 100644 index 00000000000..0dde5f8c4d8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/nest-cli.mustache @@ -0,0 +1,5 @@ +{ + "language": "ts", + "collection": "@nestjs/schematics", + "sourceRoot": "src" +} diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/nodemon-debug.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/nodemon-debug.mustache new file mode 100644 index 00000000000..f34d1d7b90a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/nodemon-debug.mustache @@ -0,0 +1,7 @@ +{ + "watch": ["src"], + "ext": "ts", + "ignore": ["src/**/*.spec.ts"], + "exec": "node --inspect-brk -r ts-node/register -r tsconfig-paths/register src/main.ts" + } + \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/nodemon.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/nodemon.mustache new file mode 100644 index 00000000000..512e59aba97 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/nodemon.mustache @@ -0,0 +1,5 @@ +{ + "watch": ["dist"], + "ext": "js", + "exec": "node dist/main" +} diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/package.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/package.mustache new file mode 100644 index 00000000000..fae4aca2ac3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/package.mustache @@ -0,0 +1,71 @@ +{ + "name": "{{{npmName}}}", + "version": "{{{npmVersion}}}", + "description": "REST client for {{{npmName}}}", + "author": "OpenAPI Generator Contributors", + "keywords": [ + "swagger-client" + ], + "license": "Unlicense", + "scripts": { + "build": "tsc -p tsconfig.build.json", + "build:clean": "rm -rf dist/ 2> /dev/null && tsc -p tsconfig.build.json", + "format": "prettier --write \"src/**/*.ts\"", + "start": "ts-node -r tsconfig-paths/register src/main.ts", + "start:dev": "concurrently --handle-input \"wait-on dist/main.js && nodemon\" \"tsc -w -p tsconfig.build.json\" ", + "start:debug": "nodemon --config nodemon-debug.json", + "prestart:prod": "rimraf dist && npm run build", + "start:prod": "node dist/main.js", + "lint": "tslint -p tsconfig.json -c tslint.json", + "lint:fix": "tslint -p tsconfig.json -c tslint.json --fix --force", + "test": "jest", + "test:watch": "jest --watch", + "test:cov": "jest --coverage", + "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", + "test:e2e": "jest --config ./test/jest-e2e.json" + }, + "dependencies": { + "@nestjs/common": "^{{nestVersion}}", + "@nestjs/core": "^{{nestVersion}}", + "@nestjs/platform-express": "^{{nestVersion}}", + "reflect-metadata": "^0.1.13", + "rimraf": "^2.6.3", + "rxjs": "^6.5.2" + }, + "devDependencies": { + "@nestjs/testing": "~{{nestVersion}}", + "@types/express": "^4.16.0", + "@types/jest": "^24.0.15", + "@types/node": "^12.6.1", + "@types/supertest": "^2.0.8", + "concurrently": "^4.1.1", + "nodemon": "^1.19.1", + "prettier": "^1.18.2", + "supertest": "^4.0.2", + "ts-jest": "24.0.2", + "ts-node": "8.3.0", + "tsconfig-paths": "3.8.0", + "tslint": "5.18.0", + "typescript": "3.5.3", + "wait-on": "^3.2.0" + }, + "jest": { + "moduleFileExtensions": [ + "js", + "json", + "ts" + ], + "rootDir": "src", + "testRegex": ".spec.ts$", + "transform": { + "^.+\\.(t|j)s$": "ts-jest" + }, + "coverageDirectory": "../coverage", + "testEnvironment": "node" + }{{#npmRepository}},{{/npmRepository}} +{{#npmRepository}} + "publishConfig": { + "registry": "{{{npmRepository}}}" + } +{{/npmRepository}} +} diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/tsconfig.build.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/tsconfig.build.mustache new file mode 100644 index 00000000000..77f0c6a75e9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/tsconfig.build.mustache @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "exclude": [ + "node_modules", + "test", + "dist", + "**/*spec.ts" + ] + } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/tsconfig.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/tsconfig.mustache new file mode 100644 index 00000000000..f617a139740 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/tsconfig.mustache @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "declaration": true, + "removeComments": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "target": "{{#supportsES6}}es6{{/supportsES6}}{{^supportsES6}}es5{{/supportsES6}}", + "sourceMap": true, + "outDir": "./dist", + "baseUrl": "./", + "incremental": true + }, + "exclude": [ + "node_modules", + "dist" + ], + "filesGlob": [ + "./model/*.ts", + "./api/*.ts" + ] +} diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/tslint.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/tslint.mustache new file mode 100644 index 00000000000..5651b2f3db0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/tslint.mustache @@ -0,0 +1,18 @@ +{ + "defaultSeverity": "error", + "extends": ["tslint:recommended"], + "jsRules": { + "no-unused-expression": true + }, + "rules": { + "quotemark": [true, "single"], + "member-access": [false], + "ordered-imports": [false], + "max-line-length": [true, 150], + "member-ordering": [false], + "interface-name": [false], + "arrow-parens": false, + "object-literal-sort-keys": false + }, + "rulesDirectory": [] +} diff --git a/modules/openapi-generator/src/main/resources/typescript-nestjs/variables.mustache b/modules/openapi-generator/src/main/resources/typescript-nestjs/variables.mustache new file mode 100644 index 00000000000..d52a33f70e5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-nestjs/variables.mustache @@ -0,0 +1,7 @@ + +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index 87959fbb2ed..0114c9daa89 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -695,7 +695,7 @@ public class DefaultCodegenTest { CodegenParameter codegenParameter2 = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); codegen.setParameterExampleValue(codegenParameter2, operation2.getParameters().get(0)); - Assert.assertEquals(codegenParameter2.example, "example3: parameter value"); + Assert.assertEquals(codegenParameter2.example, "An example3 value"); } @Test @@ -2651,6 +2651,227 @@ public class DefaultCodegenTest { assertEquals(co.responses.get(0).isNull, true); } + @Test + public void testModelGetHasValidation() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + Schema sc; + CodegenModel cm; + + List modelNames = Arrays.asList( + "ArrayWithMaxItems", + "ArrayWithMinItems", + "ArrayWithUniqueItems", + "ObjectWithMinProperties", + "ObjectWithMaxProperties", + "StringWithMinLength", + "DateWithMinLength", + "DateTimeWithMinLength", + "ByteWithMinLength", + "BinaryWithMinLength", + "StringWithMaxLength", + "DateWithMaxLength", + "DateTimeWithMaxLength", + "ByteWithMaxLength", + "BinaryWithMaxLength", + "IntegerWithMultipleOf", + "Integer32WithMultipleOf", + "Integer64WithMultipleOf", + "NumberWithMultipleOf", + "NumberFloatWithMultipleOf", + "NumberDoubleWithMultipleOf", + "StringWithPattern", + "DateWithPattern", + "DateTimeWithPattern", + "ByteWithPattern", + "BinaryWithPattern", + "IntegerWithMinimum", + "Integer32WithMinimum", + "Integer64WithMinimum", + "NumberWithMinimum", + "NumberFloatWithMinimum", + "NumberDoubleWithMinimum", + "IntegerWithMaximum", + "Integer32WithMaximum", + "Integer64WithMaximum", + "NumberWithMaximum", + "NumberFloatWithMaximum", + "NumberDoubleWithMaximum", + "IntegerWithExclusiveMaximum", + "Integer32WithExclusiveMaximum", + "Integer64WithExclusiveMaximum", + "NumberWithExclusiveMaximum", + "NumberFloatWithExclusiveMaximum", + "NumberDoubleWithExclusiveMaximum", + "IntegerWithExclusiveMinimum", + "Integer32WithExclusiveMinimum", + "Integer64WithExclusiveMinimum", + "NumberWithExclusiveMinimum", + "NumberFloatWithExclusiveMinimum", + "NumberDoubleWithExclusiveMinimum" + ); + for (String modelName : modelNames) { + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + assertEquals(cm.getHasValidation(), true); + } + } + + @Test + public void testPropertyGetHasValidation() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String modelName = "ObjectWithPropertiesThatHaveValidations"; + Schema sc = openAPI.getComponents().getSchemas().get(modelName);; + CodegenModel cm = codegen.fromModel(modelName, sc); + + List props = cm.getVars(); + assertEquals(props.size(), 50); + for (CodegenProperty prop : props) { + assertEquals(prop.getHasValidation(), true); + } + } + + @Test + public void testQueryParametersGetHasValidation() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String path = "/queryParametersWithValidation"; + Operation operation = openAPI.getPaths().get(path).getPost(); + CodegenOperation co = codegen.fromOperation(path, "POST", operation, null); + List params = co.queryParams; + assertEquals(params.size(), 50); + for (CodegenParameter param : params) { + assertEquals(param.getHasValidation(), true); + } + } + + @Test + public void testHeaderParametersGetHasValidation() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String path = "/headerParametersWithValidation"; + Operation operation = openAPI.getPaths().get(path).getPost(); + CodegenOperation co = codegen.fromOperation(path, "POST", operation, null); + List params = co.headerParams; + assertEquals(params.size(), 50); + for (CodegenParameter param : params) { + assertEquals(param.getHasValidation(), true); + } + } + + @Test + public void testCookieParametersGetHasValidation() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String path = "/cookieParametersWithValidation"; + Operation operation = openAPI.getPaths().get(path).getPost(); + CodegenOperation co = codegen.fromOperation(path, "POST", operation, null); + List params = co.cookieParams; + assertEquals(params.size(), 50); + for (CodegenParameter param : params) { + assertEquals(param.getHasValidation(), true); + } + } + + @Test + public void testPathParametersGetHasValidation() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + String path = "/pathParametersWithValidation"; + Operation operation = openAPI.getPaths().get(path).getPost(); + CodegenOperation co = codegen.fromOperation(path, "POST", operation, null); + List params = co.pathParams; + assertEquals(params.size(), 50); + for (CodegenParameter param : params) { + assertEquals(param.getHasValidation(), true); + } + } + + @Test + public void testBodyAndResponseGetHasValidation() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7651.yaml"); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + List modelNames = Arrays.asList( + "ArrayWithMaxItems", + "ArrayWithMinItems", + "ArrayWithUniqueItems", + "ObjectWithMinProperties", + "ObjectWithMaxProperties", + "StringWithMinLength", + "DateWithMinLength", + "DateTimeWithMinLength", + "ByteWithMinLength", + "BinaryWithMinLength", + "StringWithMaxLength", + "DateWithMaxLength", + "DateTimeWithMaxLength", + "ByteWithMaxLength", + "BinaryWithMaxLength", + "StringWithPattern", + "DateWithPattern", + "DateTimeWithPattern", + "ByteWithPattern", + "BinaryWithPattern", + "IntegerWithMultipleOf", + "Integer32WithMultipleOf", + "Integer64WithMultipleOf", + "NumberWithMultipleOf", + "NumberFloatWithMultipleOf", + "NumberDoubleWithMultipleOf", + "IntegerWithMinimum", + "Integer32WithMinimum", + "Integer64WithMinimum", + "NumberWithMinimum", + "NumberFloatWithMinimum", + "NumberDoubleWithMinimum", + "IntegerWithMaximum", + "Integer32WithMaximum", + "Integer64WithMaximum", + "NumberWithMaximum", + "NumberFloatWithMaximum", + "NumberDoubleWithMaximum", + "IntegerWithExclusiveMaximum", + "Integer32WithExclusiveMaximum", + "Integer64WithExclusiveMaximum", + "NumberWithExclusiveMaximum", + "NumberFloatWithExclusiveMaximum", + "NumberDoubleWithExclusiveMaximum", + "IntegerWithExclusiveMinimum", + "Integer32WithExclusiveMinimum", + "Integer64WithExclusiveMinimum", + "NumberWithExclusiveMinimum", + "NumberFloatWithExclusiveMinimum", + "NumberDoubleWithExclusiveMinimum" + ); + + String path; + Operation operation; + CodegenOperation co; + + for (String modelName : modelNames) { + path = "/"+modelName; + operation = openAPI.getPaths().get(path).getPost(); + co = codegen.fromOperation(path, "POST", operation, null); + assertEquals(co.bodyParam.getHasValidation(), true); + assertEquals(co.responses.get(0).getHasValidation(), true); + } + } + @Test public void testVarsAndRequiredVarsPresent() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7613.yaml"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java index ad9f062ee56..7a22776af35 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultGeneratorTest.java @@ -11,8 +11,11 @@ import io.swagger.v3.oas.models.parameters.QueryParameter; import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.responses.ApiResponses; +import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.config.GlobalSettings; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.utils.ModelUtils; import org.testng.Assert; import org.testng.annotations.Test; @@ -636,5 +639,31 @@ public class DefaultGeneratorTest { templates.toFile().delete(); } } + + @Test + public void testHandlesTrailingSlashInServers() { + OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue_7533.yaml"); + ClientOptInput opts = new ClientOptInput(); + opts.openAPI(openAPI); + DefaultCodegen config = new DefaultCodegen(); + config.setStrictSpecBehavior(false); + opts.config(config); + final DefaultGenerator generator = new DefaultGenerator(); + generator.opts(opts); + generator.configureGeneratorProperties(); + + List files = new ArrayList<>(); + List filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI); + List allModels = new ArrayList<>(); + generator.generateModels(files, allModels, filteredSchemas); + List allOperations = new ArrayList<>(); + generator.generateApis(files, allOperations, allModels); + + Map bundle = generator.buildSupportFileBundle(allOperations, allModels); + LinkedList servers = (LinkedList) bundle.get("servers"); + Assert.assertEquals(servers.get(0).url, ""); + Assert.assertEquals(servers.get(1).url, "http://trailingshlash.io:80/v1"); + Assert.assertEquals(servers.get(2).url, "http://notrailingslash.io:80/v2"); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpNetCoreClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpNetCoreClientCodegenTest.java index 0d28f8f255a..3a6ce1df371 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpNetCoreClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharpnetcore/CSharpNetCoreClientCodegenTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.openapitools.codegen.csharp; +package org.openapitools.codegen.csharpnetcore; import org.openapitools.codegen.languages.CSharpNetCoreClientCodegen; import org.testng.Assert; 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 b92773b3163..994db37808c 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 @@ -1088,4 +1088,48 @@ public class JavaClientCodegenTest { output.deleteOnExit(); } + + /** + * See https://github.com/OpenAPITools/openapi-generator/issues/6715 + */ + @Test + public void testWebClientWithUseAbstractionForFiles() throws IOException { + + Map properties = new HashMap<>(); + properties.put(JavaClientCodegen.JAVA8_MODE, true); + properties.put(CodegenConstants.API_PACKAGE, "xyz.abcdef.api"); + properties.put(JavaClientCodegen.USE_ABSTRACTION_FOR_FILES, true); + + + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java") + .setLibrary(JavaClientCodegen.WEBCLIENT) + .setAdditionalProperties(properties) + .setInputSpec("src/test/resources/3_0/form-multipart-binary-array.yaml") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + + DefaultGenerator generator = new DefaultGenerator(); + List files = generator.opts(configurator.toClientOptInput()).generate(); + files.forEach(File::deleteOnExit); + + + Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/MultipartApi.java"); + TestUtils.assertFileContains(defaultApi, + //multiple files + "multipartArray(java.util.Collection files)", + "formParams.addAll(\"files\", files.stream().collect(Collectors.toList()));", + + //mixed + "multipartMixed(org.springframework.core.io.AbstractResource file, MultipartMixedMarker marker)", + "formParams.add(\"file\", file);", + + //single file + "multipartSingle(org.springframework.core.io.AbstractResource file)", + "formParams.add(\"file\", file);" + ); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNestjsClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNestjsClientOptionsProvider.java new file mode 100644 index 00000000000..ee49aa17dd8 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNestjsClientOptionsProvider.java @@ -0,0 +1,92 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.options; + +import com.google.common.collect.ImmutableMap; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.languages.AbstractTypeScriptClientCodegen; +import org.openapitools.codegen.languages.TypeScriptNestjsClientCodegen; + +import java.util.Map; + +public class TypeScriptNestjsClientOptionsProvider implements OptionsProvider { + public static final String SUPPORTS_ES6_VALUE = "false"; + public static final String NULL_SAFE_ADDITIONAL_PROPS_VALUE = "false"; + public static final String ENUM_NAME_SUFFIX = "Enum"; + public static final String STRING_ENUMS_VALUE = "false"; + public static final String SORT_PARAMS_VALUE = "false"; + public static final String SORT_MODEL_PROPERTIES_VALUE = "false"; + public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; + public static final String ENUM_PROPERTY_NAMING_VALUE = "PascalCase"; + public static final String MODEL_PROPERTY_NAMING_VALUE = "camelCase"; + private static final String NMP_NAME = "npmName"; + private static final String NMP_VERSION = "1.1.2"; + private static final String NPM_REPOSITORY = "https://registry.npmjs.org"; + public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; + public static final String NEST_VERSION = "6"; + public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String FILE_NAMING_VALUE = "camelCase"; + public static final String API_MODULE_PREFIX = ""; + public static String SERVICE_SUFFIX = "Service"; + public static String SERVICE_FILE_SUFFIX = ".service"; + public static String MODEL_SUFFIX = ""; + public static String MODEL_FILE_SUFFIX = ""; + + @Override + public String getLanguage() { + return "typescript-nestjs"; + } + + @Override + public Map createOptions() { + ImmutableMap.Builder builder = new ImmutableMap.Builder(); + return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE) + .put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, SORT_MODEL_PROPERTIES_VALUE) + .put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE) + .put(CodegenConstants.ENUM_PROPERTY_NAMING, ENUM_PROPERTY_NAMING_VALUE) + .put(CodegenConstants.MODEL_PROPERTY_NAMING, MODEL_PROPERTY_NAMING_VALUE) + .put(CodegenConstants.SUPPORTS_ES6, SUPPORTS_ES6_VALUE) + .put(AbstractTypeScriptClientCodegen.NULL_SAFE_ADDITIONAL_PROPS, NULL_SAFE_ADDITIONAL_PROPS_VALUE) + .put(CodegenConstants.ENUM_NAME_SUFFIX, ENUM_NAME_SUFFIX) + .put(TypeScriptNestjsClientCodegen.STRING_ENUMS, STRING_ENUMS_VALUE) + .put(TypeScriptNestjsClientCodegen.NPM_NAME, NMP_NAME) + .put(TypeScriptNestjsClientCodegen.NPM_VERSION, NMP_VERSION) + .put(TypeScriptNestjsClientCodegen.SNAPSHOT, Boolean.FALSE.toString()) + .put(TypeScriptNestjsClientCodegen.WITH_INTERFACES, Boolean.FALSE.toString()) + //.put(TypeScriptNestjsClientCodegen.USE_SINGLE_REQUEST_PARAMETER, Boolean.FALSE.toString()) + //.put(TypeScriptNestjsClientCodegen.PROVIDED_IN_ROOT, Boolean.FALSE.toString()) + .put(TypeScriptNestjsClientCodegen.TAGGED_UNIONS, Boolean.FALSE.toString()) + .put(TypeScriptNestjsClientCodegen.NPM_REPOSITORY, NPM_REPOSITORY) + .put(TypeScriptNestjsClientCodegen.NEST_VERSION, NEST_VERSION) + //.put(TypeScriptNestjsClientCodegen.API_MODULE_PREFIX, API_MODULE_PREFIX) + .put(TypeScriptNestjsClientCodegen.SERVICE_SUFFIX, SERVICE_SUFFIX) + .put(TypeScriptNestjsClientCodegen.SERVICE_FILE_SUFFIX, SERVICE_FILE_SUFFIX) + .put(TypeScriptNestjsClientCodegen.MODEL_SUFFIX, MODEL_SUFFIX) + .put(TypeScriptNestjsClientCodegen.MODEL_FILE_SUFFIX, MODEL_FILE_SUFFIX) + .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) + .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") + .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(TypeScriptNestjsClientCodegen.FILE_NAMING, FILE_NAMING_VALUE) + .build(); + } + + @Override + public boolean isServer() { + return false; + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypeScriptNestjsClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypeScriptNestjsClientCodegenTest.java new file mode 100644 index 00000000000..43775c64132 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypeScriptNestjsClientCodegenTest.java @@ -0,0 +1,135 @@ +package org.openapitools.codegen.typescript.typescriptnestjs; + +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.ComposedSchema; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.responses.ApiResponse; +import io.swagger.v3.oas.models.responses.ApiResponses; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.languages.TypeScriptNestjsClientCodegen; +import org.testng.Assert; +import org.testng.annotations.Test; + + +public class TypeScriptNestjsClientCodegenTest { + @Test + public void testModelFileSuffix() { + TypeScriptNestjsClientCodegen codegen = new TypeScriptNestjsClientCodegen(); + codegen.additionalProperties().put("modelFileSuffix", "MySuffix"); + codegen.additionalProperties().put("modelSuffix", "MySuffix"); + codegen.processOpts(); + + Assert.assertEquals("testNameMySuffix", codegen.toModelFilename("testName")); + } + + @Test + public void testOperationIdParser() { + OpenAPI openAPI = TestUtils.createOpenAPI(); + Operation operation1 = new Operation().operationId("123_test_@#$%_special_tags").responses(new ApiResponses().addApiResponse("201", new ApiResponse().description("OK"))); + openAPI.path("another-fake/dummy/", new PathItem().get(operation1)); + final TypeScriptNestjsClientCodegen codegen = new TypeScriptNestjsClientCodegen(); + codegen.setOpenAPI(openAPI); + + CodegenOperation co1 = codegen.fromOperation("/another-fake/dummy/", "get", operation1, null); + org.testng.Assert.assertEquals(co1.operationId, "_123testSpecialTags"); + + } + + @Test + public void testSnapshotVersion() { + OpenAPI openAPI = TestUtils.createOpenAPI(); + + TypeScriptNestjsClientCodegen codegen = new TypeScriptNestjsClientCodegen(); + codegen.additionalProperties().put("npmName", "@openapi/typescript-nestjs-petstore"); + codegen.additionalProperties().put("snapshot", true); + codegen.additionalProperties().put("npmVersion", "1.0.0-SNAPSHOT"); + codegen.processOpts(); + codegen.preprocessOpenAPI(openAPI); + + Assert.assertTrue(codegen.getNpmVersion().matches("^1.0.0-SNAPSHOT.[0-9]{12}$")); + + codegen = new TypeScriptNestjsClientCodegen(); + codegen.additionalProperties().put("npmName", "@openapi/typescript-nestjs-petstore"); + codegen.additionalProperties().put("snapshot", true); + codegen.additionalProperties().put("npmVersion", "3.0.0-M1"); + codegen.processOpts(); + codegen.preprocessOpenAPI(openAPI); + + Assert.assertTrue(codegen.getNpmVersion().matches("^3.0.0-M1-SNAPSHOT.[0-9]{12}$")); + + } + + @Test + public void testWithoutSnapshotVersion() { + OpenAPI openAPI = TestUtils.createOpenAPI(); + + TypeScriptNestjsClientCodegen codegen = new TypeScriptNestjsClientCodegen(); + codegen.additionalProperties().put("npmName", "@openapi/typescript-nestjs-petstore"); + codegen.additionalProperties().put("snapshot", false); + codegen.additionalProperties().put("npmVersion", "1.0.0-SNAPSHOT"); + codegen.processOpts(); + codegen.preprocessOpenAPI(openAPI); + + Assert.assertTrue(codegen.getNpmVersion().matches("^1.0.0-SNAPSHOT$")); + + codegen = new TypeScriptNestjsClientCodegen(); + codegen.additionalProperties().put("npmName", "@openapi/typescript-nestjs-petstore"); + codegen.additionalProperties().put("snapshot", false); + codegen.additionalProperties().put("npmVersion", "3.0.0-M1"); + codegen.processOpts(); + codegen.preprocessOpenAPI(openAPI); + + Assert.assertTrue(codegen.getNpmVersion().matches("^3.0.0-M1$")); + + } + + @Test + public void testRemovePrefixSuffix() { + TypeScriptNestjsClientCodegen codegen = new TypeScriptNestjsClientCodegen(); + + // simple noop test + Assert.assertEquals("TestName", codegen.removeModelPrefixSuffix("TestName")); + + codegen.setModelNamePrefix("abc"); + codegen.setModelNameSuffix("def"); + codegen.additionalProperties().put("modelSuffix", "Ghi"); + codegen.processOpts(); + + Assert.assertEquals("TestName", codegen.removeModelPrefixSuffix("TestName")); + Assert.assertEquals("TestName", codegen.removeModelPrefixSuffix("TestNameGhi")); + Assert.assertEquals("TestNameghi", codegen.removeModelPrefixSuffix("TestNameghi")); + Assert.assertEquals("abcTestName", codegen.removeModelPrefixSuffix("abcTestName")); + Assert.assertEquals("TestName", codegen.removeModelPrefixSuffix("AbcTestName")); + Assert.assertEquals("AbcTestName", codegen.removeModelPrefixSuffix("AbcAbcTestName")); + Assert.assertEquals("TestName", codegen.removeModelPrefixSuffix("TestNameDef")); + Assert.assertEquals("TestNamedef", codegen.removeModelPrefixSuffix("TestNamedef")); + Assert.assertEquals("TestNamedefghi", codegen.removeModelPrefixSuffix("TestNamedefghi")); + Assert.assertEquals("TestNameDefghi", codegen.removeModelPrefixSuffix("TestNameDefghi")); + Assert.assertEquals("TestName", codegen.removeModelPrefixSuffix("TestNameDefGhi")); + } + + @Test + public void testSchema() { + TypeScriptNestjsClientCodegen codegen = new TypeScriptNestjsClientCodegen(); + + ComposedSchema composedSchema = new ComposedSchema(); + + Schema schema1 = new Schema<>(); + schema1.set$ref("SchemaOne"); + Schema schema2 = new Schema<>(); + schema2.set$ref("SchemaTwo"); + Schema schema3 = new Schema<>(); + schema3.set$ref("SchemaThree"); + + composedSchema.addAnyOfItem(schema1); + composedSchema.addAnyOfItem(schema2); + composedSchema.addAnyOfItem(schema3); + + String schemaType = codegen.getSchemaType(composedSchema); + Assert.assertEquals(schemaType, "SchemaOne | SchemaTwo | SchemaThree"); + } + +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypeScriptNestjsClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypeScriptNestjsClientOptionsTest.java new file mode 100644 index 00000000000..a2d137537fb --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypeScriptNestjsClientOptionsTest.java @@ -0,0 +1,49 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.typescript.typescriptnestjs; + +import org.openapitools.codegen.AbstractOptionsTest; +import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.languages.TypeScriptNestjsClientCodegen; +import org.openapitools.codegen.options.TypeScriptNestjsClientOptionsProvider; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +public class TypeScriptNestjsClientOptionsTest extends AbstractOptionsTest { + + private TypeScriptNestjsClientCodegen clientCodegen = mock(TypeScriptNestjsClientCodegen.class, mockSettings); + + public TypeScriptNestjsClientOptionsTest() { + super(new TypeScriptNestjsClientOptionsProvider()); + } + + @Override + protected CodegenConfig getCodegenConfig() { + return clientCodegen; + } + + @SuppressWarnings("unused") + @Override + protected void verifyOptions() { + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(TypeScriptNestjsClientOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setModelPropertyNaming(TypeScriptNestjsClientOptionsProvider.MODEL_PROPERTY_NAMING_VALUE); + verify(clientCodegen).setSupportsES6(Boolean.valueOf(TypeScriptNestjsClientOptionsProvider.SUPPORTS_ES6_VALUE)); + verify(clientCodegen).setStringEnums(Boolean.parseBoolean(TypeScriptNestjsClientOptionsProvider.STRING_ENUMS_VALUE)); + verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptNestjsClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypeScriptNestjsModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypeScriptNestjsModelTest.java new file mode 100644 index 00000000000..1ea2ed86c06 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypeScriptNestjsModelTest.java @@ -0,0 +1,236 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.typescript.typescriptnestjs; + +import com.google.common.collect.Sets; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.parser.util.SchemaTypeUtil; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.DefaultCodegen; +import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.languages.TypeScriptNestjsClientCodegen; +import org.testng.Assert; +import org.testng.annotations.Test; + +@SuppressWarnings("static-method") +public class TypeScriptNestjsModelTest { + + @Test(description = "convert a simple TypeScript Nestjs model") + public void simpleModelTest() { + final Schema model = new Schema() + .description("a sample model") + .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) + .addProperties("name", new StringSchema()) + .addProperties("createdAt", new DateTimeSchema()) + .addProperties("birthDate", new DateSchema()) + .addRequiredItem("id") + .addRequiredItem("name"); + final DefaultCodegen codegen = new TypeScriptNestjsClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", model); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "a sample model"); + Assert.assertEquals(cm.vars.size(), 4); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "id"); + Assert.assertEquals(property1.dataType, "number"); + Assert.assertEquals(property1.name, "id"); + Assert.assertEquals(property1.defaultValue, "undefined"); + Assert.assertEquals(property1.baseType, "number"); + Assert.assertTrue(property1.required); + Assert.assertFalse(property1.isContainer); + + final CodegenProperty property2 = cm.vars.get(1); + Assert.assertEquals(property2.baseName, "name"); + Assert.assertEquals(property2.dataType, "string"); + Assert.assertEquals(property2.name, "name"); + Assert.assertEquals(property2.defaultValue, "undefined"); + Assert.assertEquals(property2.baseType, "string"); + Assert.assertTrue(property2.required); + Assert.assertFalse(property2.isContainer); + + final CodegenProperty property3 = cm.vars.get(2); + Assert.assertEquals(property3.baseName, "createdAt"); + Assert.assertEquals(property3.complexType, null); + Assert.assertEquals(property3.dataType, "string"); + Assert.assertEquals(property3.name, "createdAt"); + Assert.assertEquals(property3.baseType, "string"); + Assert.assertEquals(property3.defaultValue, "undefined"); + Assert.assertFalse(property3.required); + Assert.assertFalse(property3.isContainer); + + final CodegenProperty property4 = cm.vars.get(3); + Assert.assertEquals(property4.baseName, "birthDate"); + Assert.assertEquals(property4.complexType, null); + Assert.assertEquals(property4.dataType, "string"); + Assert.assertEquals(property4.name, "birthDate"); + Assert.assertEquals(property4.baseType, "string"); + Assert.assertEquals(property4.defaultValue, "undefined"); + Assert.assertFalse(property4.required); + Assert.assertFalse(property4.isContainer); + } + + @Test(description = "convert a model with list property") + public void listPropertyTest() { + final Schema schema = new Schema() + .description("a sample model") + .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) + .addProperties("urls", new ArraySchema().items(new StringSchema())) + .addRequiredItem("id"); + final DefaultCodegen codegen = new TypeScriptNestjsClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); + codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", schema); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "a sample model"); + Assert.assertEquals(cm.vars.size(), 2); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "id"); + Assert.assertEquals(property1.dataType, "number"); + Assert.assertEquals(property1.name, "id"); + Assert.assertEquals(property1.defaultValue, "undefined"); + Assert.assertEquals(property1.baseType, "number"); + Assert.assertTrue(property1.required); + Assert.assertFalse(property1.isContainer); + + final CodegenProperty property2 = cm.vars.get(1); + Assert.assertEquals(property2.baseName, "urls"); + Assert.assertEquals(property2.dataType, "Array"); + Assert.assertEquals(property2.name, "urls"); + Assert.assertEquals(property2.baseType, "Array"); + Assert.assertFalse(property2.required); + } + + @Test(description = "convert a model with complex property") + public void complexPropertyTest() { + final Schema schema = new Schema() + .description("a sample model") + .addProperties("children", new Schema().$ref("#/definitions/Children")); + final DefaultCodegen codegen = new TypeScriptNestjsClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); + codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", schema); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "a sample model"); + Assert.assertEquals(cm.vars.size(), 1); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "children"); + Assert.assertEquals(property1.dataType, "Children"); + Assert.assertEquals(property1.name, "children"); + Assert.assertEquals(property1.defaultValue, "undefined"); + Assert.assertEquals(property1.baseType, "Children"); + Assert.assertFalse(property1.required); + } + + @Test(description = "convert a model with complex list property") + public void complexListPropertyTest() { + final Schema schema = new Schema() + .description("a sample model") + .addProperties("children", new ArraySchema() + .items(new Schema().$ref("#/definitions/Children"))); + final DefaultCodegen codegen = new TypeScriptNestjsClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); + codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", schema); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "a sample model"); + Assert.assertEquals(cm.vars.size(), 1); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "children"); + Assert.assertEquals(property1.complexType, "Children"); + Assert.assertEquals(property1.dataType, "Array"); + Assert.assertEquals(property1.name, "children"); + Assert.assertEquals(property1.baseType, "Array"); + Assert.assertFalse(property1.required); + } + + @Test(description = "convert an array model") + public void arrayModelTest() { + final Schema schema = new ArraySchema() + .items(new Schema().$ref("#/definitions/Children")) + .description("an array model"); + final DefaultCodegen codegen = new TypeScriptNestjsClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); + codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", schema); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "an array model"); + Assert.assertEquals(cm.vars.size(), 0); + } + + @Test(description = "convert a map model") + public void mapModelTest() { + final Schema schema = new Schema() + .description("a map model") + .additionalProperties(new Schema().$ref("#/definitions/Children")); + final DefaultCodegen codegen = new TypeScriptNestjsClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); + codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", schema); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "a map model"); + Assert.assertEquals(cm.vars.size(), 0); + Assert.assertEquals(cm.imports.size(), 1); + Assert.assertEquals(cm.additionalPropertiesType, "Children"); + Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1); + } + + @Test(description = "convert a model with a name starting with decimal") + public void beginDecimalNameTest() { + final Schema schema = new Schema() + .description("a model with a name starting with decimal") + .addProperties("1list", new StringSchema()) + .addRequiredItem("1list"); + final DefaultCodegen codegen = new TypeScriptNestjsClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); + codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", schema); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.vars.size(), 1); + + final CodegenProperty property = cm.vars.get(0); + Assert.assertEquals(property.baseName, "1list"); + Assert.assertEquals(property.dataType, "string"); + Assert.assertEquals(property.name, "_1list"); + Assert.assertEquals(property.defaultValue, "undefined"); + Assert.assertEquals(property.baseType, "string"); + Assert.assertTrue(property.required); + Assert.assertFalse(property.isContainer); + } + +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypescriptNestjsAdditionalPropertiesIntegrationTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypescriptNestjsAdditionalPropertiesIntegrationTest.java new file mode 100644 index 00000000000..e0ab5cd60cf --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypescriptNestjsAdditionalPropertiesIntegrationTest.java @@ -0,0 +1,48 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.typescript.typescriptnestjs; + +import org.openapitools.codegen.AbstractIntegrationTest; +import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.languages.TypeScriptNestjsClientCodegen; +import org.openapitools.codegen.testutils.IntegrationTestPathsConfig; + +import java.util.HashMap; +import java.util.Map; + +public class TypescriptNestjsAdditionalPropertiesIntegrationTest extends AbstractIntegrationTest { + + @Override + protected CodegenConfig getCodegenConfig() { + return new TypeScriptNestjsClientCodegen(); + } + + @Override + protected Map configProperties() { + Map properties = new HashMap<>(); + properties.put("npmName", "additionalPropertiesTest"); + properties.put("npmVersion", "1.0.2"); + properties.put("snapshot", "false"); + + return properties; + } + + @Override + protected IntegrationTestPathsConfig getIntegrationTestPathsConfig() { + return new IntegrationTestPathsConfig("typescript/additional-properties"); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypescriptNestjsApiVersionTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypescriptNestjsApiVersionTest.java new file mode 100644 index 00000000000..e767a1eeb07 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypescriptNestjsApiVersionTest.java @@ -0,0 +1,52 @@ +package org.openapitools.codegen.typescript.typescriptnestjs; + +import io.swagger.v3.oas.models.OpenAPI; +import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.languages.TypeScriptNestjsClientCodegen; +import org.testng.Assert; +import org.testng.annotations.Test; + +public class TypescriptNestjsApiVersionTest { + + @Test(description = "tests if API version specification is used if no version is provided in additional properties") + public void testWithApiVersion() { + final TypeScriptNestjsClientCodegen codegen = new TypeScriptNestjsClientCodegen(); + + codegen.additionalProperties().put("npmName", "just-a-test"); + + OpenAPI api = TestUtils.createOpenAPI(); + codegen.processOpts(); + codegen.preprocessOpenAPI(api); + + Assert.assertEquals(codegen.getNpmVersion(), "1.0.7"); + } + + @Test(description = "tests if npmVersion additional property is used") + public void testWithNpmVersion() { + final TypeScriptNestjsClientCodegen codegen = new TypeScriptNestjsClientCodegen(); + + codegen.additionalProperties().put("npmName", "just-a-test"); + codegen.additionalProperties().put("npmVersion", "2.0.0"); + + OpenAPI api = TestUtils.createOpenAPI(); + codegen.processOpts(); + codegen.preprocessOpenAPI(api); + + Assert.assertEquals(codegen.getNpmVersion(), "2.0.0"); + } + + @Test(description = "tests if default version is used when neither OpenAPI version nor npmVersion additional property has been provided") + public void testWithoutApiVersion() { + final TypeScriptNestjsClientCodegen codegen = new TypeScriptNestjsClientCodegen(); + + codegen.additionalProperties().put("npmName", "just-a-test"); + + OpenAPI api = TestUtils.createOpenAPI(); + api.getInfo().setVersion(null); + codegen.processOpts(); + codegen.preprocessOpenAPI(api); + + Assert.assertEquals(codegen.getNpmVersion(), "1.0.0"); + } + +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypescriptNestjsArrayAndObjectIntegrationTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypescriptNestjsArrayAndObjectIntegrationTest.java new file mode 100644 index 00000000000..15d19d42af2 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypescriptNestjsArrayAndObjectIntegrationTest.java @@ -0,0 +1,48 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.typescript.typescriptnestjs; + +import org.openapitools.codegen.AbstractIntegrationTest; +import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.languages.TypeScriptNestjsClientCodegen; +import org.openapitools.codegen.testutils.IntegrationTestPathsConfig; + +import java.util.HashMap; +import java.util.Map; + +public class TypescriptNestjsArrayAndObjectIntegrationTest extends AbstractIntegrationTest { + + @Override + protected CodegenConfig getCodegenConfig() { + return new TypeScriptNestjsClientCodegen(); + } + + @Override + protected Map configProperties() { + Map properties = new HashMap<>(); + properties.put("npmName", "arrayAndAnyTest"); + properties.put("npmVersion", "1.0.2"); + properties.put("snapshot", "false"); + + return properties; + } + + @Override + protected IntegrationTestPathsConfig getIntegrationTestPathsConfig() { + return new IntegrationTestPathsConfig("typescript/array-and-object"); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypescriptNestjsPestoreIntegrationTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypescriptNestjsPestoreIntegrationTest.java new file mode 100644 index 00000000000..b8cb270bec6 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypescriptNestjsPestoreIntegrationTest.java @@ -0,0 +1,48 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.typescript.typescriptnestjs; + +import org.openapitools.codegen.AbstractIntegrationTest; +import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.languages.TypeScriptNestjsClientCodegen; +import org.openapitools.codegen.testutils.IntegrationTestPathsConfig; + +import java.util.HashMap; +import java.util.Map; + +public class TypescriptNestjsPestoreIntegrationTest extends AbstractIntegrationTest { + + @Override + protected CodegenConfig getCodegenConfig() { + return new TypeScriptNestjsClientCodegen(); + } + + @Override + protected Map configProperties() { + Map properties = new HashMap<>(); + properties.put("npmName", "petstore-integration-test"); + properties.put("npmVersion", "1.0.3"); + properties.put("snapshot", "false"); + + return properties; + } + + @Override + protected IntegrationTestPathsConfig getIntegrationTestPathsConfig() { + return new IntegrationTestPathsConfig("typescript/petstore"); + } +} diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_7533.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_7533.yaml new file mode 100644 index 00000000000..7d66422f558 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/issue_7533.yaml @@ -0,0 +1,17 @@ +openapi: 3.0.1 +info: + title: OpenAPI Petstore + description: "sample spec" + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + version: 1.0.0 +servers: + - url: / + - url: http://trailingshlash.io:80/v1/ + - url: http://notrailingslash.io:80/v2 +tags: [] +paths: {} +components: + schemas: {} + securitySchemes: {} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_7651.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_7651.yaml index f35d64b4b35..eeb27cace99 100644 --- a/modules/openapi-generator/src/test/resources/3_0/issue_7651.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/issue_7651.yaml @@ -12,6 +12,2332 @@ tags: - name: isX description: an api that ensures that isX properties are present on Schema classes paths: + /ArrayWithMaxItems: + post: + tags: + - isX + operationId: ArrayWithMaxItems + requestBody: + content: + application/json: + schema: + type: array + maxItems: 2 + items: + type: string + responses: + 200: + description: success + content: + application/json: + schema: + type: array + maxItems: 2 + items: + type: string + /ArrayWithMinItems: + post: + tags: + - isX + operationId: ArrayWithMinItems + requestBody: + content: + application/json: + schema: + type: array + minItems: 2 + items: + type: string + responses: + 200: + description: success + content: + application/json: + schema: + type: array + minItems: 2 + items: + type: string + /ArrayWithUniqueItems: + post: + tags: + - isX + operationId: ArrayWithUniqueItems + requestBody: + content: + application/json: + schema: + type: array + uniqueItems: true + items: + type: string + responses: + 200: + description: success + content: + application/json: + schema: + type: array + uniqueItems: true + items: + type: string + /ObjectWithMinProperties: + post: + tags: + - isX + operationId: ObjectWithMinProperties + requestBody: + content: + application/json: + schema: + type: object + minProperties: 2 + responses: + 200: + description: success + content: + application/json: + schema: + type: object + minProperties: 2 + /ObjectWithMaxProperties: + post: + tags: + - isX + operationId: ObjectWithMaxProperties + requestBody: + content: + application/json: + schema: + type: object + maxProperties: 2 + responses: + 200: + description: success + content: + application/json: + schema: + type: object + maxProperties: 2 + /StringWithMinLength: + post: + tags: + - isX + operationId: StringWithMinLength + requestBody: + content: + application/json: + schema: + type: string + minLength: 1 + responses: + 200: + description: success + content: + application/json: + schema: + type: string + minLength: 1 + /DateWithMinLength: + post: + tags: + - isX + operationId: DateWithMinLength + requestBody: + content: + application/json: + schema: + type: string + format: date + minLength: 1 + responses: + 200: + description: success + content: + application/json: + schema: + type: string + format: date + minLength: 1 + /DateTimeWithMinLength: + post: + tags: + - isX + operationId: DateTimeWithMinLength + requestBody: + content: + application/json: + schema: + type: string + format: date-time + minLength: 1 + responses: + 200: + description: success + content: + application/json: + schema: + type: string + format: date-time + minLength: 1 + /ByteWithMinLength: + post: + tags: + - isX + operationId: ByteWithMinLength + requestBody: + content: + application/json: + schema: + type: string + format: byte + minLength: 1 + responses: + 200: + description: success + content: + application/json: + schema: + type: string + format: byte + minLength: 1 + /BinaryWithMinLength: + post: + tags: + - isX + operationId: BinaryWithMinLength + requestBody: + content: + application/json: + schema: + type: string + format: binary + minLength: 1 + responses: + 200: + description: success + content: + application/json: + schema: + type: string + format: binary + minLength: 1 + /StringWithMaxLength: + post: + tags: + - isX + operationId: StringWithMaxLength + requestBody: + content: + application/json: + schema: + type: string + maxLength: 10 + responses: + 200: + description: success + content: + application/json: + schema: + type: string + maxLength: 10 + /DateWithMaxLength: + post: + tags: + - isX + operationId: DateWithMaxLength + requestBody: + content: + application/json: + schema: + type: string + format: date + maxLength: 10 + responses: + 200: + description: success + content: + application/json: + schema: + type: string + format: date + maxLength: 10 + /DateTimeWithMaxLength: + post: + tags: + - isX + operationId: DateTimeWithMaxLength + requestBody: + content: + application/json: + schema: + type: string + format: date-time + maxLength: 10 + responses: + 200: + description: success + content: + application/json: + schema: + type: string + format: date-time + maxLength: 10 + /ByteWithMaxLength: + post: + tags: + - isX + operationId: ByteWithMaxLength + requestBody: + content: + application/json: + schema: + type: string + format: byte + maxLength: 10 + responses: + 200: + description: success + content: + application/json: + schema: + type: string + format: byte + maxLength: 10 + /BinaryWithMaxLength: + post: + tags: + - isX + operationId: BinaryWithMaxLength + requestBody: + content: + application/json: + schema: + type: string + format: binary + maxLength: 10 + responses: + 200: + description: success + content: + application/json: + schema: + type: string + format: binary + maxLength: 10 + /StringWithPattern: + post: + tags: + - isX + operationId: StringWithPattern + requestBody: + content: + application/json: + schema: + type: string + pattern: '^2021.+' + responses: + 200: + description: success + content: + application/json: + schema: + type: string + pattern: '^2021.+' + /DateWithPattern: + post: + tags: + - isX + operationId: DateWithPattern + requestBody: + content: + application/json: + schema: + type: string + format: date + pattern: '^2021.+' + responses: + 200: + description: success + content: + application/json: + schema: + type: string + format: date + pattern: '^2021.+' + /DateTimeWithPattern: + post: + tags: + - isX + operationId: DateTimeWithPattern + requestBody: + content: + application/json: + schema: + type: string + format: date-time + pattern: '^2021.+' + responses: + 200: + description: success + content: + application/json: + schema: + type: string + format: date-time + pattern: '^2021.+' + /ByteWithPattern: + post: + tags: + - isX + operationId: ByteWithPattern + requestBody: + content: + application/json: + schema: + type: string + format: byte + pattern: '^2021.+' + responses: + 200: + description: success + content: + application/json: + schema: + type: string + format: byte + pattern: '^2021.+' + /BinaryWithPattern: + post: + tags: + - isX + operationId: BinaryWithPattern + requestBody: + content: + application/json: + schema: + type: string + format: binary + pattern: '^2021.+' + responses: + 200: + description: success + content: + application/json: + schema: + type: string + format: binary + pattern: '^2021.+' + /IntegerWithMultipleOf: + post: + tags: + - isX + operationId: IntegerWithMultipleOf + requestBody: + content: + application/json: + schema: + type: integer + multipleOf: 2 + responses: + 200: + description: success + content: + application/json: + schema: + type: integer + multipleOf: 2 + /Integer32WithMultipleOf: + post: + tags: + - isX + operationId: Integer32WithMultipleOf + requestBody: + content: + application/json: + schema: + type: integer + format: int32 + multipleOf: 2 + responses: + 200: + description: success + content: + application/json: + schema: + type: integer + format: int32 + multipleOf: 2 + /Integer64WithMultipleOf: + post: + tags: + - isX + operationId: Integer64WithMultipleOf + requestBody: + content: + application/json: + schema: + type: integer + format: int64 + multipleOf: 2 + responses: + 200: + description: success + content: + application/json: + schema: + type: integer + format: int64 + multipleOf: 2 + /NumberWithMultipleOf: + post: + tags: + - isX + operationId: NumberWithMultipleOf + requestBody: + content: + application/json: + schema: + type: number + multipleOf: 2 + responses: + 200: + description: success + content: + application/json: + schema: + type: number + multipleOf: 2 + /NumberFloatWithMultipleOf: + post: + tags: + - isX + operationId: NumberFloatWithMultipleOf + requestBody: + content: + application/json: + schema: + type: number + format: float + multipleOf: 2 + responses: + 200: + description: success + content: + application/json: + schema: + type: number + format: float + multipleOf: 2 + /NumberDoubleWithMultipleOf: + post: + tags: + - isX + operationId: NumberDoubleWithMultipleOf + requestBody: + content: + application/json: + schema: + type: number + format: double + multipleOf: 2 + responses: + 200: + description: success + content: + application/json: + schema: + type: number + format: double + multipleOf: 2 + /IntegerWithMinimum: + post: + tags: + - isX + operationId: IntegerWithMinimum + requestBody: + content: + application/json: + schema: + type: integer + minimum: 1 + responses: + 200: + description: success + content: + application/json: + schema: + type: integer + minimum: 1 + /Integer32WithMinimum: + post: + tags: + - isX + operationId: Integer32WithMinimum + requestBody: + content: + application/json: + schema: + type: integer + format: int32 + minimum: 1 + responses: + 200: + description: success + content: + application/json: + schema: + type: integer + format: int32 + minimum: 1 + /Integer64WithMinimum: + post: + tags: + - isX + operationId: Integer64WithMinimum + requestBody: + content: + application/json: + schema: + type: integer + format: int64 + minimum: 1 + responses: + 200: + description: success + content: + application/json: + schema: + type: integer + format: int64 + minimum: 1 + /NumberWithMinimum: + post: + tags: + - isX + operationId: NumberWithMinimum + requestBody: + content: + application/json: + schema: + type: number + minimum: 1 + responses: + 200: + description: success + content: + application/json: + schema: + type: number + minimum: 1 + /NumberFloatWithMinimum: + post: + tags: + - isX + operationId: NumberFloatWithMinimum + requestBody: + content: + application/json: + schema: + type: number + format: float + minimum: 1 + responses: + 200: + description: success + content: + application/json: + schema: + type: number + format: float + minimum: 1 + /NumberDoubleWithMinimum: + post: + tags: + - isX + operationId: NumberDoubleWithMinimum + requestBody: + content: + application/json: + schema: + type: number + format: double + minimum: 1 + responses: + 200: + description: success + content: + application/json: + schema: + type: number + format: double + minimum: 1 + /IntegerWithMaximum: + post: + tags: + - isX + operationId: IntegerWithMaximum + requestBody: + content: + application/json: + schema: + type: integer + maximum: 10 + responses: + 200: + description: success + content: + application/json: + schema: + type: integer + maximum: 10 + /Integer32WithMaximum: + post: + tags: + - isX + operationId: Integer32WithMaximum + requestBody: + content: + application/json: + schema: + type: integer + format: int32 + maximum: 10 + responses: + 200: + description: success + content: + application/json: + schema: + type: integer + format: int32 + maximum: 10 + /Integer64WithMaximum: + post: + tags: + - isX + operationId: Integer64WithMaximum + requestBody: + content: + application/json: + schema: + type: integer + format: int64 + maximum: 10 + responses: + 200: + description: success + content: + application/json: + schema: + type: integer + format: int64 + maximum: 10 + /NumberWithMaximum: + post: + tags: + - isX + operationId: NumberWithMaximum + requestBody: + content: + application/json: + schema: + type: number + maximum: 10 + responses: + 200: + description: success + content: + application/json: + schema: + type: number + maximum: 10 + /NumberFloatWithMaximum: + post: + tags: + - isX + operationId: NumberFloatWithMaximum + requestBody: + content: + application/json: + schema: + type: number + format: float + maximum: 10 + responses: + 200: + description: success + content: + application/json: + schema: + type: number + format: float + maximum: 10 + /NumberDoubleWithMaximum: + post: + tags: + - isX + operationId: NumberDoubleWithMaximum + requestBody: + content: + application/json: + schema: + type: number + format: double + maximum: 10 + responses: + 200: + description: success + content: + application/json: + schema: + type: number + format: double + maximum: 10 + /IntegerWithExclusiveMaximum: + post: + tags: + - isX + operationId: IntegerWithExclusiveMaximum + requestBody: + content: + application/json: + schema: + type: integer + maximum: 10 + exclusiveMaximum: true + responses: + 200: + description: success + content: + application/json: + schema: + type: integer + maximum: 10 + exclusiveMaximum: true + /Integer32WithExclusiveMaximum: + post: + tags: + - isX + operationId: Integer32WithExclusiveMaximum + requestBody: + content: + application/json: + schema: + type: integer + format: int32 + maximum: 10 + exclusiveMaximum: true + responses: + 200: + description: success + content: + application/json: + schema: + type: integer + format: int32 + maximum: 10 + exclusiveMaximum: true + /Integer64WithExclusiveMaximum: + post: + tags: + - isX + operationId: Integer64WithExclusiveMaximum + requestBody: + content: + application/json: + schema: + type: integer + format: int64 + maximum: 10 + exclusiveMaximum: true + responses: + 200: + description: success + content: + application/json: + schema: + type: integer + format: int64 + maximum: 10 + exclusiveMaximum: true + /NumberWithExclusiveMaximum: + post: + tags: + - isX + operationId: NumberWithExclusiveMaximum + requestBody: + content: + application/json: + schema: + type: number + maximum: 10 + exclusiveMaximum: true + responses: + 200: + description: success + content: + application/json: + schema: + type: number + maximum: 10 + exclusiveMaximum: true + /NumberFloatWithExclusiveMaximum: + post: + tags: + - isX + operationId: NumberFloatWithExclusiveMaximum + requestBody: + content: + application/json: + schema: + type: number + format: float + maximum: 10 + exclusiveMaximum: true + responses: + 200: + description: success + content: + application/json: + schema: + type: number + format: float + maximum: 10 + exclusiveMaximum: true + /NumberDoubleWithExclusiveMaximum: + post: + tags: + - isX + operationId: NumberDoubleWithExclusiveMaximum + requestBody: + content: + application/json: + schema: + type: number + format: double + maximum: 10 + exclusiveMaximum: true + responses: + 200: + description: success + content: + application/json: + schema: + type: number + format: double + maximum: 10 + exclusiveMaximum: true + /IntegerWithExclusiveMinimum: + post: + tags: + - isX + operationId: IntegerWithExclusiveMinimum + requestBody: + content: + application/json: + schema: + type: integer + minimum: 1 + exclusiveMinimum: true + responses: + 200: + description: success + content: + application/json: + schema: + type: integer + minimum: 1 + exclusiveMinimum: true + /Integer32WithExclusiveMinimum: + post: + tags: + - isX + operationId: Integer32WithExclusiveMinimum + requestBody: + content: + application/json: + schema: + type: integer + format: int32 + minimum: 1 + exclusiveMinimum: true + responses: + 200: + description: success + content: + application/json: + schema: + type: integer + format: int32 + minimum: 1 + exclusiveMinimum: true + /Integer64WithExclusiveMinimum: + post: + tags: + - isX + operationId: Integer64WithExclusiveMinimum + requestBody: + content: + application/json: + schema: + type: integer + format: int64 + minimum: 1 + exclusiveMinimum: true + responses: + 200: + description: success + content: + application/json: + schema: + type: integer + format: int64 + minimum: 1 + exclusiveMinimum: true + /NumberWithExclusiveMinimum: + post: + tags: + - isX + operationId: NumberWithExclusiveMinimum + requestBody: + content: + application/json: + schema: + type: number + minimum: 1 + exclusiveMinimum: true + responses: + 200: + description: success + content: + application/json: + schema: + type: number + minimum: 1 + exclusiveMinimum: true + /NumberFloatWithExclusiveMinimum: + post: + tags: + - isX + operationId: NumberFloatWithExclusiveMinimum + requestBody: + content: + application/json: + schema: + type: number + format: float + minimum: 1 + exclusiveMinimum: true + responses: + 200: + description: success + content: + application/json: + schema: + type: number + format: float + minimum: 1 + exclusiveMinimum: true + /NumberDoubleWithExclusiveMinimum: + post: + tags: + - isX + operationId: NumberDoubleWithExclusiveMinimum + requestBody: + content: + application/json: + schema: + type: number + format: double + minimum: 1 + exclusiveMinimum: true + responses: + 200: + description: success + content: + application/json: + schema: + type: number + format: double + minimum: 1 + exclusiveMinimum: true + /pathParametersWithValidation: + post: + tags: + - isX + operationId: pathParametersWithValidation + parameters: + - name: ArrayWithMaxItems + in: path + schema: + type: array + maxItems: 2 + items: + type: string + - name: ArrayWithMinItems + in: path + schema: + type: array + minItems: 2 + items: + type: string + - name: ArrayWithUniqueItems + in: path + schema: + type: array + uniqueItems: true + items: + type: string + - name: ObjectWithMinProperties + in: path + schema: + type: object + minProperties: 2 + - name: ObjectWithMaxProperties + in: path + schema: + type: object + maxProperties: 2 + - name: StringWithMinLength + in: path + schema: + type: string + minLength: 1 + - name: DateWithMinLength + in: path + schema: + type: string + format: date + minLength: 10 + - name: DateTimeWithMinLength + in: path + schema: + type: string + format: date-time + minLength: 20 + - name: ByteWithMinLength + in: path + schema: + type: string + format: byte + minLength: 10 + - name: BinaryWithMinLength + in: path + schema: + type: string + format: binary + minLength: 10 + - name: StringWithMaxLength + in: path + schema: + type: string + maxLength: 1 + - name: DateWithMaxLength + in: path + schema: + type: string + format: date + maxLength: 10 + - name: DateTimeWithMaxLength + in: path + schema: + type: string + format: date-time + maxLength: 20 + - name: ByteWithMaxLength + in: path + schema: + type: string + format: byte + maxLength: 10 + - name: BinaryWithMaxLength + in: path + schema: + type: string + format: binary + maxLength: 10 + - name: IntegerWithMultipleOf + in: path + schema: + type: integer + multipleOf: 2 + - name: Integer32WithMultipleOf + in: path + schema: + type: integer + format: int32 + multipleOf: 2 + - name: Integer64WithMultipleOf + in: path + schema: + type: integer + format: int64 + multipleOf: 2 + - name: NumberWithMultipleOf + in: path + schema: + type: number + multipleOf: 2 + - name: NumberFloatWithMultipleOf + in: path + schema: + type: number + format: float + multipleOf: 2 + - name: NumberDoubleWithMultipleOf + in: path + schema: + type: number + format: double + multipleOf: 2 + - name: StringWithPattern + in: path + schema: + type: string + pattern: '^2021.+' + - name: DateWithPattern + in: path + schema: + type: string + format: date + pattern: '^2021.+' + - name: DateTimeWithPattern + in: path + schema: + type: string + format: date-time + pattern: '^2021.+' + - name: ByteWithPattern + in: path + schema: + type: string + format: byte + pattern: '^2021.+' + - name: BinaryWithPattern + in: path + schema: + type: string + format: binary + pattern: '^2021.+' + - name: IntegerWithMinimum + in: path + schema: + type: integer + minimum: 1 + - name: Integer32WithMinimum + in: path + schema: + type: integer + format: int32 + minimum: 1 + - name: Integer64WithMinimum + in: path + schema: + type: integer + format: int364 + minimum: 1 + - name: NumberWithMinimum + in: path + schema: + type: number + minimum: 1 + - name: NumberFloatWithMinimum + in: path + schema: + type: number + format: float + minimum: 1 + - name: NumberDoubleWithMinimum + in: path + schema: + type: number + format: double + minimum: 1 + - name: IntegerWithMaximum + in: path + schema: + type: integer + maximum: 10 + - name: Integer32WithMaximum + in: path + schema: + type: integer + format: int32 + maximum: 10 + - name: Integer64WithMaximum + in: path + schema: + type: integer + format: int64 + maximum: 10 + - name: NumberWithMaximum + in: path + schema: + type: number + maximum: 10 + - name: NumberFloatWithMaximum + in: path + schema: + type: number + format: float + maximum: 10 + - name: NumberDoubleWithMaximum + in: path + schema: + type: number + format: double + maximum: 10 + - name: IntegerWithExclusiveMinimum + in: path + schema: + type: integer + minimum: 1 + exclusiveMinimum: true + - name: Integer32WithExclusiveMinimum + in: path + schema: + type: integer + format: int32 + minimum: 1 + exclusiveMinimum: true + - name: Integer64WithExclusiveMinimum + in: path + schema: + type: integer + format: int364 + minimum: 1 + exclusiveMinimum: true + - name: NumberWithExclusiveMinimum + in: path + schema: + type: number + minimum: 1 + exclusiveMinimum: true + - name: NumberFloatWithExclusiveMinimum + in: path + schema: + type: number + format: float + minimum: 1 + exclusiveMinimum: true + - name: NumberDoubleWithExclusiveMinimum + in: path + schema: + type: number + format: double + minimum: 1 + exclusiveMinimum: true + - name: IntegerWithExclusiveMaximum + in: path + schema: + type: integer + maximum: 10 + exclusiveMaximum: true + - name: Integer32WithExclusiveMaximum + in: path + schema: + type: integer + format: int32 + maximum: 10 + exclusiveMaximum: true + - name: Integer64WithExclusiveMaximum + in: path + schema: + type: integer + format: int64 + maximum: 10 + exclusiveMaximum: true + - name: NumberWithExclusiveMaximum + in: path + schema: + type: number + maximum: 10 + exclusiveMaximum: true + - name: NumberFloatWithExclusiveMaximum + in: path + schema: + type: number + format: float + maximum: 10 + exclusiveMaximum: true + - name: NumberDoubleWithExclusiveMaximum + in: path + schema: + type: number + format: double + maximum: 10 + exclusiveMaximum: true + requestBody: + content: + application/json: + schema: + type: string + required: true + responses: + 200: + description: success + content: + application/json: + schema: + type: string + /cookieParametersWithValidation: + post: + tags: + - isX + operationId: cookieParametersWithValidation + parameters: + - name: ArrayWithMaxItems + in: cookie + schema: + type: array + maxItems: 2 + items: + type: string + - name: ArrayWithMinItems + in: cookie + schema: + type: array + minItems: 2 + items: + type: string + - name: ArrayWithUniqueItems + in: cookie + schema: + type: array + uniqueItems: true + items: + type: string + - name: ObjectWithMinProperties + in: cookie + schema: + type: object + minProperties: 2 + - name: ObjectWithMaxProperties + in: cookie + schema: + type: object + maxProperties: 2 + - name: StringWithMinLength + in: cookie + schema: + type: string + minLength: 1 + - name: DateWithMinLength + in: cookie + schema: + type: string + format: date + minLength: 10 + - name: DateTimeWithMinLength + in: cookie + schema: + type: string + format: date-time + minLength: 20 + - name: ByteWithMinLength + in: cookie + schema: + type: string + format: byte + minLength: 10 + - name: BinaryWithMinLength + in: cookie + schema: + type: string + format: binary + minLength: 10 + - name: StringWithMaxLength + in: cookie + schema: + type: string + maxLength: 1 + - name: DateWithMaxLength + in: cookie + schema: + type: string + format: date + maxLength: 10 + - name: DateTimeWithMaxLength + in: cookie + schema: + type: string + format: date-time + maxLength: 20 + - name: ByteWithMaxLength + in: cookie + schema: + type: string + format: byte + maxLength: 10 + - name: BinaryWithMaxLength + in: cookie + schema: + type: string + format: binary + maxLength: 10 + - name: IntegerWithMultipleOf + in: cookie + schema: + type: integer + multipleOf: 2 + - name: Integer32WithMultipleOf + in: cookie + schema: + type: integer + format: int32 + multipleOf: 2 + - name: Integer64WithMultipleOf + in: cookie + schema: + type: integer + format: int64 + multipleOf: 2 + - name: NumberWithMultipleOf + in: cookie + schema: + type: number + multipleOf: 2 + - name: NumberFloatWithMultipleOf + in: cookie + schema: + type: number + format: float + multipleOf: 2 + - name: NumberDoubleWithMultipleOf + in: cookie + schema: + type: number + format: double + multipleOf: 2 + - name: StringWithPattern + in: cookie + schema: + type: string + pattern: '^2021.+' + - name: DateWithPattern + in: cookie + schema: + type: string + format: date + pattern: '^2021.+' + - name: DateTimeWithPattern + in: cookie + schema: + type: string + format: date-time + pattern: '^2021.+' + - name: ByteWithPattern + in: cookie + schema: + type: string + format: byte + pattern: '^2021.+' + - name: BinaryWithPattern + in: cookie + schema: + type: string + format: binary + pattern: '^2021.+' + - name: IntegerWithMinimum + in: cookie + schema: + type: integer + minimum: 1 + - name: Integer32WithMinimum + in: cookie + schema: + type: integer + format: int32 + minimum: 1 + - name: Integer64WithMinimum + in: cookie + schema: + type: integer + format: int364 + minimum: 1 + - name: NumberWithMinimum + in: cookie + schema: + type: number + minimum: 1 + - name: NumberFloatWithMinimum + in: cookie + schema: + type: number + format: float + minimum: 1 + - name: NumberDoubleWithMinimum + in: cookie + schema: + type: number + format: double + minimum: 1 + - name: IntegerWithMaximum + in: cookie + schema: + type: integer + maximum: 10 + - name: Integer32WithMaximum + in: cookie + schema: + type: integer + format: int32 + maximum: 10 + - name: Integer64WithMaximum + in: cookie + schema: + type: integer + format: int64 + maximum: 10 + - name: NumberWithMaximum + in: cookie + schema: + type: number + maximum: 10 + - name: NumberFloatWithMaximum + in: cookie + schema: + type: number + format: float + maximum: 10 + - name: NumberDoubleWithMaximum + in: cookie + schema: + type: number + format: double + maximum: 10 + - name: IntegerWithExclusiveMinimum + in: cookie + schema: + type: integer + minimum: 1 + exclusiveMinimum: true + - name: Integer32WithExclusiveMinimum + in: cookie + schema: + type: integer + format: int32 + minimum: 1 + exclusiveMinimum: true + - name: Integer64WithExclusiveMinimum + in: cookie + schema: + type: integer + format: int364 + minimum: 1 + exclusiveMinimum: true + - name: NumberWithExclusiveMinimum + in: cookie + schema: + type: number + minimum: 1 + exclusiveMinimum: true + - name: NumberFloatWithExclusiveMinimum + in: cookie + schema: + type: number + format: float + minimum: 1 + exclusiveMinimum: true + - name: NumberDoubleWithExclusiveMinimum + in: cookie + schema: + type: number + format: double + minimum: 1 + exclusiveMinimum: true + - name: IntegerWithExclusiveMaximum + in: cookie + schema: + type: integer + maximum: 10 + exclusiveMaximum: true + - name: Integer32WithExclusiveMaximum + in: cookie + schema: + type: integer + format: int32 + maximum: 10 + exclusiveMaximum: true + - name: Integer64WithExclusiveMaximum + in: cookie + schema: + type: integer + format: int64 + maximum: 10 + exclusiveMaximum: true + - name: NumberWithExclusiveMaximum + in: cookie + schema: + type: number + maximum: 10 + exclusiveMaximum: true + - name: NumberFloatWithExclusiveMaximum + in: cookie + schema: + type: number + format: float + maximum: 10 + exclusiveMaximum: true + - name: NumberDoubleWithExclusiveMaximum + in: cookie + schema: + type: number + format: double + maximum: 10 + exclusiveMaximum: true + requestBody: + content: + application/json: + schema: + type: string + required: true + responses: + 200: + description: success + content: + application/json: + schema: + type: string + /headerParametersWithValidation: + post: + tags: + - isX + operationId: headerParametersWithValidation + parameters: + - name: ArrayWithMaxItems + in: header + schema: + type: array + maxItems: 2 + items: + type: string + - name: ArrayWithMinItems + in: header + schema: + type: array + minItems: 2 + items: + type: string + - name: ArrayWithUniqueItems + in: header + schema: + type: array + uniqueItems: true + items: + type: string + - name: ObjectWithMinProperties + in: header + schema: + type: object + minProperties: 2 + - name: ObjectWithMaxProperties + in: header + schema: + type: object + maxProperties: 2 + - name: StringWithMinLength + in: header + schema: + type: string + minLength: 1 + - name: DateWithMinLength + in: header + schema: + type: string + format: date + minLength: 10 + - name: DateTimeWithMinLength + in: header + schema: + type: string + format: date-time + minLength: 20 + - name: ByteWithMinLength + in: header + schema: + type: string + format: byte + minLength: 10 + - name: BinaryWithMinLength + in: header + schema: + type: string + format: binary + minLength: 10 + - name: StringWithMaxLength + in: header + schema: + type: string + maxLength: 1 + - name: DateWithMaxLength + in: header + schema: + type: string + format: date + maxLength: 10 + - name: DateTimeWithMaxLength + in: header + schema: + type: string + format: date-time + maxLength: 20 + - name: ByteWithMaxLength + in: header + schema: + type: string + format: byte + maxLength: 10 + - name: BinaryWithMaxLength + in: header + schema: + type: string + format: binary + maxLength: 10 + - name: IntegerWithMultipleOf + in: header + schema: + type: integer + multipleOf: 2 + - name: Integer32WithMultipleOf + in: header + schema: + type: integer + format: int32 + multipleOf: 2 + - name: Integer64WithMultipleOf + in: header + schema: + type: integer + format: int64 + multipleOf: 2 + - name: NumberWithMultipleOf + in: header + schema: + type: number + multipleOf: 2 + - name: NumberFloatWithMultipleOf + in: header + schema: + type: number + format: float + multipleOf: 2 + - name: NumberDoubleWithMultipleOf + in: header + schema: + type: number + format: double + multipleOf: 2 + - name: StringWithPattern + in: header + schema: + type: string + pattern: '^2021.+' + - name: DateWithPattern + in: header + schema: + type: string + format: date + pattern: '^2021.+' + - name: DateTimeWithPattern + in: header + schema: + type: string + format: date-time + pattern: '^2021.+' + - name: ByteWithPattern + in: header + schema: + type: string + format: byte + pattern: '^2021.+' + - name: BinaryWithPattern + in: header + schema: + type: string + format: binary + pattern: '^2021.+' + - name: IntegerWithMinimum + in: header + schema: + type: integer + minimum: 1 + - name: Integer32WithMinimum + in: header + schema: + type: integer + format: int32 + minimum: 1 + - name: Integer64WithMinimum + in: header + schema: + type: integer + format: int364 + minimum: 1 + - name: NumberWithMinimum + in: header + schema: + type: number + minimum: 1 + - name: NumberFloatWithMinimum + in: header + schema: + type: number + format: float + minimum: 1 + - name: NumberDoubleWithMinimum + in: header + schema: + type: number + format: double + minimum: 1 + - name: IntegerWithMaximum + in: header + schema: + type: integer + maximum: 10 + - name: Integer32WithMaximum + in: header + schema: + type: integer + format: int32 + maximum: 10 + - name: Integer64WithMaximum + in: header + schema: + type: integer + format: int64 + maximum: 10 + - name: NumberWithMaximum + in: header + schema: + type: number + maximum: 10 + - name: NumberFloatWithMaximum + in: header + schema: + type: number + format: float + maximum: 10 + - name: NumberDoubleWithMaximum + in: header + schema: + type: number + format: double + maximum: 10 + - name: IntegerWithExclusiveMinimum + in: header + schema: + type: integer + minimum: 1 + exclusiveMinimum: true + - name: Integer32WithExclusiveMinimum + in: header + schema: + type: integer + format: int32 + minimum: 1 + exclusiveMinimum: true + - name: Integer64WithExclusiveMinimum + in: header + schema: + type: integer + format: int364 + minimum: 1 + exclusiveMinimum: true + - name: NumberWithExclusiveMinimum + in: header + schema: + type: number + minimum: 1 + exclusiveMinimum: true + - name: NumberFloatWithExclusiveMinimum + in: header + schema: + type: number + format: float + minimum: 1 + exclusiveMinimum: true + - name: NumberDoubleWithExclusiveMinimum + in: header + schema: + type: number + format: double + minimum: 1 + exclusiveMinimum: true + - name: IntegerWithExclusiveMaximum + in: header + schema: + type: integer + maximum: 10 + exclusiveMaximum: true + - name: Integer32WithExclusiveMaximum + in: header + schema: + type: integer + format: int32 + maximum: 10 + exclusiveMaximum: true + - name: Integer64WithExclusiveMaximum + in: header + schema: + type: integer + format: int64 + maximum: 10 + exclusiveMaximum: true + - name: NumberWithExclusiveMaximum + in: header + schema: + type: number + maximum: 10 + exclusiveMaximum: true + - name: NumberFloatWithExclusiveMaximum + in: header + schema: + type: number + format: float + maximum: 10 + exclusiveMaximum: true + - name: NumberDoubleWithExclusiveMaximum + in: header + schema: + type: number + format: double + maximum: 10 + exclusiveMaximum: true + requestBody: + content: + application/json: + schema: + type: string + required: true + responses: + 200: + description: success + content: + application/json: + schema: + type: string + /queryParametersWithValidation: + post: + tags: + - isX + operationId: queryParametersWithValidation + parameters: + - name: ArrayWithMaxItems + in: query + schema: + type: array + maxItems: 2 + items: + type: string + - name: ArrayWithMinItems + in: query + schema: + type: array + minItems: 2 + items: + type: string + - name: ArrayWithUniqueItems + in: query + schema: + type: array + uniqueItems: true + items: + type: string + - name: ObjectWithMinProperties + in: query + schema: + type: object + minProperties: 2 + - name: ObjectWithMaxProperties + in: query + schema: + type: object + maxProperties: 2 + - name: StringWithMinLength + in: query + schema: + type: string + minLength: 1 + - name: DateWithMinLength + in: query + schema: + type: string + format: date + minLength: 10 + - name: DateTimeWithMinLength + in: query + schema: + type: string + format: date-time + minLength: 20 + - name: ByteWithMinLength + in: query + schema: + type: string + format: byte + minLength: 10 + - name: BinaryWithMinLength + in: query + schema: + type: string + format: binary + minLength: 10 + - name: StringWithMaxLength + in: query + schema: + type: string + maxLength: 1 + - name: DateWithMaxLength + in: query + schema: + type: string + format: date + maxLength: 10 + - name: DateTimeWithMaxLength + in: query + schema: + type: string + format: date-time + maxLength: 20 + - name: ByteWithMaxLength + in: query + schema: + type: string + format: byte + maxLength: 10 + - name: BinaryWithMaxLength + in: query + schema: + type: string + format: binary + maxLength: 10 + - name: IntegerWithMultipleOf + in: query + schema: + type: integer + multipleOf: 2 + - name: Integer32WithMultipleOf + in: query + schema: + type: integer + format: int32 + multipleOf: 2 + - name: Integer64WithMultipleOf + in: query + schema: + type: integer + format: int64 + multipleOf: 2 + - name: NumberWithMultipleOf + in: query + schema: + type: number + multipleOf: 2 + - name: NumberFloatWithMultipleOf + in: query + schema: + type: number + format: float + multipleOf: 2 + - name: NumberDoubleWithMultipleOf + in: query + schema: + type: number + format: double + multipleOf: 2 + - name: StringWithPattern + in: query + schema: + type: string + pattern: '^2021.+' + - name: DateWithPattern + in: query + schema: + type: string + format: date + pattern: '^2021.+' + - name: DateTimeWithPattern + in: query + schema: + type: string + format: date-time + pattern: '^2021.+' + - name: ByteWithPattern + in: query + schema: + type: string + format: byte + pattern: '^2021.+' + - name: BinaryWithPattern + in: query + schema: + type: string + format: binary + pattern: '^2021.+' + - name: IntegerWithMinimum + in: query + schema: + type: integer + minimum: 1 + - name: Integer32WithMinimum + in: query + schema: + type: integer + format: int32 + minimum: 1 + - name: Integer64WithMinimum + in: query + schema: + type: integer + format: int364 + minimum: 1 + - name: NumberWithMinimum + in: query + schema: + type: number + minimum: 1 + - name: NumberFloatWithMinimum + in: query + schema: + type: number + format: float + minimum: 1 + - name: NumberDoubleWithMinimum + in: query + schema: + type: number + format: double + minimum: 1 + - name: IntegerWithMaximum + in: query + schema: + type: integer + maximum: 10 + - name: Integer32WithMaximum + in: query + schema: + type: integer + format: int32 + maximum: 10 + - name: Integer64WithMaximum + in: query + schema: + type: integer + format: int64 + maximum: 10 + - name: NumberWithMaximum + in: query + schema: + type: number + maximum: 10 + - name: NumberFloatWithMaximum + in: query + schema: + type: number + format: float + maximum: 10 + - name: NumberDoubleWithMaximum + in: query + schema: + type: number + format: double + maximum: 10 + - name: IntegerWithExclusiveMinimum + in: query + schema: + type: integer + minimum: 1 + exclusiveMinimum: true + - name: Integer32WithExclusiveMinimum + in: query + schema: + type: integer + format: int32 + minimum: 1 + exclusiveMinimum: true + - name: Integer64WithExclusiveMinimum + in: query + schema: + type: integer + format: int364 + minimum: 1 + exclusiveMinimum: true + - name: NumberWithExclusiveMinimum + in: query + schema: + type: number + minimum: 1 + exclusiveMinimum: true + - name: NumberFloatWithExclusiveMinimum + in: query + schema: + type: number + format: float + minimum: 1 + exclusiveMinimum: true + - name: NumberDoubleWithExclusiveMinimum + in: query + schema: + type: number + format: double + minimum: 1 + exclusiveMinimum: true + - name: IntegerWithExclusiveMaximum + in: query + schema: + type: integer + maximum: 10 + exclusiveMaximum: true + - name: Integer32WithExclusiveMaximum + in: query + schema: + type: integer + format: int32 + maximum: 10 + exclusiveMaximum: true + - name: Integer64WithExclusiveMaximum + in: query + schema: + type: integer + format: int64 + maximum: 10 + exclusiveMaximum: true + - name: NumberWithExclusiveMaximum + in: query + schema: + type: number + maximum: 10 + exclusiveMaximum: true + - name: NumberFloatWithExclusiveMaximum + in: query + schema: + type: number + format: float + maximum: 10 + exclusiveMaximum: true + - name: NumberDoubleWithExclusiveMaximum + in: query + schema: + type: number + format: double + maximum: 10 + exclusiveMaximum: true + requestBody: + content: + application/json: + schema: + type: string + required: true + responses: + 200: + description: success + content: + application/json: + schema: + type: string /ref_date_with_validation/{date}: post: tags: @@ -124,7 +2450,7 @@ paths: post: tags: - isX - operationId: null + operationId: 'null' parameters: - name: param in: path @@ -148,7 +2474,7 @@ paths: post: tags: - isX - operationId: null + operationId: refNull parameters: - name: param in: path @@ -170,6 +2496,409 @@ paths: $ref: '#/components/schemas/NullModel' components: schemas: + ArrayWithMaxItems: + type: array + maxItems: 2 + items: + type: string + ArrayWithMinItems: + type: array + minItems: 2 + items: + type: string + ArrayWithUniqueItems: + type: array + uniqueItems: true + items: + type: string + ObjectWithMinProperties: + type: object + minProperties: 2 + ObjectWithMaxProperties: + type: object + maxProperties: 2 + StringWithMinLength: + type: string + minLength: 1 + DateWithMinLength: + type: string + format: date + minLength: 10 + DateTimeWithMinLength: + type: string + format: date-time + minLength: 20 + ByteWithMinLength: + type: string + format: byte + minLength: 10 + BinaryWithMinLength: + type: string + format: binary + minLength: 10 + StringWithMaxLength: + type: string + maxLength: 1 + DateWithMaxLength: + type: string + format: date + maxLength: 10 + DateTimeWithMaxLength: + type: string + format: date-time + maxLength: 20 + ByteWithMaxLength: + type: string + format: byte + maxLength: 10 + BinaryWithMaxLength: + type: string + format: binary + maxLength: 10 + IntegerWithMultipleOf: + type: integer + multipleOf: 2 + Integer32WithMultipleOf: + type: integer + format: int32 + multipleOf: 2 + Integer64WithMultipleOf: + type: integer + format: int64 + multipleOf: 2 + NumberWithMultipleOf: + type: number + multipleOf: 2 + NumberFloatWithMultipleOf: + type: number + format: float + multipleOf: 2 + NumberDoubleWithMultipleOf: + type: number + format: double + multipleOf: 2 + StringWithPattern: + type: string + pattern: '^2021.+' + DateWithPattern: + type: string + format: date + pattern: '^2021.+' + DateTimeWithPattern: + type: string + format: date-time + pattern: '^2021.+' + ByteWithPattern: + type: string + format: byte + pattern: '^2021.+' + BinaryWithPattern: + type: string + format: binary + pattern: '^2021.+' + IntegerWithMinimum: + type: integer + minimum: 1 + Integer32WithMinimum: + type: integer + format: int32 + minimum: 1 + Integer64WithMinimum: + type: integer + format: int364 + minimum: 1 + NumberWithMinimum: + type: number + minimum: 1 + NumberFloatWithMinimum: + type: number + format: float + minimum: 1 + NumberDoubleWithMinimum: + type: number + format: double + minimum: 1 + IntegerWithMaximum: + type: integer + maximum: 10 + Integer32WithMaximum: + type: integer + format: int32 + maximum: 10 + Integer64WithMaximum: + type: integer + format: int64 + maximum: 10 + NumberWithMaximum: + type: number + maximum: 10 + NumberFloatWithMaximum: + type: number + format: float + maximum: 10 + NumberDoubleWithMaximum: + type: number + format: double + maximum: 10 + IntegerWithExclusiveMinimum: + type: integer + minimum: 1 + exclusiveMinimum: true + Integer32WithExclusiveMinimum: + type: integer + format: int32 + minimum: 1 + exclusiveMinimum: true + Integer64WithExclusiveMinimum: + type: integer + format: int364 + minimum: 1 + exclusiveMinimum: true + NumberWithExclusiveMinimum: + type: number + minimum: 1 + exclusiveMinimum: true + NumberFloatWithExclusiveMinimum: + type: number + format: float + minimum: 1 + exclusiveMinimum: true + NumberDoubleWithExclusiveMinimum: + type: number + format: double + minimum: 1 + exclusiveMinimum: true + IntegerWithExclusiveMaximum: + type: integer + maximum: 10 + exclusiveMaximum: true + Integer32WithExclusiveMaximum: + type: integer + format: int32 + maximum: 10 + exclusiveMaximum: true + Integer64WithExclusiveMaximum: + type: integer + format: int64 + maximum: 10 + exclusiveMaximum: true + NumberWithExclusiveMaximum: + type: number + maximum: 10 + exclusiveMaximum: true + NumberFloatWithExclusiveMaximum: + type: number + format: float + maximum: 10 + exclusiveMaximum: true + NumberDoubleWithExclusiveMaximum: + type: number + format: double + maximum: 10 + exclusiveMaximum: true + ObjectWithPropertiesThatHaveValidations: + type: object + properties: + ArrayWithMaxItems: + type: array + maxItems: 2 + items: + type: string + ArrayWithMinItems: + type: array + minItems: 2 + items: + type: string + ArrayWithUniqueItems: + type: array + uniqueItems: true + items: + type: string + ObjectWithMinProperties: + type: object + minProperties: 2 + ObjectWithMaxProperties: + type: object + maxProperties: 2 + StringWithMinLength: + type: string + minLength: 1 + DateWithMinLength: + type: string + format: date + minLength: 10 + DateTimeWithMinLength: + type: string + format: date-time + minLength: 20 + ByteWithMinLength: + type: string + format: byte + minLength: 10 + BinaryWithMinLength: + type: string + format: binary + minLength: 10 + StringWithMaxLength: + type: string + maxLength: 1 + DateWithMaxLength: + type: string + format: date + maxLength: 10 + DateTimeWithMaxLength: + type: string + format: date-time + maxLength: 20 + ByteWithMaxLength: + type: string + format: byte + maxLength: 10 + BinaryWithMaxLength: + type: string + format: binary + maxLength: 10 + IntegerWithMultipleOf: + type: integer + multipleOf: 2 + Integer32WithMultipleOf: + type: integer + format: int32 + multipleOf: 2 + Integer64WithMultipleOf: + type: integer + format: int64 + multipleOf: 2 + NumberWithMultipleOf: + type: number + multipleOf: 2 + NumberFloatWithMultipleOf: + type: number + format: float + multipleOf: 2 + NumberDoubleWithMultipleOf: + type: number + format: double + multipleOf: 2 + StringWithPattern: + type: string + pattern: '^2021.+' + DateWithPattern: + type: string + format: date + pattern: '^2021.+' + DateTimeWithPattern: + type: string + format: date-time + pattern: '^2021.+' + ByteWithPattern: + type: string + format: byte + pattern: '^2021.+' + BinaryWithPattern: + type: string + format: binary + pattern: '^2021.+' + IntegerWithMinimum: + type: integer + minimum: 1 + Integer32WithMinimum: + type: integer + format: int32 + minimum: 1 + Integer64WithMinimum: + type: integer + format: int364 + minimum: 1 + NumberWithMinimum: + type: number + minimum: 1 + NumberFloatWithMinimum: + type: number + format: float + minimum: 1 + NumberDoubleWithMinimum: + type: number + format: double + minimum: 1 + IntegerWithMaximum: + type: integer + maximum: 10 + Integer32WithMaximum: + type: integer + format: int32 + maximum: 10 + Integer64WithMaximum: + type: integer + format: int64 + maximum: 10 + NumberWithMaximum: + type: number + maximum: 10 + NumberFloatWithMaximum: + type: number + format: float + maximum: 10 + NumberDoubleWithMaximum: + type: number + format: double + maximum: 10 + IntegerWithExclusiveMinimum: + type: integer + minimum: 1 + exclusiveMinimum: true + Integer32WithExclusiveMinimum: + type: integer + format: int32 + minimum: 1 + exclusiveMinimum: true + Integer64WithExclusiveMinimum: + type: integer + format: int364 + minimum: 1 + exclusiveMinimum: true + NumberWithExclusiveMinimum: + type: number + minimum: 1 + exclusiveMinimum: true + NumberFloatWithExclusiveMinimum: + type: number + format: float + minimum: 1 + exclusiveMinimum: true + NumberDoubleWithExclusiveMinimum: + type: number + format: double + minimum: 1 + exclusiveMinimum: true + IntegerWithExclusiveMaximum: + type: integer + maximum: 10 + exclusiveMaximum: true + Integer32WithExclusiveMaximum: + type: integer + format: int32 + maximum: 10 + exclusiveMaximum: true + Integer64WithExclusiveMaximum: + type: integer + format: int64 + maximum: 10 + exclusiveMaximum: true + NumberWithExclusiveMaximum: + type: number + maximum: 10 + exclusiveMaximum: true + NumberFloatWithExclusiveMaximum: + type: number + format: float + maximum: 10 + exclusiveMaximum: true + NumberDoubleWithExclusiveMaximum: + type: number + format: double + maximum: 10 + exclusiveMaximum: true NullModel: type: 'null' ObjectWithTypeNullProperties: diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index 8211b6812a6..a729d26077b 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -40,6 +40,8 @@ paths: description: '' operationId: addPet responses: + '200': + description: Successful operation '405': description: Invalid input security: @@ -55,6 +57,8 @@ paths: description: '' operationId: updatePet responses: + '200': + description: Successful operation '400': description: Invalid ID supplied '404': @@ -197,6 +201,8 @@ paths: type: integer format: int64 responses: + '200': + description: Successful operation '405': description: Invalid input security: @@ -235,6 +241,8 @@ paths: type: integer format: int64 responses: + '200': + description: Successful operation '400': description: Invalid pet value security: diff --git a/modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml b/modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml index f059f8dba91..0bcea44a508 100644 --- a/modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml @@ -357,7 +357,6 @@ paths: responses: '200': description: Success - /repos/{repoId}: parameters: - in: path @@ -391,6 +390,51 @@ paths: responses: '200': description: Success + /one-of: + get: + responses: + '200': + description: Success + content: + application/json: + schema: + oneOf: + - type: integer + - type: array + items: + type: string + /any-of: + get: + parameters: + - name: any-of + in: query + description: list of any of objects + schema: + type: array + items: + $ref: '#/components/schemas/AnyOfObject' + minItems: 1 + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/AnyOfObject" + '201': + description: AlternateSuccess + content: + application/json: + schema: + $ref: "#/components/schemas/12345AnyOfObject" + '202': + description: AnyOfSuccess + content: + application/json: + schema: + anyOf: + - $ref: "#/components/schemas/StringObject" + - $ref: "#/components/schemas/UuidObject" /json-complex-query-param: get: parameters: @@ -418,6 +462,34 @@ components: test.read: Allowed to read state. test.write: Allowed to change state. schemas: + AnyOfProperty: + description: Test containing an anyOf object + properties: + requiredAnyOf: + $ref: '#/components/schemas/AnyOfObject' + optionalAnyOf: + $ref: '#/components/schemas/12345AnyOfObject' + required: + - requiredAnyOf + AnyOfObject: + description: Test a model containing an anyOf + anyOf: + - type: string + enum: + - FOO + - BAR + - type: string + description: Alternate option + 12345AnyOfObject: + description: Test a model containing an anyOf that starts with a number + anyOf: + - type: string + enum: + - FOO + - BAR + - "*" + - type: string + description: Alternate option EnumWithStarObject: description: Test a model containing a special character in the enum type: string diff --git a/pom.xml b/pom.xml index 9465b61375f..43e98418a20 100644 --- a/pom.xml +++ b/pom.xml @@ -1189,7 +1189,7 @@ samples/server/petstore/php-slim4 samples/server/petstore/php-laravel samples/server/petstore/php-lumen - + samples/server/petstore/rust-server @@ -1225,6 +1225,8 @@ samples/client/petstore/typescript-axios/tests/default samples/client/petstore/typescript-node/npm samples/client/petstore/typescript-rxjs/builds/with-npm-version + @@ -1443,17 +1445,18 @@ samples/client/petstore/swift5/rxswiftLibrary samples/client/petstore/swift5/urlsessionLibrary + + --> + @@ -257,15 +262,15 @@ jackson-databind ${jackson-databind-version} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-threetenbp-version} + + + com.github.scribejava + scribejava-core + ${scribejava-version} javax.annotation @@ -276,27 +281,45 @@ - junit - junit + ch.qos.logback + logback-classic + 1.2.3 + test + + + org.junit.jupiter + junit-jupiter ${junit-version} test - com.squareup.okhttp3 - mockwebserver - 3.6.0 + org.junit.jupiter + junit-jupiter-params + ${junit-version} test - org.assertj - assertj-core - 1.7.1 + org.hamcrest + hamcrest + 2.2 + test + + + com.github.tomakehurst + wiremock-jre8 + 2.27.2 + test + + + commons-io + commons-io + 2.8.0 test UTF-8 - 1.7 + 1.8 ${java.version} ${java.version} 1.5.24 @@ -306,8 +329,8 @@ 2.10.3 2.9.10 1.3.2 - 4.13.1 + 5.7.0 1.0.0 - 1.0.1 + 8.0.0 diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java index 69315cfc70c..8dd14bf1a27 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/ApiClient.java @@ -2,11 +2,11 @@ package org.openapitools.client; import java.util.LinkedHashMap; import java.util.Map; - -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; +import java.util.logging.Level; +import java.util.logging.Logger; import org.threeten.bp.*; +import feign.okhttp.OkHttpClient; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; @@ -24,6 +24,8 @@ import org.openapitools.client.auth.OAuth.AccessTokenListener; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiClient { + private static final Logger log = Logger.getLogger(ApiClient.class.getName()); + public interface Api {} protected ObjectMapper objectMapper; @@ -35,6 +37,7 @@ public class ApiClient { objectMapper = createObjectMapper(); apiAuthorizations = new LinkedHashMap(); feignBuilder = Feign.builder() + .client(new OkHttpClient()) .encoder(new FormEncoder(new JacksonEncoder(objectMapper))) .decoder(new JacksonDecoder(objectMapper)) .logger(new Slf4jLogger()); @@ -43,6 +46,7 @@ public class ApiClient { public ApiClient(String[] authNames) { this(); for(String authName : authNames) { + log.log(Level.FINE, "Creating authentication {0}", authName); RequestInterceptor auth; if ("api_key".equals(authName)) { auth = new ApiKeyAuth("header", "api_key"); @@ -51,7 +55,7 @@ public class ApiClient { } else if ("http_basic_test".equals(authName)) { auth = new HttpBasicAuth(); } else if ("petstore_auth".equals(authName)) { - auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); + auth = buildOauthRequestInterceptor(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } @@ -77,34 +81,6 @@ public class ApiClient { this.setApiKey(apiKey); } - /** - * Helper constructor for single basic auth or password oauth2 - * @param authName - * @param username - * @param password - */ - public ApiClient(String authName, String username, String password) { - this(authName); - this.setCredentials(username, password); - } - - /** - * Helper constructor for single password oauth2 - * @param authName - * @param clientId - * @param secret - * @param username - * @param password - */ - public ApiClient(String authName, String clientId, String secret, String username, String password) { - this(authName); - this.getTokenEndPoint() - .setClientId(clientId) - .setClientSecret(secret) - .setUsername(username) - .setPassword(password); - } - public String getBasePath() { return basePath; } @@ -147,10 +123,25 @@ public class ApiClient { return objectMapper; } + private RequestInterceptor buildOauthRequestInterceptor(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { + switch (flow) { + case password: + return new OauthPasswordGrant(tokenUrl, scopes); + case application: + return new OauthClientCredentialsGrant(authorizationUrl, tokenUrl, scopes); + default: + throw new RuntimeException("Oauth flow \"" + flow + "\" is not implemented"); + } + } + public ObjectMapper getObjectMapper(){ return objectMapper; } + public void setObjectMapper(ObjectMapper objectMapper) { + this.objectMapper = objectMapper; + } + /** * Creates a feign client for given API interface. * @@ -197,19 +188,13 @@ public class ApiClient { return contentTypes[0]; } - /** * Helper method to configure the bearer token. * @param bearerToken the bearer token. */ public void setBearerToken(String bearerToken) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof HttpBearerAuth) { - ((HttpBearerAuth) apiAuthorization).setBearerToken(bearerToken); - return; - } - } - throw new RuntimeException("No Bearer authentication configured!"); + HttpBearerAuth apiAuthorization = getAuthorization(HttpBearerAuth.class); + apiAuthorization.setBearerToken(bearerToken); } /** @@ -217,63 +202,38 @@ public class ApiClient { * @param apiKey API key */ public void setApiKey(String apiKey) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof ApiKeyAuth) { - ApiKeyAuth keyAuth = (ApiKeyAuth) apiAuthorization; - keyAuth.setApiKey(apiKey); - return ; - } - } - throw new RuntimeException("No API key authentication configured!"); + ApiKeyAuth apiAuthorization = getAuthorization(ApiKeyAuth.class); + apiAuthorization.setApiKey(apiKey); } /** - * Helper method to configure the username/password for basic auth or password OAuth + * Helper method to configure the username/password for basic auth * @param username Username * @param password Password */ public void setCredentials(String username, String password) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof HttpBasicAuth) { - HttpBasicAuth basicAuth = (HttpBasicAuth) apiAuthorization; - basicAuth.setCredentials(username, password); - return; - } - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.getTokenRequestBuilder().setUsername(username).setPassword(password); - return; - } - } - throw new RuntimeException("No Basic authentication or OAuth configured!"); + HttpBasicAuth apiAuthorization = getAuthorization(HttpBasicAuth.class); + apiAuthorization.setCredentials(username, password); } /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder + * Helper method to configure the client credentials for Oauth + * @param username Username + * @param password Password */ - public TokenRequestBuilder getTokenEndPoint() { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - return oauth.getTokenRequestBuilder(); - } - } - return null; + public void setClientCredentials(String clientId, String clientSecret) { + OauthClientCredentialsGrant authorization = getAuthorization(OauthClientCredentialsGrant.class); + authorization.configure(clientId, clientSecret); } /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder + * Helper method to configure the username/password for Oauth password grant + * @param username Username + * @param password Password */ - public AuthenticationRequestBuilder getAuthorizationEndPoint() { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - return oauth.getAuthenticationRequestBuilder(); - } - } - return null; + public void setOauthPassword(String username, String password, String clientId, String clientSecret) { + OauthPasswordGrant apiAuthorization = getAuthorization(OauthPasswordGrant.class); + apiAuthorization.configure(username, password, clientId, clientSecret); } /** @@ -281,14 +241,9 @@ public class ApiClient { * @param accessToken Access Token * @param expiresIn Validity period in seconds */ - public void setAccessToken(String accessToken, Long expiresIn) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.setAccessToken(accessToken, expiresIn); - return; - } - } + public void setAccessToken(String accessToken, Integer expiresIn) { + OAuth apiAuthorization = getAuthorization(OAuth.class); + apiAuthorization.setAccessToken(accessToken, expiresIn); } /** @@ -298,19 +253,7 @@ public class ApiClient { * @param redirectURI Redirect URI */ public void configureAuthorizationFlow(String clientId, String clientSecret, String redirectURI) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.getTokenRequestBuilder() - .setClientId(clientId) - .setClientSecret(clientSecret) - .setRedirectURI(redirectURI); - oauth.getAuthenticationRequestBuilder() - .setClientId(clientId) - .setRedirectURI(redirectURI); - return; - } - } + throw new RuntimeException("Not implemented"); } /** @@ -318,13 +261,8 @@ public class ApiClient { * @param accessTokenListener Acesss token listener */ public void registerAccessTokenListener(AccessTokenListener accessTokenListener) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.registerAccessTokenListener(accessTokenListener); - return; - } - } + OAuth apiAuthorization = getAuthorization(OAuth.class); + apiAuthorization.registerAccessTokenListener(accessTokenListener); } /** @@ -349,4 +287,11 @@ public class ApiClient { feignBuilder.requestInterceptor(authorization); } + private T getAuthorization(Class type) { + return (T) apiAuthorizations.values() + .stream() + .filter(requestInterceptor -> type.isAssignableFrom(requestInterceptor.getClass())) + .findFirst() + .orElseThrow(() -> new RuntimeException("No Oauth authentication or OAuth configured!")); + } } diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/DefaultApi20Impl.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/DefaultApi20Impl.java new file mode 100644 index 00000000000..80db21111f9 --- /dev/null +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/DefaultApi20Impl.java @@ -0,0 +1,47 @@ +package org.openapitools.client.auth; + +import com.github.scribejava.core.builder.api.DefaultApi20; +import com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor; +import com.github.scribejava.core.extractors.TokenExtractor; +import com.github.scribejava.core.model.OAuth2AccessToken; +import com.github.scribejava.core.oauth2.bearersignature.BearerSignature; +import com.github.scribejava.core.oauth2.bearersignature.BearerSignatureURIQueryParameter; +import com.github.scribejava.core.oauth2.clientauthentication.ClientAuthentication; +import com.github.scribejava.core.oauth2.clientauthentication.RequestBodyAuthenticationScheme; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DefaultApi20Impl extends DefaultApi20 { + + private final String accessTokenEndpoint; + private final String authorizationBaseUrl; + + protected DefaultApi20Impl(String authorizationBaseUrl, String accessTokenEndpoint) { + this.authorizationBaseUrl = authorizationBaseUrl; + this.accessTokenEndpoint = accessTokenEndpoint; + } + + @Override + public String getAccessTokenEndpoint() { + return accessTokenEndpoint; + } + + @Override + protected String getAuthorizationBaseUrl() { + return authorizationBaseUrl; + } + + @Override + public BearerSignature getBearerSignature() { + return BearerSignatureURIQueryParameter.instance(); + } + + @Override + public ClientAuthentication getClientAuthentication() { + return RequestBodyAuthenticationScheme.instance(); + } + + @Override + public TokenExtractor getAccessTokenExtractor() { + return OAuth2AccessTokenJsonExtractor.instance(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OAuth.java index f59ad4a94ba..d41eca7a0a5 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OAuth.java @@ -1,198 +1,81 @@ package org.openapitools.client.auth; -import java.io.IOException; -import java.util.Collection; -import java.util.Map; -import java.util.Map.Entry; - -import org.apache.oltu.oauth2.client.HttpClient; -import org.apache.oltu.oauth2.client.OAuthClient; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.client.response.OAuthClientResponse; -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory; -import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; -import org.apache.oltu.oauth2.common.message.types.GrantType; -import org.apache.oltu.oauth2.common.token.BasicOAuthToken; - -import feign.Client; +import com.github.scribejava.core.model.OAuth2AccessToken; +import com.github.scribejava.core.oauth.OAuth20Service; import feign.Request.HttpMethod; -import feign.Request.Options; import feign.RequestInterceptor; import feign.RequestTemplate; -import feign.Response; import feign.RetryableException; -import feign.Util; -import org.openapitools.client.StringUtil; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class OAuth implements RequestInterceptor { -public class OAuth implements RequestInterceptor { + static final int MILLIS_PER_SECOND = 1000; - static final int MILLIS_PER_SECOND = 1000; + public interface AccessTokenListener { + void notify(OAuth2AccessToken token); + } - public interface AccessTokenListener { - void notify(BasicOAuthToken token); + private volatile String accessToken; + private Long expirationTimeMillis; + private AccessTokenListener accessTokenListener; + + protected OAuth20Service service; + protected String scopes; + protected String authorizationUrl; + protected String tokenUrl; + + public OAuth(String authorizationUrl, String tokenUrl, String scopes) { + this.scopes = scopes; + this.authorizationUrl = authorizationUrl; + this.tokenUrl = tokenUrl; + } + + @Override + public void apply(RequestTemplate template) { + // If the request already have an authorization (eg. Basic auth), do nothing + if (template.headers().containsKey("Authorization")) { + return; } - - private volatile String accessToken; - private Long expirationTimeMillis; - private OAuthClient oauthClient; - private TokenRequestBuilder tokenRequestBuilder; - private AuthenticationRequestBuilder authenticationRequestBuilder; - private AccessTokenListener accessTokenListener; - - public OAuth(Client client, TokenRequestBuilder requestBuilder) { - this.oauthClient = new OAuthClient(new OAuthFeignClient(client)); - this.tokenRequestBuilder = requestBuilder; + // If first time, get the token + if (expirationTimeMillis == null || System.currentTimeMillis() >= expirationTimeMillis) { + updateAccessToken(template); } - - public OAuth(Client client, OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { - this(client, OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes)); - - switch(flow) { - case accessCode: - case implicit: - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); - break; - case password: - tokenRequestBuilder.setGrantType(GrantType.PASSWORD); - break; - case application: - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); - break; - default: - break; - } - authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl); + if (getAccessToken() != null) { + template.header("Authorization", "Bearer " + getAccessToken()); } + } - public OAuth(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { - this(new Client.Default(null, null), flow, authorizationUrl, tokenUrl, scopes); + private synchronized void updateAccessToken(RequestTemplate template) { + OAuth2AccessToken accessTokenResponse; + try { + accessTokenResponse = getOAuth2AccessToken(); + } catch (Exception e) { + throw new RetryableException(0, e.getMessage(), HttpMethod.POST, e, null, template.request()); } - - @Override - public void apply(RequestTemplate template) { - // If the request already have an authorization (eg. Basic auth), do nothing - if (template.headers().containsKey("Authorization")) { - return; - } - // If first time, get the token - if (expirationTimeMillis == null || System.currentTimeMillis() >= expirationTimeMillis) { - updateAccessToken(template); - } - if (getAccessToken() != null) { - template.header("Authorization", "Bearer " + getAccessToken()); - } + if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { + setAccessToken(accessTokenResponse.getAccessToken(), accessTokenResponse.getExpiresIn()); + if (accessTokenListener != null) { + accessTokenListener.notify(accessTokenResponse); + } } + } - public synchronized void updateAccessToken(RequestTemplate template) { - OAuthJSONAccessTokenResponse accessTokenResponse; - try { - accessTokenResponse = oauthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); - } catch (Exception e) { - throw new RetryableException(0, e.getMessage(), HttpMethod.POST, e, null, template.request()); - } - if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { - setAccessToken(accessTokenResponse.getAccessToken(), accessTokenResponse.getExpiresIn()); - if (accessTokenListener != null) { - accessTokenListener.notify((BasicOAuthToken) accessTokenResponse.getOAuthToken()); - } - } - } + abstract OAuth2AccessToken getOAuth2AccessToken(); - public synchronized void registerAccessTokenListener(AccessTokenListener accessTokenListener) { - this.accessTokenListener = accessTokenListener; - } + abstract OAuthFlow getFlow(); - public synchronized String getAccessToken() { - return accessToken; - } + public synchronized void registerAccessTokenListener(AccessTokenListener accessTokenListener) { + this.accessTokenListener = accessTokenListener; + } - public synchronized void setAccessToken(String accessToken, Long expiresIn) { - this.accessToken = accessToken; - this.expirationTimeMillis = expiresIn == null ? null : System.currentTimeMillis() + expiresIn * MILLIS_PER_SECOND; - } + public synchronized String getAccessToken() { + return accessToken; + } - public TokenRequestBuilder getTokenRequestBuilder() { - return tokenRequestBuilder; - } + public synchronized void setAccessToken(String accessToken, Integer expiresIn) { + this.accessToken = accessToken; + this.expirationTimeMillis = expiresIn == null ? null : System.currentTimeMillis() + expiresIn * MILLIS_PER_SECOND; + } - public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { - this.tokenRequestBuilder = tokenRequestBuilder; - } - - public AuthenticationRequestBuilder getAuthenticationRequestBuilder() { - return authenticationRequestBuilder; - } - - public void setAuthenticationRequestBuilder(AuthenticationRequestBuilder authenticationRequestBuilder) { - this.authenticationRequestBuilder = authenticationRequestBuilder; - } - - public OAuthClient getOauthClient() { - return oauthClient; - } - - public void setOauthClient(OAuthClient oauthClient) { - this.oauthClient = oauthClient; - } - - public void setOauthClient(Client client) { - this.oauthClient = new OAuthClient( new OAuthFeignClient(client)); - } - - public static class OAuthFeignClient implements HttpClient { - - private Client client; - - public OAuthFeignClient() { - this.client = new Client.Default(null, null); - } - - public OAuthFeignClient(Client client) { - this.client = client; - } - - public T execute(OAuthClientRequest request, Map headers, - String requestMethod, Class responseClass) - throws OAuthSystemException, OAuthProblemException { - - RequestTemplate req = new RequestTemplate() - .append(request.getLocationUri()) - .method(requestMethod) - .body(request.getBody()); - - for (Entry entry : headers.entrySet()) { - req.header(entry.getKey(), entry.getValue()); - } - Response feignResponse; - String body = ""; - try { - feignResponse = client.execute(req.request(), new Options()); - body = Util.toString(feignResponse.body().asReader()); - } catch (IOException e) { - throw new OAuthSystemException(e); - } - - String contentType = null; - Collection contentTypeHeader = feignResponse.headers().get("Content-Type"); - if(contentTypeHeader != null) { - contentType = StringUtil.join(contentTypeHeader.toArray(new String[0]), ";"); - } - - return OAuthClientResponseFactory.createCustomResponse( - body, - contentType, - feignResponse.status(), - responseClass - ); - } - - public void shutdown() { - // Nothing to do here - } - } -} +} \ No newline at end of file diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OAuthFlow.java index b2d11ff0c4f..75c2a0c9740 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -13,6 +13,10 @@ package org.openapitools.client.auth; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public enum OAuthFlow { - accessCode, implicit, password, application + accessCode, //called authorizationCode in OpenAPI 3.0 + implicit, + password, + application //called clientCredentials in OpenAPI 3.0 } diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OauthClientCredentialsGrant.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OauthClientCredentialsGrant.java new file mode 100644 index 00000000000..a21c5a15ba2 --- /dev/null +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OauthClientCredentialsGrant.java @@ -0,0 +1,39 @@ +package org.openapitools.client.auth; + +import com.github.scribejava.core.builder.ServiceBuilder; +import com.github.scribejava.core.model.OAuth2AccessToken; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OauthClientCredentialsGrant extends OAuth { + + public OauthClientCredentialsGrant(String authorizationUrl, String tokenUrl, String scopes) { + super(authorizationUrl, tokenUrl, scopes); + } + + @Override + protected OAuth2AccessToken getOAuth2AccessToken() { + try { + return service.getAccessTokenClientCredentialsGrant(scopes); + } catch (Exception e) { + throw new RuntimeException("Failed to get oauth token", e); + } + } + + @Override + protected OAuthFlow getFlow() { + return OAuthFlow.application; + } + + /** + * Configures the client credentials flow + * + * @param clientId + * @param clientSecret + */ + public void configure(String clientId, String clientSecret) { + service = new ServiceBuilder(clientId) + .apiSecret(clientSecret) + .defaultScope(scopes) + .build(new DefaultApi20Impl(authorizationUrl, tokenUrl)); + } +} diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OauthPasswordGrant.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OauthPasswordGrant.java new file mode 100644 index 00000000000..dba4fb3a076 --- /dev/null +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/auth/OauthPasswordGrant.java @@ -0,0 +1,48 @@ +package org.openapitools.client.auth; + +import com.github.scribejava.core.builder.ServiceBuilder; +import com.github.scribejava.core.model.OAuth2AccessToken; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OauthPasswordGrant extends OAuth { + + private String username; + private String password; + + public OauthPasswordGrant(String tokenUrl, String scopes) { + super(null, tokenUrl, scopes); + } + + @Override + protected OAuth2AccessToken getOAuth2AccessToken() { + try { + return service.getAccessTokenPasswordGrant(username, password); + } catch (Exception e) { + throw new RuntimeException("Failed to get oauth token", e); + } + } + + @Override + protected OAuthFlow getFlow() { + return OAuthFlow.password; + } + + /** + * Configures Oauth password grant flow + * Note: this flow is deprecated. + * + * @param username + * @param password + * @param clientId + * @param clientSecret + */ + public void configure(String username, String password, String clientId, String clientSecret) { + this.username = username; + this.password = password; + //TODO the clientId and secret are optional according with the RFC + service = new ServiceBuilder(clientId) + .apiSecret(clientSecret) + .defaultScope(scopes) + .build(new DefaultApi20Impl(authorizationUrl, tokenUrl)); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 35291f77588..a8dd7c58542 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 5eff7572b0d..f7fcf4a291b 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -84,7 +84,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index d597dd1630b..99a88cd1581 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index e5d48f8135e..e83db349660 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -448,7 +448,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index ff79c51f577..f1dd62e5c74 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 0cb4fd19e2c..aff8f783078 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -84,7 +84,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 607e3047e1c..0c6a900ce28 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 4286945ddac..6333987f289 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java index 2a5284c7716..1bb1c9298a3 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java @@ -121,7 +121,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 475b8f3b19d..a2ea07d623b 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -91,7 +91,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index b94aa84873c..5609a835fd8 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -91,7 +91,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java index 371ead4207d..5a9e42b6d93 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -167,7 +167,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java index 11ce6fe9c09..03ff293e401 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java @@ -126,7 +126,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java index d82d3df41e8..3cef5febef3 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -119,7 +119,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java index 3ca37a5e47c..ef186a2e97c 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java @@ -230,7 +230,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java index 6cec9d1b43f..cca206467ad 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Cat.java @@ -91,7 +91,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java index cf5823325de..f0cdb0f6159 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -80,7 +80,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java index 1467fa503e6..359a9f4a243 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Category.java @@ -109,7 +109,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java index 40588ad2b81..41569c56c9c 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java @@ -81,7 +81,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java index bbc7b5c9758..38c477e8c1e 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Client.java @@ -80,7 +80,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java index 889c1e027a3..43a9f588029 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Dog.java @@ -87,7 +87,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java index f60b056ec92..bbdcbc1aae5 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -80,7 +80,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java index c58efb04291..e059f49ecf6 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -190,7 +190,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java index 683c8324ef2..3e36db5c091 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java @@ -344,7 +344,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 956d66a44ea..39b06092102 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -120,7 +120,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java index 065ce291ef0..10032cbed10 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java @@ -481,7 +481,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 5ee6e2cce6a..914a835ad26 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -92,7 +92,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java index b8002359f63..46d5b280791 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java @@ -240,7 +240,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 838311fb01b..fbbebaac921 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -154,7 +154,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java index 7cd85a2f2f4..b870f8b54b5 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java @@ -111,7 +111,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 672705a3ff3..bbadab2fa59 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -140,7 +140,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java index 63dda6b56fd..67594de5d36 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -81,7 +81,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java index 36fd65abcfd..cb3b9b79da2 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java @@ -152,7 +152,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java index ba38e9ded85..7b6c81ff914 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -81,7 +81,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java index e4da62890a7..fbed4fcc01d 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java @@ -268,7 +268,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java index 19e4f97a067..c530d9042e8 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -141,7 +141,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java index 5080f9b0a78..437e50270da 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java @@ -284,7 +284,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 968b338e1b1..5a9f090b3d5 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -101,7 +101,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java index adae4f49b52..40b1a7473c5 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -80,7 +80,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java index 386811f1beb..217878aaf6a 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java @@ -110,7 +110,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index c07109fea75..584ea0d2a83 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -203,7 +203,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java index b4eaa509eee..bd3f9d00254 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -232,7 +232,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java index 1a67b413f66..015e03770e5 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java @@ -290,7 +290,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java index af4c426b8f8..129b988ca29 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java @@ -995,7 +995,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/.openapi-generator/FILES b/samples/client/petstore/java/feign/.openapi-generator/FILES index 1e341310444..cd394fffa07 100644 --- a/samples/client/petstore/java/feign/.openapi-generator/FILES +++ b/samples/client/petstore/java/feign/.openapi-generator/FILES @@ -28,10 +28,13 @@ src/main/java/org/openapitools/client/api/PetApi.java src/main/java/org/openapitools/client/api/StoreApi.java src/main/java/org/openapitools/client/api/UserApi.java src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/DefaultApi20Impl.java src/main/java/org/openapitools/client/auth/HttpBasicAuth.java src/main/java/org/openapitools/client/auth/HttpBearerAuth.java src/main/java/org/openapitools/client/auth/OAuth.java src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/auth/OauthClientCredentialsGrant.java +src/main/java/org/openapitools/client/auth/OauthPasswordGrant.java src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java diff --git a/samples/client/petstore/java/feign/README.md b/samples/client/petstore/java/feign/README.md index 646dfdc4e2b..fa5dd565da4 100644 --- a/samples/client/petstore/java/feign/README.md +++ b/samples/client/petstore/java/feign/README.md @@ -32,6 +32,41 @@ After the client library is installed/deployed, you can use it in your Maven pro ``` +And to use the api you can follow the examples bellow: + +```java + + //Set bearer token manually + ApiClient apiClient = new ApiClient("petstore_auth_client"); + apiClient.setBasePath("https://localhost:8243/petstore/1/"); + apiClient.setAccessToken("TOKEN", 10000); + + //Use api key + ApiClient apiClient = new ApiClient("api_key", "API KEY"); + apiClient.setBasePath("https://localhost:8243/petstore/1/"); + + //Use http basic authentication + ApiClient apiClient = new ApiClient("basicAuth"); + apiClient.setBasePath("https://localhost:8243/petstore/1/"); + apiClient.setCredentials("username", "password"); + + //Oauth password + ApiClient apiClient = new ApiClient("oauth_password"); + apiClient.setBasePath("https://localhost:8243/petstore/1/"); + apiClient.setOauthPassword("username", "password", "client_id", "client_secret"); + + //Oauth client credentials flow + ApiClient apiClient = new ApiClient("oauth_client_credentials"); + apiClient.setBasePath("https://localhost:8243/petstore/1/"); + apiClient.setClientCredentials("client_id", "client_secret"); + + PetApi petApi = apiClient.buildClient(PetApi.class); + Pet petById = petApi.getPetById(12345L); + + System.out.println(petById); + } +``` + ## Recommendation It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. @@ -40,4 +75,3 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea - diff --git a/samples/client/petstore/java/feign/build.gradle b/samples/client/petstore/java/feign/build.gradle index 8e51bb4bfd9..394cdda63a9 100644 --- a/samples/client/petstore/java/feign/build.gradle +++ b/samples/client/petstore/java/feign/build.gradle @@ -33,8 +33,8 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } // Rename the aar correctly @@ -79,8 +79,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 install { repositories.mavenInstaller { @@ -94,6 +94,10 @@ if(hasProperty('target') && target == 'android') { } } +test { + useJUnitPlatform() +} + ext { swagger_annotations_version = "1.5.24" jackson_version = "2.10.3" @@ -102,8 +106,8 @@ ext { jackson_threetenbp_version = "2.9.10" feign_version = "10.11" feign_form_version = "3.8.0" - junit_version = "4.13.1" - oltu_version = "1.0.1" + junit_version = "5.7.0" + scribejava_version = "8.0.0" } dependencies { @@ -112,14 +116,22 @@ dependencies { implementation "io.github.openfeign:feign-core:$feign_version" implementation "io.github.openfeign:feign-jackson:$feign_version" implementation "io.github.openfeign:feign-slf4j:$feign_version" + implementation "io.github.openfeign:feign-okhttp:$feign_version" implementation "io.github.openfeign.form:feign-form:$feign_form_version" implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_threetenbp_version" - implementation "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" + implementation "com.brsanthu:migbase64:2.2" + implementation "com.github.scribejava:scribejava-core:$scribejava_version" implementation "com.brsanthu:migbase64:2.2" implementation 'javax.annotation:javax.annotation-api:1.3.2' - testImplementation "junit:junit:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" + testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version" + testImplementation "com.github.tomakehurst:wiremock-jre8:2.27.2" + testImplementation "org.hamcrest:hamcrest:2.2" + testImplementation "commons-io:commons-io:2.8.0" + testImplementation "ch.qos.logback:logback-classic:1.2.3" } diff --git a/samples/client/petstore/java/feign/build.sbt b/samples/client/petstore/java/feign/build.sbt index 1af0ed0153a..5f999c727fe 100644 --- a/samples/client/petstore/java/feign/build.sbt +++ b/samples/client/petstore/java/feign/build.sbt @@ -10,19 +10,25 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.5.24" % "compile", + "com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile", "io.github.openfeign" % "feign-core" % "10.11" % "compile", "io.github.openfeign" % "feign-jackson" % "10.11" % "compile", "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.10.3" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.10" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", + "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", "javax.annotation" % "javax.annotation-api" % "1.3.2" % "compile", - "junit" % "junit" % "4.13.1" % "test", + "org.junit.jupiter" % "junit-jupiter" % "5.7.0" % "test", + "org.junit.jupiter" % "junit-jupiter-params" % "5.7.0" % "test", + "com.github.tomakehurst" % "wiremock-jre8" % "2.27.2" % "test", + "org.hamcrest" % "hamcrest" % "2.2" % "test", + "commons-io" % "commons-io" % "2.8.0" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) ) diff --git a/samples/client/petstore/java/feign/feign10x/api/openapi.yaml b/samples/client/petstore/java/feign/feign10x/api/openapi.yaml index a49359fd348..00cc0f2f4c2 100644 --- a/samples/client/petstore/java/feign/feign10x/api/openapi.yaml +++ b/samples/client/petstore/java/feign/feign10x/api/openapi.yaml @@ -2151,10 +2151,12 @@ components: properties: breed: type: string + type: object Cat_allOf: properties: declawed: type: boolean + type: object BigCat_allOf: properties: kind: @@ -2164,6 +2166,7 @@ components: - leopards - jaguars type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index b7a9b1f4be8..a963eaf0d20 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -154,7 +154,7 @@ 3.1.1 none - 1.7 + 1.8 @@ -240,6 +240,11 @@ feign-form ${feign-form-version} + + io.github.openfeign + feign-okhttp + ${feign-version} + @@ -262,15 +267,15 @@ jackson-databind-nullable ${jackson-databind-nullable-version} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-threetenbp-version} + + + com.github.scribejava + scribejava-core + ${scribejava-version} javax.annotation @@ -281,27 +286,45 @@ - junit - junit + ch.qos.logback + logback-classic + 1.2.3 + test + + + org.junit.jupiter + junit-jupiter ${junit-version} test - com.squareup.okhttp3 - mockwebserver - 3.6.0 + org.junit.jupiter + junit-jupiter-params + ${junit-version} test - org.assertj - assertj-core - 1.7.1 + org.hamcrest + hamcrest + 2.2 + test + + + com.github.tomakehurst + wiremock-jre8 + 2.27.2 + test + + + commons-io + commons-io + 2.8.0 test UTF-8 - 1.7 + 1.8 ${java.version} ${java.version} 1.5.24 @@ -312,8 +335,8 @@ 2.10.3 2.9.10 1.3.2 - 4.13.1 + 5.7.0 1.0.0 - 1.0.1 + 8.0.0 diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java index 4e256daf6b2..118b665aeaf 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/ApiClient.java @@ -2,11 +2,11 @@ package org.openapitools.client; import java.util.LinkedHashMap; import java.util.Map; - -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; +import java.util.logging.Level; +import java.util.logging.Logger; import org.threeten.bp.*; +import feign.okhttp.OkHttpClient; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; @@ -25,6 +25,8 @@ import org.openapitools.client.auth.OAuth.AccessTokenListener; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiClient { + private static final Logger log = Logger.getLogger(ApiClient.class.getName()); + public interface Api {} protected ObjectMapper objectMapper; @@ -36,6 +38,7 @@ public class ApiClient { objectMapper = createObjectMapper(); apiAuthorizations = new LinkedHashMap(); feignBuilder = Feign.builder() + .client(new OkHttpClient()) .encoder(new FormEncoder(new JacksonEncoder(objectMapper))) .decoder(new JacksonDecoder(objectMapper)) .logger(new Slf4jLogger()); @@ -44,6 +47,7 @@ public class ApiClient { public ApiClient(String[] authNames) { this(); for(String authName : authNames) { + log.log(Level.FINE, "Creating authentication {0}", authName); RequestInterceptor auth; if ("api_key".equals(authName)) { auth = new ApiKeyAuth("header", "api_key"); @@ -52,7 +56,7 @@ public class ApiClient { } else if ("http_basic_test".equals(authName)) { auth = new HttpBasicAuth(); } else if ("petstore_auth".equals(authName)) { - auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); + auth = buildOauthRequestInterceptor(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } @@ -78,34 +82,6 @@ public class ApiClient { this.setApiKey(apiKey); } - /** - * Helper constructor for single basic auth or password oauth2 - * @param authName - * @param username - * @param password - */ - public ApiClient(String authName, String username, String password) { - this(authName); - this.setCredentials(username, password); - } - - /** - * Helper constructor for single password oauth2 - * @param authName - * @param clientId - * @param secret - * @param username - * @param password - */ - public ApiClient(String authName, String clientId, String secret, String username, String password) { - this(authName); - this.getTokenEndPoint() - .setClientId(clientId) - .setClientSecret(secret) - .setUsername(username) - .setPassword(password); - } - public String getBasePath() { return basePath; } @@ -150,10 +126,25 @@ public class ApiClient { return objectMapper; } + private RequestInterceptor buildOauthRequestInterceptor(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { + switch (flow) { + case password: + return new OauthPasswordGrant(tokenUrl, scopes); + case application: + return new OauthClientCredentialsGrant(authorizationUrl, tokenUrl, scopes); + default: + throw new RuntimeException("Oauth flow \"" + flow + "\" is not implemented"); + } + } + public ObjectMapper getObjectMapper(){ return objectMapper; } + public void setObjectMapper(ObjectMapper objectMapper) { + this.objectMapper = objectMapper; + } + /** * Creates a feign client for given API interface. * @@ -200,19 +191,13 @@ public class ApiClient { return contentTypes[0]; } - /** * Helper method to configure the bearer token. * @param bearerToken the bearer token. */ public void setBearerToken(String bearerToken) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof HttpBearerAuth) { - ((HttpBearerAuth) apiAuthorization).setBearerToken(bearerToken); - return; - } - } - throw new RuntimeException("No Bearer authentication configured!"); + HttpBearerAuth apiAuthorization = getAuthorization(HttpBearerAuth.class); + apiAuthorization.setBearerToken(bearerToken); } /** @@ -220,63 +205,38 @@ public class ApiClient { * @param apiKey API key */ public void setApiKey(String apiKey) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof ApiKeyAuth) { - ApiKeyAuth keyAuth = (ApiKeyAuth) apiAuthorization; - keyAuth.setApiKey(apiKey); - return ; - } - } - throw new RuntimeException("No API key authentication configured!"); + ApiKeyAuth apiAuthorization = getAuthorization(ApiKeyAuth.class); + apiAuthorization.setApiKey(apiKey); } /** - * Helper method to configure the username/password for basic auth or password OAuth + * Helper method to configure the username/password for basic auth * @param username Username * @param password Password */ public void setCredentials(String username, String password) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof HttpBasicAuth) { - HttpBasicAuth basicAuth = (HttpBasicAuth) apiAuthorization; - basicAuth.setCredentials(username, password); - return; - } - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.getTokenRequestBuilder().setUsername(username).setPassword(password); - return; - } - } - throw new RuntimeException("No Basic authentication or OAuth configured!"); + HttpBasicAuth apiAuthorization = getAuthorization(HttpBasicAuth.class); + apiAuthorization.setCredentials(username, password); } /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder + * Helper method to configure the client credentials for Oauth + * @param username Username + * @param password Password */ - public TokenRequestBuilder getTokenEndPoint() { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - return oauth.getTokenRequestBuilder(); - } - } - return null; + public void setClientCredentials(String clientId, String clientSecret) { + OauthClientCredentialsGrant authorization = getAuthorization(OauthClientCredentialsGrant.class); + authorization.configure(clientId, clientSecret); } /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder + * Helper method to configure the username/password for Oauth password grant + * @param username Username + * @param password Password */ - public AuthenticationRequestBuilder getAuthorizationEndPoint() { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - return oauth.getAuthenticationRequestBuilder(); - } - } - return null; + public void setOauthPassword(String username, String password, String clientId, String clientSecret) { + OauthPasswordGrant apiAuthorization = getAuthorization(OauthPasswordGrant.class); + apiAuthorization.configure(username, password, clientId, clientSecret); } /** @@ -284,14 +244,9 @@ public class ApiClient { * @param accessToken Access Token * @param expiresIn Validity period in seconds */ - public void setAccessToken(String accessToken, Long expiresIn) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.setAccessToken(accessToken, expiresIn); - return; - } - } + public void setAccessToken(String accessToken, Integer expiresIn) { + OAuth apiAuthorization = getAuthorization(OAuth.class); + apiAuthorization.setAccessToken(accessToken, expiresIn); } /** @@ -301,19 +256,7 @@ public class ApiClient { * @param redirectURI Redirect URI */ public void configureAuthorizationFlow(String clientId, String clientSecret, String redirectURI) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.getTokenRequestBuilder() - .setClientId(clientId) - .setClientSecret(clientSecret) - .setRedirectURI(redirectURI); - oauth.getAuthenticationRequestBuilder() - .setClientId(clientId) - .setRedirectURI(redirectURI); - return; - } - } + throw new RuntimeException("Not implemented"); } /** @@ -321,13 +264,8 @@ public class ApiClient { * @param accessTokenListener Acesss token listener */ public void registerAccessTokenListener(AccessTokenListener accessTokenListener) { - for(RequestInterceptor apiAuthorization : apiAuthorizations.values()) { - if (apiAuthorization instanceof OAuth) { - OAuth oauth = (OAuth) apiAuthorization; - oauth.registerAccessTokenListener(accessTokenListener); - return; - } - } + OAuth apiAuthorization = getAuthorization(OAuth.class); + apiAuthorization.registerAccessTokenListener(accessTokenListener); } /** @@ -352,4 +290,11 @@ public class ApiClient { feignBuilder.requestInterceptor(authorization); } + private T getAuthorization(Class type) { + return (T) apiAuthorizations.values() + .stream() + .filter(requestInterceptor -> type.isAssignableFrom(requestInterceptor.getClass())) + .findFirst() + .orElseThrow(() -> new RuntimeException("No Oauth authentication or OAuth configured!")); + } } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/DefaultApi20Impl.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/DefaultApi20Impl.java new file mode 100644 index 00000000000..80db21111f9 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/DefaultApi20Impl.java @@ -0,0 +1,47 @@ +package org.openapitools.client.auth; + +import com.github.scribejava.core.builder.api.DefaultApi20; +import com.github.scribejava.core.extractors.OAuth2AccessTokenJsonExtractor; +import com.github.scribejava.core.extractors.TokenExtractor; +import com.github.scribejava.core.model.OAuth2AccessToken; +import com.github.scribejava.core.oauth2.bearersignature.BearerSignature; +import com.github.scribejava.core.oauth2.bearersignature.BearerSignatureURIQueryParameter; +import com.github.scribejava.core.oauth2.clientauthentication.ClientAuthentication; +import com.github.scribejava.core.oauth2.clientauthentication.RequestBodyAuthenticationScheme; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class DefaultApi20Impl extends DefaultApi20 { + + private final String accessTokenEndpoint; + private final String authorizationBaseUrl; + + protected DefaultApi20Impl(String authorizationBaseUrl, String accessTokenEndpoint) { + this.authorizationBaseUrl = authorizationBaseUrl; + this.accessTokenEndpoint = accessTokenEndpoint; + } + + @Override + public String getAccessTokenEndpoint() { + return accessTokenEndpoint; + } + + @Override + protected String getAuthorizationBaseUrl() { + return authorizationBaseUrl; + } + + @Override + public BearerSignature getBearerSignature() { + return BearerSignatureURIQueryParameter.instance(); + } + + @Override + public ClientAuthentication getClientAuthentication() { + return RequestBodyAuthenticationScheme.instance(); + } + + @Override + public TokenExtractor getAccessTokenExtractor() { + return OAuth2AccessTokenJsonExtractor.instance(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OAuth.java index f59ad4a94ba..d41eca7a0a5 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OAuth.java @@ -1,198 +1,81 @@ package org.openapitools.client.auth; -import java.io.IOException; -import java.util.Collection; -import java.util.Map; -import java.util.Map.Entry; - -import org.apache.oltu.oauth2.client.HttpClient; -import org.apache.oltu.oauth2.client.OAuthClient; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; -import org.apache.oltu.oauth2.client.response.OAuthClientResponse; -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory; -import org.apache.oltu.oauth2.client.response.OAuthJSONAccessTokenResponse; -import org.apache.oltu.oauth2.common.exception.OAuthProblemException; -import org.apache.oltu.oauth2.common.exception.OAuthSystemException; -import org.apache.oltu.oauth2.common.message.types.GrantType; -import org.apache.oltu.oauth2.common.token.BasicOAuthToken; - -import feign.Client; +import com.github.scribejava.core.model.OAuth2AccessToken; +import com.github.scribejava.core.oauth.OAuth20Service; import feign.Request.HttpMethod; -import feign.Request.Options; import feign.RequestInterceptor; import feign.RequestTemplate; -import feign.Response; import feign.RetryableException; -import feign.Util; -import org.openapitools.client.StringUtil; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class OAuth implements RequestInterceptor { -public class OAuth implements RequestInterceptor { + static final int MILLIS_PER_SECOND = 1000; - static final int MILLIS_PER_SECOND = 1000; + public interface AccessTokenListener { + void notify(OAuth2AccessToken token); + } - public interface AccessTokenListener { - void notify(BasicOAuthToken token); + private volatile String accessToken; + private Long expirationTimeMillis; + private AccessTokenListener accessTokenListener; + + protected OAuth20Service service; + protected String scopes; + protected String authorizationUrl; + protected String tokenUrl; + + public OAuth(String authorizationUrl, String tokenUrl, String scopes) { + this.scopes = scopes; + this.authorizationUrl = authorizationUrl; + this.tokenUrl = tokenUrl; + } + + @Override + public void apply(RequestTemplate template) { + // If the request already have an authorization (eg. Basic auth), do nothing + if (template.headers().containsKey("Authorization")) { + return; } - - private volatile String accessToken; - private Long expirationTimeMillis; - private OAuthClient oauthClient; - private TokenRequestBuilder tokenRequestBuilder; - private AuthenticationRequestBuilder authenticationRequestBuilder; - private AccessTokenListener accessTokenListener; - - public OAuth(Client client, TokenRequestBuilder requestBuilder) { - this.oauthClient = new OAuthClient(new OAuthFeignClient(client)); - this.tokenRequestBuilder = requestBuilder; + // If first time, get the token + if (expirationTimeMillis == null || System.currentTimeMillis() >= expirationTimeMillis) { + updateAccessToken(template); } - - public OAuth(Client client, OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { - this(client, OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes)); - - switch(flow) { - case accessCode: - case implicit: - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE); - break; - case password: - tokenRequestBuilder.setGrantType(GrantType.PASSWORD); - break; - case application: - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS); - break; - default: - break; - } - authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl); + if (getAccessToken() != null) { + template.header("Authorization", "Bearer " + getAccessToken()); } + } - public OAuth(OAuthFlow flow, String authorizationUrl, String tokenUrl, String scopes) { - this(new Client.Default(null, null), flow, authorizationUrl, tokenUrl, scopes); + private synchronized void updateAccessToken(RequestTemplate template) { + OAuth2AccessToken accessTokenResponse; + try { + accessTokenResponse = getOAuth2AccessToken(); + } catch (Exception e) { + throw new RetryableException(0, e.getMessage(), HttpMethod.POST, e, null, template.request()); } - - @Override - public void apply(RequestTemplate template) { - // If the request already have an authorization (eg. Basic auth), do nothing - if (template.headers().containsKey("Authorization")) { - return; - } - // If first time, get the token - if (expirationTimeMillis == null || System.currentTimeMillis() >= expirationTimeMillis) { - updateAccessToken(template); - } - if (getAccessToken() != null) { - template.header("Authorization", "Bearer " + getAccessToken()); - } + if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { + setAccessToken(accessTokenResponse.getAccessToken(), accessTokenResponse.getExpiresIn()); + if (accessTokenListener != null) { + accessTokenListener.notify(accessTokenResponse); + } } + } - public synchronized void updateAccessToken(RequestTemplate template) { - OAuthJSONAccessTokenResponse accessTokenResponse; - try { - accessTokenResponse = oauthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); - } catch (Exception e) { - throw new RetryableException(0, e.getMessage(), HttpMethod.POST, e, null, template.request()); - } - if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { - setAccessToken(accessTokenResponse.getAccessToken(), accessTokenResponse.getExpiresIn()); - if (accessTokenListener != null) { - accessTokenListener.notify((BasicOAuthToken) accessTokenResponse.getOAuthToken()); - } - } - } + abstract OAuth2AccessToken getOAuth2AccessToken(); - public synchronized void registerAccessTokenListener(AccessTokenListener accessTokenListener) { - this.accessTokenListener = accessTokenListener; - } + abstract OAuthFlow getFlow(); - public synchronized String getAccessToken() { - return accessToken; - } + public synchronized void registerAccessTokenListener(AccessTokenListener accessTokenListener) { + this.accessTokenListener = accessTokenListener; + } - public synchronized void setAccessToken(String accessToken, Long expiresIn) { - this.accessToken = accessToken; - this.expirationTimeMillis = expiresIn == null ? null : System.currentTimeMillis() + expiresIn * MILLIS_PER_SECOND; - } + public synchronized String getAccessToken() { + return accessToken; + } - public TokenRequestBuilder getTokenRequestBuilder() { - return tokenRequestBuilder; - } + public synchronized void setAccessToken(String accessToken, Integer expiresIn) { + this.accessToken = accessToken; + this.expirationTimeMillis = expiresIn == null ? null : System.currentTimeMillis() + expiresIn * MILLIS_PER_SECOND; + } - public void setTokenRequestBuilder(TokenRequestBuilder tokenRequestBuilder) { - this.tokenRequestBuilder = tokenRequestBuilder; - } - - public AuthenticationRequestBuilder getAuthenticationRequestBuilder() { - return authenticationRequestBuilder; - } - - public void setAuthenticationRequestBuilder(AuthenticationRequestBuilder authenticationRequestBuilder) { - this.authenticationRequestBuilder = authenticationRequestBuilder; - } - - public OAuthClient getOauthClient() { - return oauthClient; - } - - public void setOauthClient(OAuthClient oauthClient) { - this.oauthClient = oauthClient; - } - - public void setOauthClient(Client client) { - this.oauthClient = new OAuthClient( new OAuthFeignClient(client)); - } - - public static class OAuthFeignClient implements HttpClient { - - private Client client; - - public OAuthFeignClient() { - this.client = new Client.Default(null, null); - } - - public OAuthFeignClient(Client client) { - this.client = client; - } - - public T execute(OAuthClientRequest request, Map headers, - String requestMethod, Class responseClass) - throws OAuthSystemException, OAuthProblemException { - - RequestTemplate req = new RequestTemplate() - .append(request.getLocationUri()) - .method(requestMethod) - .body(request.getBody()); - - for (Entry entry : headers.entrySet()) { - req.header(entry.getKey(), entry.getValue()); - } - Response feignResponse; - String body = ""; - try { - feignResponse = client.execute(req.request(), new Options()); - body = Util.toString(feignResponse.body().asReader()); - } catch (IOException e) { - throw new OAuthSystemException(e); - } - - String contentType = null; - Collection contentTypeHeader = feignResponse.headers().get("Content-Type"); - if(contentTypeHeader != null) { - contentType = StringUtil.join(contentTypeHeader.toArray(new String[0]), ";"); - } - - return OAuthClientResponseFactory.createCustomResponse( - body, - contentType, - feignResponse.status(), - responseClass - ); - } - - public void shutdown() { - // Nothing to do here - } - } -} +} \ No newline at end of file diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OAuthFlow.java index b2d11ff0c4f..75c2a0c9740 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -13,6 +13,10 @@ package org.openapitools.client.auth; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public enum OAuthFlow { - accessCode, implicit, password, application + accessCode, //called authorizationCode in OpenAPI 3.0 + implicit, + password, + application //called clientCredentials in OpenAPI 3.0 } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OauthClientCredentialsGrant.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OauthClientCredentialsGrant.java new file mode 100644 index 00000000000..a21c5a15ba2 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OauthClientCredentialsGrant.java @@ -0,0 +1,39 @@ +package org.openapitools.client.auth; + +import com.github.scribejava.core.builder.ServiceBuilder; +import com.github.scribejava.core.model.OAuth2AccessToken; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OauthClientCredentialsGrant extends OAuth { + + public OauthClientCredentialsGrant(String authorizationUrl, String tokenUrl, String scopes) { + super(authorizationUrl, tokenUrl, scopes); + } + + @Override + protected OAuth2AccessToken getOAuth2AccessToken() { + try { + return service.getAccessTokenClientCredentialsGrant(scopes); + } catch (Exception e) { + throw new RuntimeException("Failed to get oauth token", e); + } + } + + @Override + protected OAuthFlow getFlow() { + return OAuthFlow.application; + } + + /** + * Configures the client credentials flow + * + * @param clientId + * @param clientSecret + */ + public void configure(String clientId, String clientSecret) { + service = new ServiceBuilder(clientId) + .apiSecret(clientSecret) + .defaultScope(scopes) + .build(new DefaultApi20Impl(authorizationUrl, tokenUrl)); + } +} diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OauthPasswordGrant.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OauthPasswordGrant.java new file mode 100644 index 00000000000..dba4fb3a076 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/auth/OauthPasswordGrant.java @@ -0,0 +1,48 @@ +package org.openapitools.client.auth; + +import com.github.scribejava.core.builder.ServiceBuilder; +import com.github.scribejava.core.model.OAuth2AccessToken; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OauthPasswordGrant extends OAuth { + + private String username; + private String password; + + public OauthPasswordGrant(String tokenUrl, String scopes) { + super(null, tokenUrl, scopes); + } + + @Override + protected OAuth2AccessToken getOAuth2AccessToken() { + try { + return service.getAccessTokenPasswordGrant(username, password); + } catch (Exception e) { + throw new RuntimeException("Failed to get oauth token", e); + } + } + + @Override + protected OAuthFlow getFlow() { + return OAuthFlow.password; + } + + /** + * Configures Oauth password grant flow + * Note: this flow is deprecated. + * + * @param username + * @param password + * @param clientId + * @param clientSecret + */ + public void configure(String username, String password, String clientId, String clientSecret) { + this.username = username; + this.password = password; + //TODO the clientId and secret are optional according with the RFC + service = new ServiceBuilder(clientId) + .apiSecret(clientSecret) + .defaultScope(scopes) + .build(new DefaultApi20Impl(authorizationUrl, tokenUrl)); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 497124467a2..366143d1fc0 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index d638cd95bf4..7a5e9587e65 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 5ce0e7937f5..8f017af3507 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index dca8ec41b68..e442eea3121 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -447,7 +447,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index e7f70c5fb0d..8e85dd20fe7 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index e96cab6e53e..50db851ff00 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index fb48dd0c264..b6fcfc25ba8 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 932cfecb044..20bbfd1117d 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java index 6f15310fd8c..c33e153c751 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java @@ -120,7 +120,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 27ce18d552d..459f4602965 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -90,7 +90,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index b6d3b256a24..8becb8dd2b0 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -90,7 +90,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java index 38399bfe582..8747730a9dd 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -166,7 +166,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java index c000e826f31..ccfdc5a5ec0 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCat.java @@ -125,7 +125,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 81a5b56ed64..481e22e0df1 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -118,7 +118,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java index 27d2258b3fa..2065be194db 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java @@ -229,7 +229,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java index ad865f0c4b0..9c3291beecf 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java @@ -90,7 +90,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java index d3d7c8341d7..2199b085d73 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -79,7 +79,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java index ddd999f84c6..3737dbb3c3e 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java @@ -108,7 +108,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java index 3e2216e6ae4..227bdaae556 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java @@ -80,7 +80,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java index 2147430592b..9fea8958838 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java @@ -79,7 +79,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java index 559b170c4f7..d54ac1b7a2f 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java @@ -86,7 +86,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java index 9f3d303c1ab..449c4e6f051 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -79,7 +79,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java index c38d53553cb..4944b28bdfe 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -189,7 +189,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java index bc6ce93c566..7589d69aa6d 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java @@ -343,7 +343,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index f427cf921f6..074b99080e7 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -119,7 +119,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java index 23f3e20db17..5f8a894641d 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java @@ -480,7 +480,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index bd976488179..4f7e8a75ca2 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -91,7 +91,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java index 1271533e5be..b5921775cfd 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java @@ -239,7 +239,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index fdb9393a657..dbb1682a919 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -153,7 +153,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java index 6bba2623f4b..bc3bee0e09a 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java @@ -110,7 +110,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 97921db1707..47f88db907b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -139,7 +139,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java index f28c2ac46ea..1b2a532f60c 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -80,7 +80,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java index 7ba7d886ce2..1da9e1433c1 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java @@ -151,7 +151,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java index 54be0a4cbf0..d1f21fa5942 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -80,7 +80,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java index 57d7e53a1c3..8d739749902 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java @@ -267,7 +267,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java index 0275e5ed9b8..7b28063ef12 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -140,7 +140,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java index 2ac06b78334..fca1a5141de 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java @@ -283,7 +283,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 455300cd7f8..f866409c5bd 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -100,7 +100,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java index ac1bfcbd846..2a7c39ec8e8 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -79,7 +79,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java index a95f8f4a4d8..9630d272242 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java @@ -109,7 +109,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 4dabcf030cc..6f0a0c91e1b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -202,7 +202,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 1c18b7dc99f..1e3eb75f97b 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -231,7 +231,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java index 49ed08dff9a..ba6825df44e 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java @@ -289,7 +289,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java index 0b968d7136a..4fd920eb0fb 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java @@ -994,7 +994,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index b5e26401d2f..b1a286dfc90 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -1,24 +1,19 @@ package org.openapitools.client.api; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; -import org.junit.Before; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** * API tests for AnotherFakeApi */ -public class AnotherFakeApiTest { +class AnotherFakeApiTest { private AnotherFakeApi api; - @Before - public void setup() { + @BeforeEach + void setup() { api = new ApiClient().buildClient(AnotherFakeApi.class); } @@ -29,7 +24,7 @@ public class AnotherFakeApiTest { * To test special tags and operation ID starting with number */ @Test - public void call123testSpecialTagsTest() { + void call123testSpecialTagsTest() { Client body = null; // Client response = api.call123testSpecialTags(body); diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/FakeApiTest.java index 52f9af36b6e..d165a66b64a 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -1,342 +1,321 @@ package org.openapitools.client.api; +import com.github.tomakehurst.wiremock.WireMockServer; +import com.github.tomakehurst.wiremock.common.Slf4jNotifier; +import feign.FeignException; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; import org.openapitools.client.ApiClient; -import java.math.BigDecimal; import org.openapitools.client.model.Client; -import java.io.File; -import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; -import org.junit.Before; -import org.junit.Test; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; -import java.util.ArrayList; +import java.io.File; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; -import java.util.List; -import java.util.Map; -/** - * API tests for FakeApi - */ -public class FakeApiTest { +import static com.github.tomakehurst.wiremock.client.WireMock.*; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; - private FakeApi api; +class FakeApiTest { - @Before - public void setup() { - api = new ApiClient().buildClient(FakeApi.class); - } + private static WireMockServer wm = new WireMockServer(options().dynamicPort().notifier(new Slf4jNotifier(true))); - - /** - * creates an XmlItem - * - * this route creates an XmlItem - */ - @Test - public void createXmlItemTest() { - XmlItem xmlItem = null; - // api.createXmlItem(xmlItem); + private FakeApi api; - // TODO: test validations - } + @BeforeAll + static void startWireMock() { + wm.start(); + } - - /** - * - * - * Test serialization of outer boolean types - */ - @Test - public void fakeOuterBooleanSerializeTest() { - Boolean body = null; - // Boolean response = api.fakeOuterBooleanSerialize(body); + @AfterAll + static void stopWireMock() { + wm.shutdown(); + } - // TODO: test validations - } + @BeforeEach + void setUp() { + ApiClient apiClient = new ApiClient(); + apiClient.setBasePath(wm.baseUrl()); + api = apiClient.buildClient(FakeApi.class); + } - - /** - * - * - * Test serialization of object with outer number type - */ - @Test - public void fakeOuterCompositeSerializeTest() { - OuterComposite body = null; - // OuterComposite response = api.fakeOuterCompositeSerialize(body); + @Test + void createXmlItem() { + wm.stubFor(post(urlEqualTo("/fake/create_xml_item")) + .withHeader("Content-Type", equalTo("application/xml")) + .withHeader("Accept", equalTo("application/json")) + .willReturn(ok())); - // TODO: test validations - } + XmlItem xmlItem = new XmlItem(); + api.createXmlItem(xmlItem); + } - - /** - * - * - * Test serialization of outer number types - */ - @Test - public void fakeOuterNumberSerializeTest() { - BigDecimal body = null; - // BigDecimal response = api.fakeOuterNumberSerialize(body); + @ParameterizedTest + @ValueSource(strings = {"true", "false"}) + void fakeOuterBooleanSerialize(String returnBoolean) { + wm.stubFor(post(urlEqualTo("/fake/outer/boolean")) + .withHeader("Content-Type", equalTo("*/*")) + .withHeader("Accept", equalTo("*/*")) + .willReturn(ok(returnBoolean))); - // TODO: test validations - } + boolean expectedBoolean = Boolean.parseBoolean(returnBoolean); + Boolean aBoolean = api.fakeOuterBooleanSerialize(expectedBoolean); - - /** - * - * - * Test serialization of outer string types - */ - @Test - public void fakeOuterStringSerializeTest() { - String body = null; - // String response = api.fakeOuterStringSerialize(body); + assertThat(aBoolean, is(expectedBoolean)); + } - // TODO: test validations - } + @Test + void fakeOuterCompositeSerialize() { + String body = "{\n" + + " \"my_number\": 123.45,\n" + + " \"my_string\":\"Hello\",\n" + + " \"my_boolean\": true\n" + + "}"; + wm.stubFor(post(urlEqualTo("/fake/outer/composite")) + .withHeader("Content-Type", equalTo("*/*")) + .withHeader("Accept", equalTo("*/*")) + .withRequestBody(equalToJson(body, true, false)) + .willReturn(ok(body))); - - /** - * - * - * For this test, the body for this request much reference a schema named `File`. - */ - @Test - public void testBodyWithFileSchemaTest() { - FileSchemaTestClass body = null; - // api.testBodyWithFileSchema(body); + OuterComposite outerComposite = new OuterComposite(); + outerComposite.setMyBoolean(Boolean.TRUE); + outerComposite.setMyNumber(BigDecimal.valueOf(123.45)); + outerComposite.setMyString("Hello"); - // TODO: test validations - } + OuterComposite result = api.fakeOuterCompositeSerialize(outerComposite); - - /** - * - * - * - */ - @Test - public void testBodyWithQueryParamsTest() { - String query = null; - User body = null; - // api.testBodyWithQueryParams(query, body); + assertThat(result, is(outerComposite)); + } - // TODO: test validations - } + @Test + void fakeOuterNumberSerialize() { + String body = "123.45"; + wm.stubFor(post(urlEqualTo("/fake/outer/number")) + .withHeader("Content-Type", equalTo("*/*")) + .withHeader("Accept", equalTo("*/*")) + .withRequestBody(equalTo(body)) + .willReturn(ok(body))); - /** - * - * - * - * - * This tests the overload of the method that uses a Map for query parameters instead of - * listing them out individually. - */ - @Test - public void testBodyWithQueryParamsTestQueryMap() { - User body = null; - FakeApi.TestBodyWithQueryParamsQueryParams queryParams = new FakeApi.TestBodyWithQueryParamsQueryParams() - .query(null); - // api.testBodyWithQueryParams(body, queryParams); + BigDecimal result = api.fakeOuterNumberSerialize(BigDecimal.valueOf(123.45)); - // TODO: test validations - } - - /** - * To test \"client\" model - * - * To test \"client\" model - */ - @Test - public void testClientModelTest() { - Client body = null; - // Client response = api.testClientModel(body); + assertThat(result, is(result)); + } - // TODO: test validations - } + @Test + void fakeOuterStringSerialize() { + String body = "Hello world"; + wm.stubFor(post(urlEqualTo("/fake/outer/string")) + .withHeader("Content-Type", equalTo("*/*")) + .withHeader("Accept", equalTo("*/*")) + .withRequestBody(equalTo("\"" + body + "\"")) + .willReturn(ok("\"" + body + "\""))); - - /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - */ - @Test - public void testEndpointParametersTest() { - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - File binary = null; - LocalDate date = null; - OffsetDateTime dateTime = null; - String password = null; - String paramCallback = null; - // api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + String result = api.fakeOuterStringSerialize(body); - // TODO: test validations - } + assertThat(result, is(body)); + } - - /** - * To test enum parameters - * - * To test enum parameters - */ - @Test - public void testEnumParametersTest() { - List enumHeaderStringArray = null; - String enumHeaderString = null; - List enumQueryStringArray = null; - String enumQueryString = null; - Integer enumQueryInteger = null; - Double enumQueryDouble = null; - List enumFormStringArray = null; - String enumFormString = null; - // api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + @Test + void testBodyWithFileSchema() throws IOException { + //TODO + } - // TODO: test validations - } + @Test + void testBodyWithQueryParams() { + String body = "{\n" + + " \"id\":123456,\n" + + " \"username\":null,\n" + + " \"firstName\":\"Bruce\",\n" + + " \"lastName\":\"Wayne\",\n" + + " \"email\":\"mail@email.com\",\n" + + " \"password\":\"password\",\n" + + " \"phone\":\"+123 3313131\",\n" + + " \"userStatus\":1\n" + + "}"; - /** - * To test enum parameters - * - * To test enum parameters - * - * This tests the overload of the method that uses a Map for query parameters instead of - * listing them out individually. - */ - @Test - public void testEnumParametersTestQueryMap() { - List enumHeaderStringArray = null; - String enumHeaderString = null; - List enumFormStringArray = null; - String enumFormString = null; - FakeApi.TestEnumParametersQueryParams queryParams = new FakeApi.TestEnumParametersQueryParams() - .enumQueryStringArray(null) - .enumQueryString(null) - .enumQueryInteger(null) - .enumQueryDouble(null); - // api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumFormStringArray, enumFormString, queryParams); + wm.stubFor(put(urlEqualTo("/fake/body-with-query-params?query=tags")) + .withHeader("Content-Type", equalTo("application/json")) + .withHeader("Accept", equalTo("application/json")) + .withRequestBody(equalToJson(body)) + .willReturn(ok())); - // TODO: test validations - } - - /** - * Fake endpoint to test group parameters (optional) - * - * Fake endpoint to test group parameters (optional) - */ - @Test - public void testGroupParametersTest() { - Integer requiredStringGroup = null; - Boolean requiredBooleanGroup = null; - Long requiredInt64Group = null; - Integer stringGroup = null; - Boolean booleanGroup = null; - Long int64Group = null; - // api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + User user = new User(); + user.setEmail("mail@email.com"); + user.setFirstName("Bruce"); + user.setLastName("Wayne"); + user.setId(123456L); + user.setUserStatus(1); + user.setPassword("password"); + user.setPhone("+123 3313131"); - // TODO: test validations - } + api.testBodyWithQueryParams("tags", user); + } - /** - * Fake endpoint to test group parameters (optional) - * - * Fake endpoint to test group parameters (optional) - * - * This tests the overload of the method that uses a Map for query parameters instead of - * listing them out individually. - */ - @Test - public void testGroupParametersTestQueryMap() { - Boolean requiredBooleanGroup = null; - Boolean booleanGroup = null; - FakeApi.TestGroupParametersQueryParams queryParams = new FakeApi.TestGroupParametersQueryParams() - .requiredStringGroup(null) - .requiredInt64Group(null) - .stringGroup(null) - .int64Group(null); - // api.testGroupParameters(requiredBooleanGroup, booleanGroup, queryParams); + @Test + void testBodyWithQueryParamsMap() { + String body = "{\n" + + " \"id\":123456,\n" + + " \"username\":null,\n" + + " \"firstName\":\"Bruce\",\n" + + " \"lastName\":\"Wayne\",\n" + + " \"email\":\"mail@email.com\",\n" + + " \"password\":\"password\",\n" + + " \"phone\":\"+123 3313131\",\n" + + " \"userStatus\":1\n" + + "}"; - // TODO: test validations - } - - /** - * test inline additionalProperties - * - * - */ - @Test - public void testInlineAdditionalPropertiesTest() { - Map param = null; - // api.testInlineAdditionalProperties(param); + wm.stubFor(put(urlEqualTo("/fake/body-with-query-params?query=value1")) + .withHeader("Content-Type", equalTo("application/json")) + .withHeader("Accept", equalTo("application/json")) + .withRequestBody(equalToJson(body)) + .willReturn(ok())); - // TODO: test validations - } + User user = new User(); + user.setEmail("mail@email.com"); + user.setFirstName("Bruce"); + user.setLastName("Wayne"); + user.setId(123456L); + user.setUserStatus(1); + user.setPassword("password"); + user.setPhone("+123 3313131"); - - /** - * test json serialization of form data - * - * - */ - @Test - public void testJsonFormDataTest() { - String param = null; - String param2 = null; - // api.testJsonFormData(param, param2); + FakeApi.TestBodyWithQueryParamsQueryParams queryParams = new FakeApi.TestBodyWithQueryParamsQueryParams(); + queryParams.query("value1"); - // TODO: test validations - } + api.testBodyWithQueryParams(user, queryParams); + } - - /** - * - * - * To test the collection format in query parameters - */ - @Test - public void testQueryParameterCollectionFormatTest() { - List pipe = null; - List ioutil = null; - List http = null; - List url = null; - List context = null; - // api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + @Test + void testClientModel() { + String body = "{\n" + + " \"client\":\"Mr Wayne\"\n" + + "}"; - // TODO: test validations - } + wm.stubFor(patch(urlEqualTo("/fake")) + .withHeader("Content-Type", equalTo("application/json")) + .withHeader("Accept", equalTo("application/json")) + .withRequestBody(equalToJson(body)) + .willReturn(ok(body))); - /** - * - * - * To test the collection format in query parameters - * - * This tests the overload of the method that uses a Map for query parameters instead of - * listing them out individually. - */ - @Test - public void testQueryParameterCollectionFormatTestQueryMap() { - FakeApi.TestQueryParameterCollectionFormatQueryParams queryParams = new FakeApi.TestQueryParameterCollectionFormatQueryParams() - .pipe(null) - .ioutil(null) - .http(null) - .url(null) - .context(null); - // api.testQueryParameterCollectionFormat(queryParams); + Client client = new Client(); + client.setClient("Mr Wayne"); - // TODO: test validations - } - -} + Client result = api.testClientModel(client); + + assertThat(result.getClient(), is("Mr Wayne")); + } + + @Test + void testEndpointParameters() throws IOException { + wm.stubFor(post(urlEqualTo("/fake")) + .withHeader("Content-Type", containing("application/x-www-form-urlencoded")) + .withHeader("Accept", equalTo("application/json")) + .willReturn(ok())); + + //TODO Cannot serialize bytearray to x-www-form-urlencoded, must use multipart + api.testEndpointParameters(BigDecimal.ONE, 1.0, "abc", null, 123, + 1234, 123L, 1.0f, "string", File.createTempFile("testEndpointParameters", "tmp"), LocalDate.now(), OffsetDateTime.now(), + "password", "callback"); + } + + @Test + void testEnumParameters() { + //TODO GET method does not allow request body + } + + @Test + void testGroupParameters() { + wm.stubFor(delete(urlEqualTo("/fake?required_string_group=123&required_int64_group=123&string_group=123&int64_group=123")) + .withHeader("Accept", equalTo("application/json")) + .withHeader("required_boolean_group", equalTo("true")) + .withHeader("boolean_group", equalTo("true")) + .willReturn(ok())); + + api.testGroupParameters(123, true, 123L, 123, true, 123L); + } + + @Test + void testInlineAdditionalProperties() { + + wm.stubFor(post(urlEqualTo("/fake/inline-additionalProperties")) + .withHeader("Content-Type", equalTo("application/json")) + .withHeader("Accept", equalTo("application/json")) + .willReturn(ok())); + + api.testInlineAdditionalProperties(new HashMap<>()); + + } + + @Test + void testQueryParameterCollectionFormat() { + + wm.stubFor(put(urlEqualTo("/fake/test-query-paramters?pipe=pipe1&pipe=pipe2&ioutil=io&http=http&url=url&context=context")) + .withHeader("Accept", equalTo("application/json")) + .willReturn(ok())); + + api.testQueryParameterCollectionFormat(Arrays.asList("pipe1", "pipe2"), Arrays.asList("io"), Arrays.asList("http"), Arrays.asList("url"), Arrays.asList("context")); + } + + @Test + void testQueryParameterCollectionFormatQueryParams() { + + wm.stubFor(put(urlEqualTo("/fake/test-query-paramters?ioutil=io&context=context&http=http&pipe=pipe1&pipe=pipe2&url=url")) + .withHeader("Accept", equalTo("application/json")) + .willReturn(ok())); + + HashMap params = new HashMap<>(); + params.put("context", Arrays.asList("context")); + params.put("pipe", Arrays.asList("pipe1", "pipe2")); + params.put("ioutil", Arrays.asList("io")); + params.put("http", Arrays.asList("http")); + params.put("url", Arrays.asList("url")); + + api.testQueryParameterCollectionFormat(params); + } + + @Test + void test404() { + wm.stubFor(post(urlEqualTo("/fake/create_xml_item")) + .withHeader("Content-Type", equalTo("application/xml")) + .withHeader("Accept", equalTo("application/json")) + .willReturn(notFound())); + + XmlItem xmlItem = new XmlItem(); + assertThrows(FeignException.NotFound.class, () -> api.createXmlItem(xmlItem)); + } + + @Test + void test500() { + wm.stubFor(post(urlEqualTo("/fake/create_xml_item")) + .withHeader("Content-Type", equalTo("application/xml")) + .withHeader("Accept", equalTo("application/json")) + .willReturn(serverError())); + + XmlItem xmlItem = new XmlItem(); + assertThrows(FeignException.InternalServerError.class, () -> api.createXmlItem(xmlItem)); + } + + @Test + void test400() { + wm.stubFor(post(urlEqualTo("/fake/create_xml_item")) + .withHeader("Content-Type", equalTo("application/xml")) + .withHeader("Accept", equalTo("application/json")) + .willReturn(badRequest())); + + XmlItem xmlItem = new XmlItem(); + assertThrows(FeignException.BadRequest.class, () -> api.createXmlItem(xmlItem)); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index badb867ce81..382c6760fba 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -1,40 +1,66 @@ package org.openapitools.client.api; +import com.github.tomakehurst.wiremock.WireMockServer; +import com.github.tomakehurst.wiremock.common.Slf4jNotifier; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; -import org.junit.Before; -import org.junit.Test; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import static com.github.tomakehurst.wiremock.client.WireMock.*; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; /** * API tests for FakeClassnameTags123Api */ -public class FakeClassnameTags123ApiTest { +class FakeClassnameTags123ApiTest { - private FakeClassnameTags123Api api; + private static WireMockServer wm = new WireMockServer(options().dynamicPort().notifier(new Slf4jNotifier(true))); - @Before - public void setup() { - api = new ApiClient().buildClient(FakeClassnameTags123Api.class); - } + private FakeClassnameTags123Api api; - - /** - * To test class name in snake case - * - * To test class name in snake case - */ - @Test - public void testClassnameTest() { - Client body = null; - // Client response = api.testClassname(body); + @BeforeAll + static void startWireMock() { + wm.start(); + } + + @AfterAll + static void stopWireMock() { + wm.shutdown(); + } + + @BeforeEach + void setUp() { + ApiClient apiClient = new ApiClient(); + apiClient.setBasePath(wm.baseUrl()); + api = apiClient.buildClient(FakeClassnameTags123Api.class); + } + + /** + * To test class name in snake case + *

    + * To test class name in snake case + */ + @Test + void testClassnameTest() { + String responseBody = "{\n" + + " \"client\":\"Bruce\"\n" + + "}"; + wm.stubFor(patch(urlEqualTo("/fake_classname_test")) + .withHeader("Content-Type", equalTo("application/json")) + .withHeader("Accept", equalTo("application/json")) + .willReturn(ok(responseBody))); + + Client client = new Client(); + client.setClient("Bruce"); + + Client response = api.testClassname(client); + assertThat(response, is(client)); + } - // TODO: test validations - } - } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/PetApiTest.java index d49eb6ea026..80de2d5749b 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -1,194 +1,210 @@ package org.openapitools.client.api; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.github.tomakehurst.wiremock.WireMockServer; +import com.github.tomakehurst.wiremock.matching.MultipartValuePatternBuilder; +import com.google.common.collect.Sets; +import org.apache.commons.io.IOUtils; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import org.openapitools.client.ApiClient; -import java.io.File; -import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import java.util.Set; -import org.junit.Before; -import org.junit.Test; -import java.util.ArrayList; -import java.util.HashMap; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Arrays; import java.util.List; -import java.util.Map; +import java.util.Set; + +import static com.github.tomakehurst.wiremock.client.WireMock.*; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; /** - * API tests for PetApi + * API tests for PetAp */ -public class PetApiTest { +class PetApiTest { - private PetApi api; + private static PetApi api; - @Before - public void setup() { - api = new ApiClient().buildClient(PetApi.class); - } + private static WireMockServer wm = new WireMockServer(options().dynamicPort()); + private static String petJson; + private static String petListJson; - - /** - * Add a new pet to the store - * - * - */ - @Test - public void addPetTest() { - Pet body = null; - // api.addPet(body); + private ObjectMapper objectMapper = new ObjectMapper(); - // TODO: test validations - } + @BeforeAll + static void setup() throws IOException { + wm.start(); - - /** - * Deletes a pet - * - * - */ - @Test - public void deletePetTest() { - Long petId = null; - String apiKey = null; - // api.deletePet(petId, apiKey); + ApiClient apiClient = new ApiClient(); + apiClient.setBasePath(wm.baseUrl()); + api = apiClient.buildClient(PetApi.class); - // TODO: test validations - } + petJson = IOUtils.toString(PetApiTest.class.getResourceAsStream("/pet.json"), "UTF-8"); + petListJson = IOUtils.toString(PetApiTest.class.getResourceAsStream("/pet_list.json"), "UTF-8"); + } - - /** - * Finds Pets by status - * - * Multiple status values can be provided with comma separated strings - */ - @Test - public void findPetsByStatusTest() { - List status = null; - // List response = api.findPetsByStatus(status); + @AfterAll + static void shutdown() { + wm.shutdown(); + } - // TODO: test validations - } + @Test + void addPet() throws JsonProcessingException { + wm.stubFor(post(urlEqualTo("/pet")) + .willReturn(aResponse().withBody(petJson))); - /** - * Finds Pets by status - * - * Multiple status values can be provided with comma separated strings - * - * This tests the overload of the method that uses a Map for query parameters instead of - * listing them out individually. - */ - @Test - public void findPetsByStatusTestQueryMap() { - PetApi.FindPetsByStatusQueryParams queryParams = new PetApi.FindPetsByStatusQueryParams() - .status(null); - // List response = api.findPetsByStatus(queryParams); + Pet pet = objectMapper.readValue(petJson, Pet.class); - // TODO: test validations - } - - /** - * Finds Pets by tags - * - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - */ - @Test - public void findPetsByTagsTest() { - Set tags = null; - // Set response = api.findPetsByTags(tags); + api.addPet(pet); - // TODO: test validations - } + wm.verify(postRequestedFor(urlEqualTo("/pet")) + .withHeader("Content-Type", equalTo("application/json")) + .withHeader("Accept", equalTo("application/json")) + .withRequestBody(equalToJson(petJson))); + } - /** - * Finds Pets by tags - * - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * This tests the overload of the method that uses a Map for query parameters instead of - * listing them out individually. - */ - @Test - public void findPetsByTagsTestQueryMap() { - PetApi.FindPetsByTagsQueryParams queryParams = new PetApi.FindPetsByTagsQueryParams() - .tags(null); - // Set response = api.findPetsByTags(queryParams); + @Test + void deletedPet() { + wm.stubFor(delete(urlEqualTo("/pet/85")) + .willReturn(aResponse())); - // TODO: test validations - } - - /** - * Find pet by ID - * - * Returns a single pet - */ - @Test - public void getPetByIdTest() { - Long petId = null; - // Pet response = api.getPetById(petId); + api.deletePet(85L, "API_KEY"); - // TODO: test validations - } + wm.verify(deleteRequestedFor(urlEqualTo("/pet/85")) + .withHeader("api_key", equalTo("API_KEY")) + .withHeader("Accept", equalTo("application/json"))); + } - - /** - * Update an existing pet - * - * - */ - @Test - public void updatePetTest() { - Pet body = null; - // api.updatePet(body); + @Test + void findPetsByStatus() { + wm.stubFor(get(urlEqualTo("/pet/findByStatus?status=available&status=sold")) + .willReturn(aResponse() + .withHeader("Content-Type", "application/json") + .withBody(petListJson))); - // TODO: test validations - } + List petList = api.findPetsByStatus(Arrays.asList("available", "sold")); + assertThat(petList.size(), is(2)); - - /** - * Updates a pet in the store with form data - * - * - */ - @Test - public void updatePetWithFormTest() { - Long petId = null; - String name = null; - String status = null; - // api.updatePetWithForm(petId, name, status); + validatePet1(petList.get(0)); + validatePet2(petList.get(1)); + } - // TODO: test validations - } + @Test + void findPetsByStatusQueryMap() { + wm.stubFor(get(urlEqualTo("/pet/findByStatus?status=available,sold")) + .willReturn(aResponse() + .withHeader("Content-Type", "application/json") + .withBody(petListJson))); - - /** - * uploads an image - * - * - */ - @Test - public void uploadFileTest() { - Long petId = null; - String additionalMetadata = null; - File file = null; - // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + PetApi.FindPetsByStatusQueryParams findPetsByStatusQueryParams = new PetApi.FindPetsByStatusQueryParams(); + findPetsByStatusQueryParams.status(Arrays.asList("available", "sold")); - // TODO: test validations - } + List petList = api.findPetsByStatus(findPetsByStatusQueryParams); + assertThat(petList.size(), is(2)); - - /** - * uploads an image (required) - * - * - */ - @Test - public void uploadFileWithRequiredFileTest() { - Long petId = null; - File requiredFile = null; - String additionalMetadata = null; - // ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + validatePet1(petList.get(0)); + validatePet2(petList.get(1)); + } - // TODO: test validations - } + @Test + void findPetsByTags() { + wm.stubFor(get(urlEqualTo("/pet/findByTags?tags=tag1&tags=tag2")) + .willReturn(aResponse() + .withHeader("Content-Type", "application/json") + .withBody(petListJson))); - + Set petList = api.findPetsByTags(Sets.newHashSet("tag1", "tag2")); + assertThat(petList.size(), is(2)); + } + + @Test + void getPetById() { + wm.stubFor(get(urlEqualTo("/pet/85")) + .willReturn(aResponse() + .withHeader("Content-Type", "application/json") + .withBody(petJson))); + + Pet pet = api.getPetById(85L); + + validatePet1(pet); + } + + @Test + void updatePet() throws JsonProcessingException { + wm.stubFor(put(urlEqualTo("/pet")) + .willReturn(aResponse() + .withHeader("Content-Type", "application/json") + .withBody(petJson))); + + Pet pet = objectMapper.readValue(petJson, Pet.class); + api.updatePet(pet); + + wm.verify(putRequestedFor(urlEqualTo("/pet")) + .withHeader("Accept", equalTo("application/json")) + .withHeader("Content-Type", equalTo("application/json")) + .withRequestBody(equalToJson(petJson))); + } + + @Test + void updatePetWithForm() { + wm.stubFor(post(anyUrl()).willReturn(aResponse())); + + api.updatePetWithForm(85L, "Rex", "sold"); + + wm.verify(postRequestedFor(urlEqualTo("/pet/85")) + .withHeader("Accept", equalTo("application/json")) + .withHeader("Content-Type", containing("application/x-www-form-urlencoded")) + .withRequestBody(containing("name=Rex")) + .withRequestBody(containing("status=sold"))); + } + + @Test + void uploadFile() throws IOException { + wm.stubFor(post("/pet/85/uploadImage").willReturn(aResponse())); + File file = File.createTempFile("test", ".tmp"); + IOUtils.write("ABCD".getBytes(), new FileOutputStream(file)); + + api.uploadFile(85L, "metadata", file); + + wm.verify(postRequestedFor(urlEqualTo("/pet/85/uploadImage")) + .withHeader("Content-Type", containing("multipart/form-data")) + .withHeader("Accept", containing("application/json")) + .withRequestBodyPart(new MultipartValuePatternBuilder() + .withName("additionalMetadata").build()) + .withRequestBodyPart(new MultipartValuePatternBuilder() + .withName("file").withBody(binaryEqualTo("ABCD".getBytes())).build()) + ); + } + + private void validatePet1(Pet pet) { + assertThat(pet.getId(), is(85L)); + assertThat(pet.getCategory().getName(), is("Dogs")); + assertThat(pet.getCategory().getId(), is(1L)); + assertThat(pet.getName(), is("LvRcat")); + assertThat(pet.getPhotoUrls().size(), is(1)); + assertThat(pet.getPhotoUrls().stream().findAny().get(), is("string")); + assertThat(pet.getTags().size(), is(1)); + assertThat(pet.getTags().get(0).getId(), is(10L)); + assertThat(pet.getTags().get(0).getName(), is("tag")); + assertThat(pet.getStatus(), is(Pet.StatusEnum.AVAILABLE)); + } + + private void validatePet2(Pet pet) { + assertThat(pet.getId(), is(42L)); + assertThat(pet.getCategory().getName(), is("Dogs")); + assertThat(pet.getCategory().getId(), is(1L)); + assertThat(pet.getName(), is("Louise")); + assertThat(pet.getPhotoUrls().size(), is(1)); + assertThat(pet.getPhotoUrls().stream().findAny().get(), is("photo")); + assertThat(pet.getTags().size(), is(1)); + assertThat(pet.getTags().get(0).getId(), is(0L)); + assertThat(pet.getTags().get(0).getName(), is("obedient")); + assertThat(pet.getStatus(), is(Pet.StatusEnum.SOLD)); + } } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/StoreApiTest.java index 07a48ec6e63..2b0ac4c9d34 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -1,81 +1,153 @@ package org.openapitools.client.api; +import com.github.tomakehurst.wiremock.WireMockServer; +import feign.FeignException; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import org.openapitools.client.ApiClient; import org.openapitools.client.model.Order; -import org.junit.Before; -import org.junit.Test; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.ZoneOffset; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; import java.util.Map; +import static com.github.tomakehurst.wiremock.client.WireMock.*; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + /** * API tests for StoreApi */ public class StoreApiTest { - private StoreApi api; + private static StoreApi api; - @Before - public void setup() { - api = new ApiClient().buildClient(StoreApi.class); - } + private static WireMockServer wm = new WireMockServer(options().dynamicPort()); - - /** - * Delete purchase order by ID - * - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - */ - @Test - public void deleteOrderTest() { - String orderId = null; - // api.deleteOrder(orderId); + @BeforeAll + static void setup() { + wm.start(); - // TODO: test validations - } + ApiClient apiClient = new ApiClient(); + apiClient.setBasePath(wm.baseUrl()); + api = apiClient.buildClient(StoreApi.class); - - /** - * Returns pet inventories by status - * - * Returns a map of status codes to quantities - */ - @Test - public void getInventoryTest() { - // Map response = api.getInventory(); + } - // TODO: test validations - } + @AfterAll + static void shutdown() { + wm.shutdown(); + } - - /** - * Find purchase order by ID - * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - */ - @Test - public void getOrderByIdTest() { - Long orderId = null; - // Order response = api.getOrderById(orderId); - // TODO: test validations - } + /** + * Delete purchase order by ID + *

    + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + */ + @Test + void deleteOrderTest() { + wm.stubFor(delete(urlEqualTo("/store/order/1234")) + .withHeader("Accept", equalTo("application/json")) + .willReturn(ok())); - - /** - * Place an order for a pet - * - * - */ - @Test - public void placeOrderTest() { - Order body = null; - // Order response = api.placeOrder(body); + api.deleteOrder("1234"); + } - // TODO: test validations - } + @Test + void deleteOrderTestInvalid() { + wm.stubFor(delete(urlEqualTo("/store/order/abc")) + .withHeader("Accept", equalTo("application/json")) + .willReturn(aResponse().withStatus(400))); + + assertThrows(FeignException.BadRequest.class, () -> api.deleteOrder("abc")); + } + + /** + * Returns pet inventories by status + *

    + * Returns a map of status codes to quantities + */ + @Test + void getInventoryTest() { + wm.stubFor(get(urlEqualTo("/store/inventory")) + .withHeader("Accept", equalTo("application/json")) + .willReturn(ok("{\n" + + " \"prop1\": 1,\n" + + " \"prop2\": 2\n" + + "}"))); + + Map inventory = api.getInventory(); + + assertThat(inventory.keySet().size(), is(2)); + assertThat(inventory.get("prop1"), is(1)); + assertThat(inventory.get("prop2"), is(2)); + } + + + /** + * Find purchase order by ID + *

    + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + */ + @Test + void getOrderByIdTest() { + String responseBody = "{\n" + + " \"id\": 1,\n" + + " \"petId\": 1,\n" + + " \"quantity\": 10,\n" + + " \"shipDate\": \"2120-03-23T01:23:44.000000009+0000\",\n" + + " \"status\": \"placed\",\n" + + " \"complete\": true\n" + + "}"; + + wm.stubFor(get(urlEqualTo("/store/order/123")) + .withHeader("Accept", equalTo("application/json")) + .willReturn(ok(responseBody))); + + Order order = api.getOrderById(123L); + + assertThat(order.getId(), is(1L)); + assertThat(order.getPetId(), is(1L)); + assertThat(order.getQuantity(), is(10)); + assertThat(order.getShipDate(), is(OffsetDateTime.of(2120, 03, 23, 01, 23, 44, 9, ZoneOffset.UTC))); + assertThat(order.getStatus(), is(Order.StatusEnum.PLACED)); + assertThat(order.isComplete(), is(true)); + } + + + /** + * Place an order for a pet + */ + @Test + void placeOrderTest() { + String responseBody = "{\n" + + " \"id\": 1,\n" + + " \"petId\": 1,\n" + + " \"quantity\": 10,\n" + + " \"shipDate\": \"2120-03-23T01:23:44.000000009+0000\",\n" + + " \"status\": \"placed\",\n" + + " \"complete\": true\n" + + "}"; + + Order newOrder = new Order(); + newOrder.setId(1L); + newOrder.setPetId(1L); + newOrder.setQuantity(10); + newOrder.shipDate(OffsetDateTime.of(2120, 03, 23, 01, 23, 44, 9, ZoneOffset.UTC)); + newOrder.setStatus(Order.StatusEnum.PLACED); + newOrder.setComplete(Boolean.TRUE); + + wm.stubFor(post(urlEqualTo("/store/order")) + .withHeader("Accept", equalTo("application/json")) + .willReturn(ok(responseBody))); + + Order order = api.placeOrder(newOrder); + + assertThat(order, is(newOrder)); + } - } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/UserApiTest.java index 2656fb4cc92..05914a1bc2a 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -1,24 +1,21 @@ package org.openapitools.client.api; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openapitools.client.ApiClient; import org.openapitools.client.model.User; -import org.junit.Before; -import org.junit.Test; -import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** * API tests for UserApi */ -public class UserApiTest { +class UserApiTest { private UserApi api; - @Before - public void setup() { + @BeforeEach + void setup() { api = new ApiClient().buildClient(UserApi.class); } @@ -29,7 +26,7 @@ public class UserApiTest { * This can only be done by the logged in user. */ @Test - public void createUserTest() { + void createUserTest() { User body = null; // api.createUser(body); @@ -43,7 +40,7 @@ public class UserApiTest { * */ @Test - public void createUsersWithArrayInputTest() { + void createUsersWithArrayInputTest() { List body = null; // api.createUsersWithArrayInput(body); @@ -57,7 +54,7 @@ public class UserApiTest { * */ @Test - public void createUsersWithListInputTest() { + void createUsersWithListInputTest() { List body = null; // api.createUsersWithListInput(body); @@ -71,7 +68,7 @@ public class UserApiTest { * This can only be done by the logged in user. */ @Test - public void deleteUserTest() { + void deleteUserTest() { String username = null; // api.deleteUser(username); @@ -85,7 +82,7 @@ public class UserApiTest { * */ @Test - public void getUserByNameTest() { + void getUserByNameTest() { String username = null; // User response = api.getUserByName(username); @@ -99,7 +96,7 @@ public class UserApiTest { * */ @Test - public void loginUserTest() { + void loginUserTest() { String username = null; String password = null; // String response = api.loginUser(username, password); @@ -116,7 +113,7 @@ public class UserApiTest { * listing them out individually. */ @Test - public void loginUserTestQueryMap() { + void loginUserTestQueryMap() { UserApi.LoginUserQueryParams queryParams = new UserApi.LoginUserQueryParams() .username(null) .password(null); @@ -131,7 +128,7 @@ public class UserApiTest { * */ @Test - public void logoutUserTest() { + void logoutUserTest() { // api.logoutUser(); // TODO: test validations @@ -144,7 +141,7 @@ public class UserApiTest { * This can only be done by the logged in user. */ @Test - public void updateUserTest() { + void updateUserTest() { String username = null; User body = null; // api.updateUser(username, body); diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java index ec44af78387..488179591e5 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -16,27 +16,26 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesAnyType */ -public class AdditionalPropertiesAnyTypeTest { +class AdditionalPropertiesAnyTypeTest { private final AdditionalPropertiesAnyType model = new AdditionalPropertiesAnyType(); /** * Model tests for AdditionalPropertiesAnyType */ @Test - public void testAdditionalPropertiesAnyType() { + void testAdditionalPropertiesAnyType() { // TODO: test AdditionalPropertiesAnyType } @@ -44,7 +43,7 @@ public class AdditionalPropertiesAnyTypeTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java index ceb024c5620..4a77e8b0461 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -16,28 +16,27 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesArray */ -public class AdditionalPropertiesArrayTest { +class AdditionalPropertiesArrayTest { private final AdditionalPropertiesArray model = new AdditionalPropertiesArray(); /** * Model tests for AdditionalPropertiesArray */ @Test - public void testAdditionalPropertiesArray() { + void testAdditionalPropertiesArray() { // TODO: test AdditionalPropertiesArray } @@ -45,7 +44,7 @@ public class AdditionalPropertiesArrayTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java index 517e5a10ae4..9a54e75aa25 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -16,27 +16,26 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesBoolean */ -public class AdditionalPropertiesBooleanTest { +class AdditionalPropertiesBooleanTest { private final AdditionalPropertiesBoolean model = new AdditionalPropertiesBoolean(); /** * Model tests for AdditionalPropertiesBoolean */ @Test - public void testAdditionalPropertiesBoolean() { + void testAdditionalPropertiesBoolean() { // TODO: test AdditionalPropertiesBoolean } @@ -44,7 +43,7 @@ public class AdditionalPropertiesBooleanTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 2e3844ba975..59f6bd24c55 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -16,6 +16,7 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -23,22 +24,20 @@ import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesClass */ -public class AdditionalPropertiesClassTest { +class AdditionalPropertiesClassTest { private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); /** * Model tests for AdditionalPropertiesClass */ @Test - public void testAdditionalPropertiesClass() { + void testAdditionalPropertiesClass() { // TODO: test AdditionalPropertiesClass } @@ -46,7 +45,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapString' */ @Test - public void mapStringTest() { + void mapStringTest() { // TODO: test mapString } @@ -54,7 +53,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapNumber' */ @Test - public void mapNumberTest() { + void mapNumberTest() { // TODO: test mapNumber } @@ -62,7 +61,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapInteger' */ @Test - public void mapIntegerTest() { + void mapIntegerTest() { // TODO: test mapInteger } @@ -70,7 +69,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapBoolean' */ @Test - public void mapBooleanTest() { + void mapBooleanTest() { // TODO: test mapBoolean } @@ -78,7 +77,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapArrayInteger' */ @Test - public void mapArrayIntegerTest() { + void mapArrayIntegerTest() { // TODO: test mapArrayInteger } @@ -86,7 +85,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapArrayAnytype' */ @Test - public void mapArrayAnytypeTest() { + void mapArrayAnytypeTest() { // TODO: test mapArrayAnytype } @@ -94,7 +93,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapMapString' */ @Test - public void mapMapStringTest() { + void mapMapStringTest() { // TODO: test mapMapString } @@ -102,7 +101,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'mapMapAnytype' */ @Test - public void mapMapAnytypeTest() { + void mapMapAnytypeTest() { // TODO: test mapMapAnytype } @@ -110,7 +109,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'anytype1' */ @Test - public void anytype1Test() { + void anytype1Test() { // TODO: test anytype1 } @@ -118,7 +117,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'anytype2' */ @Test - public void anytype2Test() { + void anytype2Test() { // TODO: test anytype2 } @@ -126,7 +125,7 @@ public class AdditionalPropertiesClassTest { * Test the property 'anytype3' */ @Test - public void anytype3Test() { + void anytype3Test() { // TODO: test anytype3 } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java index 66a7b85623e..f7c270286d0 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -16,27 +16,26 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesInteger */ -public class AdditionalPropertiesIntegerTest { +class AdditionalPropertiesIntegerTest { private final AdditionalPropertiesInteger model = new AdditionalPropertiesInteger(); /** * Model tests for AdditionalPropertiesInteger */ @Test - public void testAdditionalPropertiesInteger() { + void testAdditionalPropertiesInteger() { // TODO: test AdditionalPropertiesInteger } @@ -44,7 +43,7 @@ public class AdditionalPropertiesIntegerTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java index 4e03485a448..d8becbe8f04 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -16,28 +16,27 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesNumber */ -public class AdditionalPropertiesNumberTest { +class AdditionalPropertiesNumberTest { private final AdditionalPropertiesNumber model = new AdditionalPropertiesNumber(); /** * Model tests for AdditionalPropertiesNumber */ @Test - public void testAdditionalPropertiesNumber() { + void testAdditionalPropertiesNumber() { // TODO: test AdditionalPropertiesNumber } @@ -45,7 +44,7 @@ public class AdditionalPropertiesNumberTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java index e0c72c58634..80db912a75f 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -16,27 +16,26 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesObject */ -public class AdditionalPropertiesObjectTest { +class AdditionalPropertiesObjectTest { private final AdditionalPropertiesObject model = new AdditionalPropertiesObject(); /** * Model tests for AdditionalPropertiesObject */ @Test - public void testAdditionalPropertiesObject() { + void testAdditionalPropertiesObject() { // TODO: test AdditionalPropertiesObject } @@ -44,7 +43,7 @@ public class AdditionalPropertiesObjectTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java index c84d987e764..9968da35455 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -16,27 +16,26 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for AdditionalPropertiesString */ -public class AdditionalPropertiesStringTest { +class AdditionalPropertiesStringTest { private final AdditionalPropertiesString model = new AdditionalPropertiesString(); /** * Model tests for AdditionalPropertiesString */ @Test - public void testAdditionalPropertiesString() { + void testAdditionalPropertiesString() { // TODO: test AdditionalPropertiesString } @@ -44,7 +43,7 @@ public class AdditionalPropertiesStringTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AnimalTest.java index 7e79e5ca7b3..c8b84dd4f31 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -18,28 +18,27 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.BigCat; import org.openapitools.client.model.Cat; import org.openapitools.client.model.Dog; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for Animal */ -public class AnimalTest { +class AnimalTest { private final Animal model = new Animal(); /** * Model tests for Animal */ @Test - public void testAnimal() { + void testAnimal() { // TODO: test Animal } @@ -47,7 +46,7 @@ public class AnimalTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -55,7 +54,7 @@ public class AnimalTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index e25187a3b60..e07106af8ff 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -16,28 +16,27 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnlyTest { +class ArrayOfArrayOfNumberOnlyTest { private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); /** * Model tests for ArrayOfArrayOfNumberOnly */ @Test - public void testArrayOfArrayOfNumberOnly() { + void testArrayOfArrayOfNumberOnly() { // TODO: test ArrayOfArrayOfNumberOnly } @@ -45,7 +44,7 @@ public class ArrayOfArrayOfNumberOnlyTest { * Test the property 'arrayArrayNumber' */ @Test - public void arrayArrayNumberTest() { + void arrayArrayNumberTest() { // TODO: test arrayArrayNumber } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index ae106182399..0957f3f4adc 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -16,28 +16,27 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayOfNumberOnly */ -public class ArrayOfNumberOnlyTest { +class ArrayOfNumberOnlyTest { private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); /** * Model tests for ArrayOfNumberOnly */ @Test - public void testArrayOfNumberOnly() { + void testArrayOfNumberOnly() { // TODO: test ArrayOfNumberOnly } @@ -45,7 +44,7 @@ public class ArrayOfNumberOnlyTest { * Test the property 'arrayNumber' */ @Test - public void arrayNumberTest() { + void arrayNumberTest() { // TODO: test arrayNumber } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 36bd9951cf6..74b0886d6ad 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -16,28 +16,27 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for ArrayTest */ -public class ArrayTestTest { +class ArrayTestTest { private final ArrayTest model = new ArrayTest(); /** * Model tests for ArrayTest */ @Test - public void testArrayTest() { + void testArrayTest() { // TODO: test ArrayTest } @@ -45,7 +44,7 @@ public class ArrayTestTest { * Test the property 'arrayOfString' */ @Test - public void arrayOfStringTest() { + void arrayOfStringTest() { // TODO: test arrayOfString } @@ -53,7 +52,7 @@ public class ArrayTestTest { * Test the property 'arrayArrayOfInteger' */ @Test - public void arrayArrayOfIntegerTest() { + void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } @@ -61,7 +60,7 @@ public class ArrayTestTest { * Test the property 'arrayArrayOfModel' */ @Test - public void arrayArrayOfModelTest() { + void arrayArrayOfModelTest() { // TODO: test arrayArrayOfModel } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java index a9b13011f00..2b79d23bab3 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -16,25 +16,24 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for BigCatAllOf */ -public class BigCatAllOfTest { +class BigCatAllOfTest { private final BigCatAllOf model = new BigCatAllOf(); /** * Model tests for BigCatAllOf */ @Test - public void testBigCatAllOf() { + void testBigCatAllOf() { // TODO: test BigCatAllOf } @@ -42,7 +41,7 @@ public class BigCatAllOfTest { * Test the property 'kind' */ @Test - public void kindTest() { + void kindTest() { // TODO: test kind } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatTest.java index b3afa31d289..32af94c3981 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -18,27 +18,26 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.BigCatAllOf; import org.openapitools.client.model.Cat; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for BigCat */ -public class BigCatTest { +class BigCatTest { private final BigCat model = new BigCat(); /** * Model tests for BigCat */ @Test - public void testBigCat() { + void testBigCat() { // TODO: test BigCat } @@ -46,7 +45,7 @@ public class BigCatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -54,7 +53,7 @@ public class BigCatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -62,7 +61,7 @@ public class BigCatTest { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } @@ -70,7 +69,7 @@ public class BigCatTest { * Test the property 'kind' */ @Test - public void kindTest() { + void kindTest() { // TODO: test kind } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/CapitalizationTest.java index a701b341fc5..d91e81773ff 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -16,25 +16,24 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for Capitalization */ -public class CapitalizationTest { +class CapitalizationTest { private final Capitalization model = new Capitalization(); /** * Model tests for Capitalization */ @Test - public void testCapitalization() { + void testCapitalization() { // TODO: test Capitalization } @@ -42,7 +41,7 @@ public class CapitalizationTest { * Test the property 'smallCamel' */ @Test - public void smallCamelTest() { + void smallCamelTest() { // TODO: test smallCamel } @@ -50,7 +49,7 @@ public class CapitalizationTest { * Test the property 'capitalCamel' */ @Test - public void capitalCamelTest() { + void capitalCamelTest() { // TODO: test capitalCamel } @@ -58,7 +57,7 @@ public class CapitalizationTest { * Test the property 'smallSnake' */ @Test - public void smallSnakeTest() { + void smallSnakeTest() { // TODO: test smallSnake } @@ -66,7 +65,7 @@ public class CapitalizationTest { * Test the property 'capitalSnake' */ @Test - public void capitalSnakeTest() { + void capitalSnakeTest() { // TODO: test capitalSnake } @@ -74,7 +73,7 @@ public class CapitalizationTest { * Test the property 'scAETHFlowPoints' */ @Test - public void scAETHFlowPointsTest() { + void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } @@ -82,7 +81,7 @@ public class CapitalizationTest { * Test the property 'ATT_NAME' */ @Test - public void ATT_NAMETest() { + void ATT_NAMETest() { // TODO: test ATT_NAME } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/CatAllOfTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/CatAllOfTest.java index 1d85a044725..b13bcf1e7a1 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/CatAllOfTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/CatAllOfTest.java @@ -16,25 +16,24 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for CatAllOf */ -public class CatAllOfTest { +class CatAllOfTest { private final CatAllOf model = new CatAllOf(); /** * Model tests for CatAllOf */ @Test - public void testCatAllOf() { + void testCatAllOf() { // TODO: test CatAllOf } @@ -42,7 +41,7 @@ public class CatAllOfTest { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/CatTest.java index d0952b50100..f8f63d1f2eb 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/CatTest.java @@ -18,28 +18,27 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.BigCat; import org.openapitools.client.model.CatAllOf; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for Cat */ -public class CatTest { +class CatTest { private final Cat model = new Cat(); /** * Model tests for Cat */ @Test - public void testCat() { + void testCat() { // TODO: test Cat } @@ -47,7 +46,7 @@ public class CatTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -55,7 +54,7 @@ public class CatTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -63,7 +62,7 @@ public class CatTest { * Test the property 'declawed' */ @Test - public void declawedTest() { + void declawedTest() { // TODO: test declawed } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/CategoryTest.java index 6027994a2ac..22583f947c3 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -16,25 +16,24 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for Category */ -public class CategoryTest { +class CategoryTest { private final Category model = new Category(); /** * Model tests for Category */ @Test - public void testCategory() { + void testCategory() { // TODO: test Category } @@ -42,7 +41,7 @@ public class CategoryTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -50,7 +49,7 @@ public class CategoryTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ClassModelTest.java index 8914c9cad43..44d9611e0dc 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -16,25 +16,24 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for ClassModel */ -public class ClassModelTest { +class ClassModelTest { private final ClassModel model = new ClassModel(); /** * Model tests for ClassModel */ @Test - public void testClassModel() { + void testClassModel() { // TODO: test ClassModel } @@ -42,7 +41,7 @@ public class ClassModelTest { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ClientTest.java index c21b346272d..ff12463d5cf 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ClientTest.java @@ -16,25 +16,24 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for Client */ -public class ClientTest { +class ClientTest { private final Client model = new Client(); /** * Model tests for Client */ @Test - public void testClient() { + void testClient() { // TODO: test Client } @@ -42,7 +41,7 @@ public class ClientTest { * Test the property 'client' */ @Test - public void clientTest() { + void clientTest() { // TODO: test client } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/DogAllOfTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/DogAllOfTest.java index 6e4b4910809..ab8a1b63af4 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/DogAllOfTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/DogAllOfTest.java @@ -16,25 +16,24 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for DogAllOf */ -public class DogAllOfTest { +class DogAllOfTest { private final DogAllOf model = new DogAllOf(); /** * Model tests for DogAllOf */ @Test - public void testDogAllOf() { + void testDogAllOf() { // TODO: test DogAllOf } @@ -42,7 +41,7 @@ public class DogAllOfTest { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/DogTest.java index 3446815a300..705a0429377 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/DogTest.java @@ -18,27 +18,26 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.Animal; import org.openapitools.client.model.DogAllOf; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for Dog */ -public class DogTest { +class DogTest { private final Dog model = new Dog(); /** * Model tests for Dog */ @Test - public void testDog() { + void testDog() { // TODO: test Dog } @@ -46,7 +45,7 @@ public class DogTest { * Test the property 'className' */ @Test - public void classNameTest() { + void classNameTest() { // TODO: test className } @@ -54,7 +53,7 @@ public class DogTest { * Test the property 'color' */ @Test - public void colorTest() { + void colorTest() { // TODO: test color } @@ -62,7 +61,7 @@ public class DogTest { * Test the property 'breed' */ @Test - public void breedTest() { + void breedTest() { // TODO: test breed } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 45b8fbbd822..1ed1044bac9 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -16,27 +16,26 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for EnumArrays */ -public class EnumArraysTest { +class EnumArraysTest { private final EnumArrays model = new EnumArrays(); /** * Model tests for EnumArrays */ @Test - public void testEnumArrays() { + void testEnumArrays() { // TODO: test EnumArrays } @@ -44,7 +43,7 @@ public class EnumArraysTest { * Test the property 'justSymbol' */ @Test - public void justSymbolTest() { + void justSymbolTest() { // TODO: test justSymbol } @@ -52,7 +51,7 @@ public class EnumArraysTest { * Test the property 'arrayEnum' */ @Test - public void arrayEnumTest() { + void arrayEnumTest() { // TODO: test arrayEnum } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/EnumClassTest.java index 9e45543facd..55b946a9f7c 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -13,20 +13,18 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for EnumClass */ -public class EnumClassTest { +class EnumClassTest { /** * Model tests for EnumClass */ @Test - public void testEnumClass() { + void testEnumClass() { // TODO: test EnumClass } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/EnumTestTest.java index 04e7afb1978..c22b632038a 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -16,26 +16,25 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for EnumTest */ -public class EnumTestTest { +class EnumTestTest { private final EnumTest model = new EnumTest(); /** * Model tests for EnumTest */ @Test - public void testEnumTest() { + void testEnumTest() { // TODO: test EnumTest } @@ -43,7 +42,7 @@ public class EnumTestTest { * Test the property 'enumString' */ @Test - public void enumStringTest() { + void enumStringTest() { // TODO: test enumString } @@ -51,7 +50,7 @@ public class EnumTestTest { * Test the property 'enumStringRequired' */ @Test - public void enumStringRequiredTest() { + void enumStringRequiredTest() { // TODO: test enumStringRequired } @@ -59,7 +58,7 @@ public class EnumTestTest { * Test the property 'enumInteger' */ @Test - public void enumIntegerTest() { + void enumIntegerTest() { // TODO: test enumInteger } @@ -67,7 +66,7 @@ public class EnumTestTest { * Test the property 'enumNumber' */ @Test - public void enumNumberTest() { + void enumNumberTest() { // TODO: test enumNumber } @@ -75,7 +74,7 @@ public class EnumTestTest { * Test the property 'outerEnum' */ @Test - public void outerEnumTest() { + void outerEnumTest() { // TODO: test outerEnum } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index ef37e666be3..dc539f34554 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -16,27 +16,26 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for FileSchemaTestClass */ -public class FileSchemaTestClassTest { +class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); /** * Model tests for FileSchemaTestClass */ @Test - public void testFileSchemaTestClass() { + void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } @@ -44,7 +43,7 @@ public class FileSchemaTestClassTest { * Test the property 'file' */ @Test - public void fileTest() { + void fileTest() { // TODO: test file } @@ -52,7 +51,7 @@ public class FileSchemaTestClassTest { * Test the property 'files' */ @Test - public void filesTest() { + void filesTest() { // TODO: test files } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/FormatTestTest.java index 710501b51bd..fdc269f4259 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -16,6 +16,7 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -24,22 +25,20 @@ import java.math.BigDecimal; import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for FormatTest */ -public class FormatTestTest { +class FormatTestTest { private final FormatTest model = new FormatTest(); /** * Model tests for FormatTest */ @Test - public void testFormatTest() { + void testFormatTest() { // TODO: test FormatTest } @@ -47,7 +46,7 @@ public class FormatTestTest { * Test the property 'integer' */ @Test - public void integerTest() { + void integerTest() { // TODO: test integer } @@ -55,7 +54,7 @@ public class FormatTestTest { * Test the property 'int32' */ @Test - public void int32Test() { + void int32Test() { // TODO: test int32 } @@ -63,7 +62,7 @@ public class FormatTestTest { * Test the property 'int64' */ @Test - public void int64Test() { + void int64Test() { // TODO: test int64 } @@ -71,7 +70,7 @@ public class FormatTestTest { * Test the property 'number' */ @Test - public void numberTest() { + void numberTest() { // TODO: test number } @@ -79,7 +78,7 @@ public class FormatTestTest { * Test the property '_float' */ @Test - public void _floatTest() { + void _floatTest() { // TODO: test _float } @@ -87,7 +86,7 @@ public class FormatTestTest { * Test the property '_double' */ @Test - public void _doubleTest() { + void _doubleTest() { // TODO: test _double } @@ -95,7 +94,7 @@ public class FormatTestTest { * Test the property 'string' */ @Test - public void stringTest() { + void stringTest() { // TODO: test string } @@ -103,7 +102,7 @@ public class FormatTestTest { * Test the property '_byte' */ @Test - public void _byteTest() { + void _byteTest() { // TODO: test _byte } @@ -111,7 +110,7 @@ public class FormatTestTest { * Test the property 'binary' */ @Test - public void binaryTest() { + void binaryTest() { // TODO: test binary } @@ -119,7 +118,7 @@ public class FormatTestTest { * Test the property 'date' */ @Test - public void dateTest() { + void dateTest() { // TODO: test date } @@ -127,7 +126,7 @@ public class FormatTestTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -135,7 +134,7 @@ public class FormatTestTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -143,7 +142,7 @@ public class FormatTestTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -151,7 +150,7 @@ public class FormatTestTest { * Test the property 'bigDecimal' */ @Test - public void bigDecimalTest() { + void bigDecimalTest() { // TODO: test bigDecimal } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index e902c100383..224c1ad22b0 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -16,25 +16,24 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for HasOnlyReadOnly */ -public class HasOnlyReadOnlyTest { +class HasOnlyReadOnlyTest { private final HasOnlyReadOnly model = new HasOnlyReadOnly(); /** * Model tests for HasOnlyReadOnly */ @Test - public void testHasOnlyReadOnly() { + void testHasOnlyReadOnly() { // TODO: test HasOnlyReadOnly } @@ -42,7 +41,7 @@ public class HasOnlyReadOnlyTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -50,7 +49,7 @@ public class HasOnlyReadOnlyTest { * Test the property 'foo' */ @Test - public void fooTest() { + void fooTest() { // TODO: test foo } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/MapTestTest.java index a0c991bb758..21187f97510 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -16,28 +16,27 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for MapTest */ -public class MapTestTest { +class MapTestTest { private final MapTest model = new MapTest(); /** * Model tests for MapTest */ @Test - public void testMapTest() { + void testMapTest() { // TODO: test MapTest } @@ -45,7 +44,7 @@ public class MapTestTest { * Test the property 'mapMapOfString' */ @Test - public void mapMapOfStringTest() { + void mapMapOfStringTest() { // TODO: test mapMapOfString } @@ -53,7 +52,7 @@ public class MapTestTest { * Test the property 'mapOfEnumString' */ @Test - public void mapOfEnumStringTest() { + void mapOfEnumStringTest() { // TODO: test mapOfEnumString } @@ -61,7 +60,7 @@ public class MapTestTest { * Test the property 'directMap' */ @Test - public void directMapTest() { + void directMapTest() { // TODO: test directMap } @@ -69,7 +68,7 @@ public class MapTestTest { * Test the property 'indirectMap' */ @Test - public void indirectMapTest() { + void indirectMapTest() { // TODO: test indirectMap } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index f8a8c734baa..b2ce8721036 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -16,6 +16,7 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -25,22 +26,20 @@ import java.util.Map; import java.util.UUID; import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClassTest { +class MixedPropertiesAndAdditionalPropertiesClassTest { private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); /** * Model tests for MixedPropertiesAndAdditionalPropertiesClass */ @Test - public void testMixedPropertiesAndAdditionalPropertiesClass() { + void testMixedPropertiesAndAdditionalPropertiesClass() { // TODO: test MixedPropertiesAndAdditionalPropertiesClass } @@ -48,7 +47,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'uuid' */ @Test - public void uuidTest() { + void uuidTest() { // TODO: test uuid } @@ -56,7 +55,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'dateTime' */ @Test - public void dateTimeTest() { + void dateTimeTest() { // TODO: test dateTime } @@ -64,7 +63,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassTest { * Test the property 'map' */ @Test - public void mapTest() { + void mapTest() { // TODO: test map } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index 82c7208079d..0a0f7aa7554 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -16,25 +16,24 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for Model200Response */ -public class Model200ResponseTest { +class Model200ResponseTest { private final Model200Response model = new Model200Response(); /** * Model tests for Model200Response */ @Test - public void testModel200Response() { + void testModel200Response() { // TODO: test Model200Response } @@ -42,7 +41,7 @@ public class Model200ResponseTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -50,7 +49,7 @@ public class Model200ResponseTest { * Test the property 'propertyClass' */ @Test - public void propertyClassTest() { + void propertyClassTest() { // TODO: test propertyClass } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 97a1287aa41..9c746af8be0 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -16,25 +16,24 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for ModelApiResponse */ -public class ModelApiResponseTest { +class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); /** * Model tests for ModelApiResponse */ @Test - public void testModelApiResponse() { + void testModelApiResponse() { // TODO: test ModelApiResponse } @@ -42,7 +41,7 @@ public class ModelApiResponseTest { * Test the property 'code' */ @Test - public void codeTest() { + void codeTest() { // TODO: test code } @@ -50,7 +49,7 @@ public class ModelApiResponseTest { * Test the property 'type' */ @Test - public void typeTest() { + void typeTest() { // TODO: test type } @@ -58,7 +57,7 @@ public class ModelApiResponseTest { * Test the property 'message' */ @Test - public void messageTest() { + void messageTest() { // TODO: test message } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelReturnTest.java index f884519ebc8..e1bddc25f2d 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -16,25 +16,24 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for ModelReturn */ -public class ModelReturnTest { +class ModelReturnTest { private final ModelReturn model = new ModelReturn(); /** * Model tests for ModelReturn */ @Test - public void testModelReturn() { + void testModelReturn() { // TODO: test ModelReturn } @@ -42,7 +41,7 @@ public class ModelReturnTest { * Test the property '_return' */ @Test - public void _returnTest() { + void _returnTest() { // TODO: test _return } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/NameTest.java index cb3a94cf74a..13ae33a2084 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/NameTest.java @@ -16,25 +16,24 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for Name */ -public class NameTest { +class NameTest { private final Name model = new Name(); /** * Model tests for Name */ @Test - public void testName() { + void testName() { // TODO: test Name } @@ -42,7 +41,7 @@ public class NameTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -50,7 +49,7 @@ public class NameTest { * Test the property 'snakeCase' */ @Test - public void snakeCaseTest() { + void snakeCaseTest() { // TODO: test snakeCase } @@ -58,7 +57,7 @@ public class NameTest { * Test the property 'property' */ @Test - public void propertyTest() { + void propertyTest() { // TODO: test property } @@ -66,7 +65,7 @@ public class NameTest { * Test the property '_123number' */ @Test - public void _123numberTest() { + void _123numberTest() { // TODO: test _123number } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index f4fbd5ee8b4..4a600363e15 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -16,26 +16,25 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for NumberOnly */ -public class NumberOnlyTest { +class NumberOnlyTest { private final NumberOnly model = new NumberOnly(); /** * Model tests for NumberOnly */ @Test - public void testNumberOnly() { + void testNumberOnly() { // TODO: test NumberOnly } @@ -43,7 +42,7 @@ public class NumberOnlyTest { * Test the property 'justNumber' */ @Test - public void justNumberTest() { + void justNumberTest() { // TODO: test justNumber } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/OrderTest.java index d24c8479f5d..f84bff7dca9 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/OrderTest.java @@ -16,26 +16,25 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.threeten.bp.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for Order */ -public class OrderTest { +class OrderTest { private final Order model = new Order(); /** * Model tests for Order */ @Test - public void testOrder() { + void testOrder() { // TODO: test Order } @@ -43,7 +42,7 @@ public class OrderTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -51,7 +50,7 @@ public class OrderTest { * Test the property 'petId' */ @Test - public void petIdTest() { + void petIdTest() { // TODO: test petId } @@ -59,7 +58,7 @@ public class OrderTest { * Test the property 'quantity' */ @Test - public void quantityTest() { + void quantityTest() { // TODO: test quantity } @@ -67,7 +66,7 @@ public class OrderTest { * Test the property 'shipDate' */ @Test - public void shipDateTest() { + void shipDateTest() { // TODO: test shipDate } @@ -75,7 +74,7 @@ public class OrderTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } @@ -83,7 +82,7 @@ public class OrderTest { * Test the property 'complete' */ @Test - public void completeTest() { + void completeTest() { // TODO: test complete } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index ebea3ca304c..c42f4fd0478 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -16,26 +16,25 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for OuterComposite */ -public class OuterCompositeTest { +class OuterCompositeTest { private final OuterComposite model = new OuterComposite(); /** * Model tests for OuterComposite */ @Test - public void testOuterComposite() { + void testOuterComposite() { // TODO: test OuterComposite } @@ -43,7 +42,7 @@ public class OuterCompositeTest { * Test the property 'myNumber' */ @Test - public void myNumberTest() { + void myNumberTest() { // TODO: test myNumber } @@ -51,7 +50,7 @@ public class OuterCompositeTest { * Test the property 'myString' */ @Test - public void myStringTest() { + void myStringTest() { // TODO: test myString } @@ -59,7 +58,7 @@ public class OuterCompositeTest { * Test the property 'myBoolean' */ @Test - public void myBooleanTest() { + void myBooleanTest() { // TODO: test myBoolean } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/OuterEnumTest.java index cf0ebae0faf..fd8833deb8b 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -13,20 +13,18 @@ package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for OuterEnum */ -public class OuterEnumTest { +class OuterEnumTest { /** * Model tests for OuterEnum */ @Test - public void testOuterEnum() { + void testOuterEnum() { // TODO: test OuterEnum } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/PetTest.java index 4065f7ca1a4..f7276f8e317 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/PetTest.java @@ -16,6 +16,7 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -25,22 +26,20 @@ import java.util.List; import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for Pet */ -public class PetTest { +class PetTest { private final Pet model = new Pet(); /** * Model tests for Pet */ @Test - public void testPet() { + void testPet() { // TODO: test Pet } @@ -48,7 +47,7 @@ public class PetTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -56,7 +55,7 @@ public class PetTest { * Test the property 'category' */ @Test - public void categoryTest() { + void categoryTest() { // TODO: test category } @@ -64,7 +63,7 @@ public class PetTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } @@ -72,7 +71,7 @@ public class PetTest { * Test the property 'photoUrls' */ @Test - public void photoUrlsTest() { + void photoUrlsTest() { // TODO: test photoUrls } @@ -80,7 +79,7 @@ public class PetTest { * Test the property 'tags' */ @Test - public void tagsTest() { + void tagsTest() { // TODO: test tags } @@ -88,7 +87,7 @@ public class PetTest { * Test the property 'status' */ @Test - public void statusTest() { + void statusTest() { // TODO: test status } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index b82a7d0ef56..a8dd8e92722 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -16,25 +16,24 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for ReadOnlyFirst */ -public class ReadOnlyFirstTest { +class ReadOnlyFirstTest { private final ReadOnlyFirst model = new ReadOnlyFirst(); /** * Model tests for ReadOnlyFirst */ @Test - public void testReadOnlyFirst() { + void testReadOnlyFirst() { // TODO: test ReadOnlyFirst } @@ -42,7 +41,7 @@ public class ReadOnlyFirstTest { * Test the property 'bar' */ @Test - public void barTest() { + void barTest() { // TODO: test bar } @@ -50,7 +49,7 @@ public class ReadOnlyFirstTest { * Test the property 'baz' */ @Test - public void bazTest() { + void bazTest() { // TODO: test baz } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index d5a19c371e6..028705916ee 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -16,25 +16,24 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for SpecialModelName */ -public class SpecialModelNameTest { +class SpecialModelNameTest { private final SpecialModelName model = new SpecialModelName(); /** * Model tests for SpecialModelName */ @Test - public void testSpecialModelName() { + void testSpecialModelName() { // TODO: test SpecialModelName } @@ -42,7 +41,7 @@ public class SpecialModelNameTest { * Test the property '$specialPropertyName' */ @Test - public void $specialPropertyNameTest() { + void $specialPropertyNameTest() { // TODO: test $specialPropertyName } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/TagTest.java index 5c2cc6f49e0..174a9319f89 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/TagTest.java @@ -16,25 +16,24 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for Tag */ -public class TagTest { +class TagTest { private final Tag model = new Tag(); /** * Model tests for Tag */ @Test - public void testTag() { + void testTag() { // TODO: test Tag } @@ -42,7 +41,7 @@ public class TagTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -50,7 +49,7 @@ public class TagTest { * Test the property 'name' */ @Test - public void nameTest() { + void nameTest() { // TODO: test name } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java index e96ac744439..f425fc23a78 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -16,28 +16,27 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderDefault */ -public class TypeHolderDefaultTest { +class TypeHolderDefaultTest { private final TypeHolderDefault model = new TypeHolderDefault(); /** * Model tests for TypeHolderDefault */ @Test - public void testTypeHolderDefault() { + void testTypeHolderDefault() { // TODO: test TypeHolderDefault } @@ -45,7 +44,7 @@ public class TypeHolderDefaultTest { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -53,7 +52,7 @@ public class TypeHolderDefaultTest { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -61,7 +60,7 @@ public class TypeHolderDefaultTest { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -69,7 +68,7 @@ public class TypeHolderDefaultTest { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -77,7 +76,7 @@ public class TypeHolderDefaultTest { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java index 56641d163a5..3c67b8b650f 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -16,28 +16,27 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for TypeHolderExample */ -public class TypeHolderExampleTest { +class TypeHolderExampleTest { private final TypeHolderExample model = new TypeHolderExample(); /** * Model tests for TypeHolderExample */ @Test - public void testTypeHolderExample() { + void testTypeHolderExample() { // TODO: test TypeHolderExample } @@ -45,7 +44,7 @@ public class TypeHolderExampleTest { * Test the property 'stringItem' */ @Test - public void stringItemTest() { + void stringItemTest() { // TODO: test stringItem } @@ -53,7 +52,7 @@ public class TypeHolderExampleTest { * Test the property 'numberItem' */ @Test - public void numberItemTest() { + void numberItemTest() { // TODO: test numberItem } @@ -61,7 +60,7 @@ public class TypeHolderExampleTest { * Test the property 'floatItem' */ @Test - public void floatItemTest() { + void floatItemTest() { // TODO: test floatItem } @@ -69,7 +68,7 @@ public class TypeHolderExampleTest { * Test the property 'integerItem' */ @Test - public void integerItemTest() { + void integerItemTest() { // TODO: test integerItem } @@ -77,7 +76,7 @@ public class TypeHolderExampleTest { * Test the property 'boolItem' */ @Test - public void boolItemTest() { + void boolItemTest() { // TODO: test boolItem } @@ -85,7 +84,7 @@ public class TypeHolderExampleTest { * Test the property 'arrayItem' */ @Test - public void arrayItemTest() { + void arrayItemTest() { // TODO: test arrayItem } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/UserTest.java index ce40d3a2a63..f01cfceed72 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/UserTest.java @@ -16,25 +16,24 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for User */ -public class UserTest { +class UserTest { private final User model = new User(); /** * Model tests for User */ @Test - public void testUser() { + void testUser() { // TODO: test User } @@ -42,7 +41,7 @@ public class UserTest { * Test the property 'id' */ @Test - public void idTest() { + void idTest() { // TODO: test id } @@ -50,7 +49,7 @@ public class UserTest { * Test the property 'username' */ @Test - public void usernameTest() { + void usernameTest() { // TODO: test username } @@ -58,7 +57,7 @@ public class UserTest { * Test the property 'firstName' */ @Test - public void firstNameTest() { + void firstNameTest() { // TODO: test firstName } @@ -66,7 +65,7 @@ public class UserTest { * Test the property 'lastName' */ @Test - public void lastNameTest() { + void lastNameTest() { // TODO: test lastName } @@ -74,7 +73,7 @@ public class UserTest { * Test the property 'email' */ @Test - public void emailTest() { + void emailTest() { // TODO: test email } @@ -82,7 +81,7 @@ public class UserTest { * Test the property 'password' */ @Test - public void passwordTest() { + void passwordTest() { // TODO: test password } @@ -90,7 +89,7 @@ public class UserTest { * Test the property 'phone' */ @Test - public void phoneTest() { + void phoneTest() { // TODO: test phone } @@ -98,7 +97,7 @@ public class UserTest { * Test the property 'userStatus' */ @Test - public void userStatusTest() { + void userStatusTest() { // TODO: test userStatus } diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/XmlItemTest.java index 501c414555f..6649fefb885 100644 --- a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -16,28 +16,27 @@ package org.openapitools.client.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Model tests for XmlItem */ -public class XmlItemTest { +class XmlItemTest { private final XmlItem model = new XmlItem(); /** * Model tests for XmlItem */ @Test - public void testXmlItem() { + void testXmlItem() { // TODO: test XmlItem } @@ -45,7 +44,7 @@ public class XmlItemTest { * Test the property 'attributeString' */ @Test - public void attributeStringTest() { + void attributeStringTest() { // TODO: test attributeString } @@ -53,7 +52,7 @@ public class XmlItemTest { * Test the property 'attributeNumber' */ @Test - public void attributeNumberTest() { + void attributeNumberTest() { // TODO: test attributeNumber } @@ -61,7 +60,7 @@ public class XmlItemTest { * Test the property 'attributeInteger' */ @Test - public void attributeIntegerTest() { + void attributeIntegerTest() { // TODO: test attributeInteger } @@ -69,7 +68,7 @@ public class XmlItemTest { * Test the property 'attributeBoolean' */ @Test - public void attributeBooleanTest() { + void attributeBooleanTest() { // TODO: test attributeBoolean } @@ -77,7 +76,7 @@ public class XmlItemTest { * Test the property 'wrappedArray' */ @Test - public void wrappedArrayTest() { + void wrappedArrayTest() { // TODO: test wrappedArray } @@ -85,7 +84,7 @@ public class XmlItemTest { * Test the property 'nameString' */ @Test - public void nameStringTest() { + void nameStringTest() { // TODO: test nameString } @@ -93,7 +92,7 @@ public class XmlItemTest { * Test the property 'nameNumber' */ @Test - public void nameNumberTest() { + void nameNumberTest() { // TODO: test nameNumber } @@ -101,7 +100,7 @@ public class XmlItemTest { * Test the property 'nameInteger' */ @Test - public void nameIntegerTest() { + void nameIntegerTest() { // TODO: test nameInteger } @@ -109,7 +108,7 @@ public class XmlItemTest { * Test the property 'nameBoolean' */ @Test - public void nameBooleanTest() { + void nameBooleanTest() { // TODO: test nameBoolean } @@ -117,7 +116,7 @@ public class XmlItemTest { * Test the property 'nameArray' */ @Test - public void nameArrayTest() { + void nameArrayTest() { // TODO: test nameArray } @@ -125,7 +124,7 @@ public class XmlItemTest { * Test the property 'nameWrappedArray' */ @Test - public void nameWrappedArrayTest() { + void nameWrappedArrayTest() { // TODO: test nameWrappedArray } @@ -133,7 +132,7 @@ public class XmlItemTest { * Test the property 'prefixString' */ @Test - public void prefixStringTest() { + void prefixStringTest() { // TODO: test prefixString } @@ -141,7 +140,7 @@ public class XmlItemTest { * Test the property 'prefixNumber' */ @Test - public void prefixNumberTest() { + void prefixNumberTest() { // TODO: test prefixNumber } @@ -149,7 +148,7 @@ public class XmlItemTest { * Test the property 'prefixInteger' */ @Test - public void prefixIntegerTest() { + void prefixIntegerTest() { // TODO: test prefixInteger } @@ -157,7 +156,7 @@ public class XmlItemTest { * Test the property 'prefixBoolean' */ @Test - public void prefixBooleanTest() { + void prefixBooleanTest() { // TODO: test prefixBoolean } @@ -165,7 +164,7 @@ public class XmlItemTest { * Test the property 'prefixArray' */ @Test - public void prefixArrayTest() { + void prefixArrayTest() { // TODO: test prefixArray } @@ -173,7 +172,7 @@ public class XmlItemTest { * Test the property 'prefixWrappedArray' */ @Test - public void prefixWrappedArrayTest() { + void prefixWrappedArrayTest() { // TODO: test prefixWrappedArray } @@ -181,7 +180,7 @@ public class XmlItemTest { * Test the property 'namespaceString' */ @Test - public void namespaceStringTest() { + void namespaceStringTest() { // TODO: test namespaceString } @@ -189,7 +188,7 @@ public class XmlItemTest { * Test the property 'namespaceNumber' */ @Test - public void namespaceNumberTest() { + void namespaceNumberTest() { // TODO: test namespaceNumber } @@ -197,7 +196,7 @@ public class XmlItemTest { * Test the property 'namespaceInteger' */ @Test - public void namespaceIntegerTest() { + void namespaceIntegerTest() { // TODO: test namespaceInteger } @@ -205,7 +204,7 @@ public class XmlItemTest { * Test the property 'namespaceBoolean' */ @Test - public void namespaceBooleanTest() { + void namespaceBooleanTest() { // TODO: test namespaceBoolean } @@ -213,7 +212,7 @@ public class XmlItemTest { * Test the property 'namespaceArray' */ @Test - public void namespaceArrayTest() { + void namespaceArrayTest() { // TODO: test namespaceArray } @@ -221,7 +220,7 @@ public class XmlItemTest { * Test the property 'namespaceWrappedArray' */ @Test - public void namespaceWrappedArrayTest() { + void namespaceWrappedArrayTest() { // TODO: test namespaceWrappedArray } @@ -229,7 +228,7 @@ public class XmlItemTest { * Test the property 'prefixNsString' */ @Test - public void prefixNsStringTest() { + void prefixNsStringTest() { // TODO: test prefixNsString } @@ -237,7 +236,7 @@ public class XmlItemTest { * Test the property 'prefixNsNumber' */ @Test - public void prefixNsNumberTest() { + void prefixNsNumberTest() { // TODO: test prefixNsNumber } @@ -245,7 +244,7 @@ public class XmlItemTest { * Test the property 'prefixNsInteger' */ @Test - public void prefixNsIntegerTest() { + void prefixNsIntegerTest() { // TODO: test prefixNsInteger } @@ -253,7 +252,7 @@ public class XmlItemTest { * Test the property 'prefixNsBoolean' */ @Test - public void prefixNsBooleanTest() { + void prefixNsBooleanTest() { // TODO: test prefixNsBoolean } @@ -261,7 +260,7 @@ public class XmlItemTest { * Test the property 'prefixNsArray' */ @Test - public void prefixNsArrayTest() { + void prefixNsArrayTest() { // TODO: test prefixNsArray } @@ -269,7 +268,7 @@ public class XmlItemTest { * Test the property 'prefixNsWrappedArray' */ @Test - public void prefixNsWrappedArrayTest() { + void prefixNsWrappedArrayTest() { // TODO: test prefixNsWrappedArray } diff --git a/samples/client/petstore/java/feign/src/test/resources/logback-test.xml b/samples/client/petstore/java/feign/src/test/resources/logback-test.xml new file mode 100644 index 00000000000..b31d58ec211 --- /dev/null +++ b/samples/client/petstore/java/feign/src/test/resources/logback-test.xml @@ -0,0 +1,10 @@ + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + \ No newline at end of file diff --git a/samples/client/petstore/java/feign/src/test/resources/pet.json b/samples/client/petstore/java/feign/src/test/resources/pet.json new file mode 100644 index 00000000000..4f2876a1031 --- /dev/null +++ b/samples/client/petstore/java/feign/src/test/resources/pet.json @@ -0,0 +1,18 @@ +{ + "id": 85, + "category": { + "id": 1, + "name": "Dogs" + }, + "name": "LvRcat", + "photoUrls": [ + "string" + ], + "tags": [ + { + "id": 10, + "name": "tag" + } + ], + "status": "available" +} \ No newline at end of file diff --git a/samples/client/petstore/java/feign/src/test/resources/pet_list.json b/samples/client/petstore/java/feign/src/test/resources/pet_list.json new file mode 100644 index 00000000000..da340e03c7c --- /dev/null +++ b/samples/client/petstore/java/feign/src/test/resources/pet_list.json @@ -0,0 +1,38 @@ +[ + { + "id": 85, + "category": { + "id": 1, + "name": "Dogs" + }, + "name": "LvRcat", + "photoUrls": [ + "string" + ], + "tags": [ + { + "id": 10, + "name": "tag" + } + ], + "status": "available" + }, + { + "id": 42, + "category": { + "id": 1, + "name": "Dogs" + }, + "name": "Louise", + "photoUrls": [ + "photo" + ], + "tags": [ + { + "id": 0, + "name": "obedient" + } + ], + "status": "sold" + } +] \ No newline at end of file diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 497124467a2..366143d1fc0 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index d638cd95bf4..7a5e9587e65 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 5ce0e7937f5..8f017af3507 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index dca8ec41b68..e442eea3121 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -447,7 +447,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index e7f70c5fb0d..8e85dd20fe7 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index e96cab6e53e..50db851ff00 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index fb48dd0c264..b6fcfc25ba8 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 932cfecb044..20bbfd1117d 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java index 6f15310fd8c..c33e153c751 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java @@ -120,7 +120,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 27ce18d552d..459f4602965 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -90,7 +90,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index b6d3b256a24..8becb8dd2b0 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -90,7 +90,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java index 38399bfe582..8747730a9dd 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -166,7 +166,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java index c000e826f31..ccfdc5a5ec0 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java @@ -125,7 +125,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 81a5b56ed64..481e22e0df1 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -118,7 +118,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java index 27d2258b3fa..2065be194db 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java @@ -229,7 +229,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java index d04c3ecd1a5..10d8036c414 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java @@ -90,7 +90,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java index 153873956c9..38910bf5c69 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -79,7 +79,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java index ddd999f84c6..3737dbb3c3e 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java @@ -108,7 +108,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java index 3e2216e6ae4..227bdaae556 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java @@ -80,7 +80,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java index 2147430592b..9fea8958838 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java @@ -79,7 +79,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java index 559b170c4f7..d54ac1b7a2f 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java @@ -86,7 +86,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java index 9f3d303c1ab..449c4e6f051 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -79,7 +79,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java index c38d53553cb..4944b28bdfe 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -189,7 +189,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java index bc6ce93c566..7589d69aa6d 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java @@ -343,7 +343,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index f427cf921f6..074b99080e7 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -119,7 +119,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java index 23f3e20db17..5f8a894641d 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java @@ -480,7 +480,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index bd976488179..4f7e8a75ca2 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -91,7 +91,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java index 1271533e5be..b5921775cfd 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java @@ -239,7 +239,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index fdb9393a657..dbb1682a919 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -153,7 +153,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java index 6bba2623f4b..bc3bee0e09a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java @@ -110,7 +110,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 97921db1707..47f88db907b 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -139,7 +139,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java index f28c2ac46ea..1b2a532f60c 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -80,7 +80,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java index 7ba7d886ce2..1da9e1433c1 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java @@ -151,7 +151,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java index 54be0a4cbf0..d1f21fa5942 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -80,7 +80,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java index a8396385767..ef256856406 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java @@ -267,7 +267,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java index bfea026235e..32db00927cb 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -140,7 +140,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java index 2ac06b78334..fca1a5141de 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java @@ -283,7 +283,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 455300cd7f8..f866409c5bd 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -100,7 +100,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java index ac1bfcbd846..2a7c39ec8e8 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -79,7 +79,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java index a95f8f4a4d8..9630d272242 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java @@ -109,7 +109,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 53bf7905e15..5e13ac4ab73 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -202,7 +202,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 68fa374847d..7b89d392f5e 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -231,7 +231,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java index 49ed08dff9a..ba6825df44e 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java @@ -289,7 +289,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java index 1067826b0d5..1a621d2e710 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java @@ -994,7 +994,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/auth/OAuthFlow.java index b2d11ff0c4f..75c2a0c9740 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -13,6 +13,10 @@ package org.openapitools.client.auth; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public enum OAuthFlow { - accessCode, implicit, password, application + accessCode, //called authorizationCode in OpenAPI 3.0 + implicit, + password, + application //called clientCredentials in OpenAPI 3.0 } diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 497124467a2..366143d1fc0 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index d638cd95bf4..7a5e9587e65 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 5ce0e7937f5..8f017af3507 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index dca8ec41b68..e442eea3121 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -447,7 +447,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index e7f70c5fb0d..8e85dd20fe7 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index e96cab6e53e..50db851ff00 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index fb48dd0c264..b6fcfc25ba8 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 932cfecb044..20bbfd1117d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java index 6f15310fd8c..c33e153c751 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java @@ -120,7 +120,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 27ce18d552d..459f4602965 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -90,7 +90,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index b6d3b256a24..8becb8dd2b0 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -90,7 +90,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java index 38399bfe582..8747730a9dd 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -166,7 +166,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java index c000e826f31..ccfdc5a5ec0 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java @@ -125,7 +125,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 81a5b56ed64..481e22e0df1 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -118,7 +118,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java index 27d2258b3fa..2065be194db 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java @@ -229,7 +229,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java index d04c3ecd1a5..10d8036c414 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java @@ -90,7 +90,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java index 153873956c9..38910bf5c69 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -79,7 +79,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java index ddd999f84c6..3737dbb3c3e 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java @@ -108,7 +108,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java index 3e2216e6ae4..227bdaae556 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java @@ -80,7 +80,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java index 2147430592b..9fea8958838 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java @@ -79,7 +79,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java index 559b170c4f7..d54ac1b7a2f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java @@ -86,7 +86,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java index 9f3d303c1ab..449c4e6f051 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -79,7 +79,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java index c38d53553cb..4944b28bdfe 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -189,7 +189,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java index bc6ce93c566..7589d69aa6d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java @@ -343,7 +343,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index f427cf921f6..074b99080e7 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -119,7 +119,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java index 23f3e20db17..5f8a894641d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java @@ -480,7 +480,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index bd976488179..4f7e8a75ca2 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -91,7 +91,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java index 1271533e5be..b5921775cfd 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java @@ -239,7 +239,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index fdb9393a657..dbb1682a919 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -153,7 +153,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java index 6bba2623f4b..bc3bee0e09a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java @@ -110,7 +110,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 97921db1707..47f88db907b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -139,7 +139,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java index f28c2ac46ea..1b2a532f60c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -80,7 +80,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java index 7ba7d886ce2..1da9e1433c1 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java @@ -151,7 +151,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java index 54be0a4cbf0..d1f21fa5942 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -80,7 +80,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java index a8396385767..ef256856406 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java @@ -267,7 +267,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java index bfea026235e..32db00927cb 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -140,7 +140,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java index 2ac06b78334..fca1a5141de 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java @@ -283,7 +283,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 455300cd7f8..f866409c5bd 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -100,7 +100,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java index ac1bfcbd846..2a7c39ec8e8 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -79,7 +79,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java index a95f8f4a4d8..9630d272242 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java @@ -109,7 +109,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 53bf7905e15..5e13ac4ab73 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -202,7 +202,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 68fa374847d..7b89d392f5e 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -231,7 +231,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java index 49ed08dff9a..ba6825df44e 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java @@ -289,7 +289,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java index 1067826b0d5..1a621d2e710 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java @@ -994,7 +994,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 740de102c29..3a706ce98a6 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -126,7 +126,6 @@ public class AdditionalPropertiesAnyType { return Objects.hash(name, additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 7985dee01f1..f95cac6fed2 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -127,7 +127,6 @@ public class AdditionalPropertiesArray { return Objects.hash(name, additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 86651dbdbff..07fd09b9ba5 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -126,7 +126,6 @@ public class AdditionalPropertiesBoolean { return Objects.hash(name, additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 0e6c3466c4a..7f70d66a225 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -442,7 +442,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 296cea62414..bb3cc4c137e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -126,7 +126,6 @@ public class AdditionalPropertiesInteger { return Objects.hash(name, additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index a4995cfe4d1..615fc444024 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -127,7 +127,6 @@ public class AdditionalPropertiesNumber { return Objects.hash(name, additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 4fedc69e241..3d831e6773d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -127,7 +127,6 @@ public class AdditionalPropertiesObject { return Objects.hash(name, additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 633081f6c49..2d575cb6d7e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -126,7 +126,6 @@ public class AdditionalPropertiesString { return Objects.hash(name, additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java index be20ac938ce..c24cbfda1a7 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java @@ -124,7 +124,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 61e776b5a47..9e5c4c6492f 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -95,7 +95,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 57efee4d2d1..45fd7829c9e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -95,7 +95,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java index d903e38a4c1..db796d93d47 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -169,7 +169,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java index 44ea5765415..ccccfb60e3a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java @@ -130,7 +130,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java index e0015b42cb9..015fe219045 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -123,7 +123,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java index a9dea7ecdf0..e368f955e7d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java @@ -229,7 +229,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java index 69c4c5e4314..46cf35becd4 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java @@ -95,7 +95,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java index 03f58bfd5b1..54e6b24cdb0 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -84,7 +84,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java index ee4737e8d35..ea4ceb96ec0 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java @@ -112,7 +112,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java index c8ae7f8a76e..700ba2f17b7 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java @@ -85,7 +85,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java index dab78b57cd5..e7c0e00398d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java @@ -84,7 +84,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java index db448c6c57b..e7e9d204f85 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java @@ -91,7 +91,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java index a9c704f742e..086058c0a71 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -84,7 +84,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java index 7dca4022c01..3ec9f891572 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -193,7 +193,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index c48a00dd28b..c58502ef21d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -344,7 +344,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index accd424c2af..c60d469c297 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -123,7 +123,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java index 87fd7af0b49..acaafa9d535 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java @@ -472,7 +472,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index c97c586db81..7bba0219b1c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -97,7 +97,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java index f1cc1f76952..82b45777945 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java @@ -241,7 +241,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 11744f59e90..1391207e425 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -156,7 +156,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java index 8dc189bc731..6f8ab9af771 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java @@ -114,7 +114,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 6526672a02e..6fca2b9dcb6 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -142,7 +142,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java index a70aae4ecd8..00ca2754808 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -85,7 +85,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java index 6654394f0f9..40e242f6aba 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java @@ -155,7 +155,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java index ccc4d7f9696..bfb345fc28f 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -85,7 +85,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java index c23472d7675..6db255687ba 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java @@ -267,7 +267,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java index 86250c03b98..f1425c4a848 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -143,7 +143,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java index 8de9e4e212d..8d7d3414dab 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java @@ -283,7 +283,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e3a4e82ff20..22495675ccb 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -105,7 +105,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java index 73b3d0ffc48..c3ecc1b7916 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -84,7 +84,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java index 58d7e848629..9080c1b7b20 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java @@ -113,7 +113,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 06012d611e1..612dc13ba92 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -203,7 +203,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 7e615c2ea63..a2e72e41cf3 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -231,7 +231,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java index 36a8c958c88..dfa70476af3 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java @@ -287,7 +287,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java index 0bd142f494b..c5c0b271502 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java @@ -971,7 +971,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/OAuthFlow.java index b2d11ff0c4f..75c2a0c9740 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -13,6 +13,10 @@ package org.openapitools.client.auth; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public enum OAuthFlow { - accessCode, implicit, password, application + accessCode, //called authorizationCode in OpenAPI 3.0 + implicit, + password, + application //called clientCredentials in OpenAPI 3.0 } 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 f79a901b71d..acb0175c213 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 @@ -77,7 +77,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 3a728a76023..90e9afca2f0 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 @@ -78,7 +78,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 2bd69aca4ab..f6e70331f6e 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 @@ -77,7 +77,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 077571ff8df..0495881506d 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 @@ -422,7 +422,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 e38eb418615..208dfdbc15f 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 @@ -77,7 +77,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 ba5b2b9b2cf..b008b847a7e 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 @@ -78,7 +78,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 4a236c28685..c2ce3b2fbe2 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 @@ -77,7 +77,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 fa11b0dc474..dcecf6e69dd 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 @@ -77,7 +77,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 6ba2cfafee7..67e9a14d06e 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 @@ -107,7 +107,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 fbc5067ee70..7e3ba8195c7 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 @@ -85,7 +85,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 72f6fee00ff..279edaea8a7 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 @@ -85,7 +85,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 4c9e81e8468..b1bfac1da86 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 @@ -157,7 +157,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 6fa51b1bde4..ee503f76942 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 @@ -131,7 +131,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 99b2714b1b4..a6bdb2bbe3f 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 @@ -125,7 +125,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 a18fd8ffdb0..42909659d9c 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 @@ -214,7 +214,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 a3a7ba7eba7..19705043a2f 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 @@ -81,7 +81,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 eede69dd633..6be8b4534b1 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 @@ -74,7 +74,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 e19b0174656..bc1672714e2 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 @@ -101,7 +101,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 29fd53f9c88..f43b881b90c 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 @@ -75,7 +75,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 4a40b04cd47..1702dbadd88 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 @@ -74,7 +74,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 02bd48cfa5e..5c80057e78e 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 @@ -80,7 +80,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 c76faa74e38..9e311a1f6af 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 @@ -74,7 +74,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 0ff5e9216ff..9a9c2f1a59a 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 @@ -206,7 +206,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 49527493f6a..7f325519f9b 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 @@ -378,7 +378,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 40a72877e62..a6c4008d1e9 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 @@ -112,7 +112,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 b5e841ec1d9..7809f39132a 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 @@ -449,7 +449,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 6b4d1f20626..7f915754ffa 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 @@ -84,7 +84,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 94379fa3137..f8fedfcde0c 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 @@ -240,7 +240,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 ced17913313..0c225d1f6cd 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 @@ -144,7 +144,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 e5e0c759fc9..f11d9e5d570 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 @@ -103,7 +103,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 ef176e1bd10..595d829ad8d 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 @@ -130,7 +130,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 ea05ccfecde..dc27972cb67 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 @@ -75,7 +75,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 b424973a4f8..48241077590 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 @@ -140,7 +140,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 9b1accdea88..172856aaf7a 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 @@ -75,7 +75,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 02cc2736b7f..34b170e3ecd 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 @@ -264,7 +264,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 9b933ccfa26..32829a45215 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 @@ -131,7 +131,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 079cf4e54fc..cdc15037c15 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 @@ -280,7 +280,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 061e70f8951..23ca124c518 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 @@ -93,7 +93,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 b597f67abe6..ffd53c78dee 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 @@ -74,7 +74,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 f6d6fbaf2c6..f34a659e794 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 @@ -102,7 +102,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 911e309fd86..5586c8e6a82 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 @@ -189,7 +189,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 2b2985f15d4..0d6f48c11ea 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 @@ -216,7 +216,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 ea8fb75113a..86d4751120a 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 @@ -270,7 +270,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 3bd9a883c57..a09ec289d51 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 @@ -933,7 +933,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesAnyType.md index 87b468bb7ca..34c14b52bf2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesAnyType.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesAnyType.md @@ -9,4 +9,8 @@ Name | Type | Description | Notes **name** | **String** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesArray.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesArray.md index cb7fe9b3903..6a791da7106 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesArray.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesArray.md @@ -9,4 +9,8 @@ Name | Type | Description | Notes **name** | **String** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesBoolean.md index 6b53e7ba73a..930bfd1a5ac 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesBoolean.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesBoolean.md @@ -9,4 +9,8 @@ Name | Type | Description | Notes **name** | **String** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesClass.md index f9e189355cf..e3b04c897ed 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesClass.md @@ -19,4 +19,8 @@ Name | Type | Description | Notes **anytype3** | **Object** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesInteger.md index d2ed7fb1a46..7629f5f50c8 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesInteger.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesInteger.md @@ -9,4 +9,8 @@ Name | Type | Description | Notes **name** | **String** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesNumber.md index 53f6e81e717..6a745f35b63 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesNumber.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesNumber.md @@ -9,4 +9,8 @@ Name | Type | Description | Notes **name** | **String** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesObject.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesObject.md index 98ac8d2e5fe..060b7bdd6c0 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesObject.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesObject.md @@ -9,4 +9,8 @@ Name | Type | Description | Notes **name** | **String** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesString.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesString.md index d7970cdfe19..5b0385e52a0 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesString.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesString.md @@ -9,4 +9,8 @@ Name | Type | Description | Notes **name** | **String** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Animal.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Animal.md index c8e18ae55e4..cd162bd797d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Animal.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Animal.md @@ -10,4 +10,8 @@ Name | Type | Description | Notes **color** | **String** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayOfArrayOfNumberOnly.md index e1a0e54c0b5..e6071b7ac6a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayOfArrayOfNumberOnly.md @@ -9,4 +9,8 @@ Name | Type | Description | Notes **arrayArrayNumber** | **List<List<BigDecimal>>** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayOfNumberOnly.md index 25670a603c4..103babddf1b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayOfNumberOnly.md @@ -9,4 +9,8 @@ Name | Type | Description | Notes **arrayNumber** | **List<BigDecimal>** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayTest.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayTest.md index 7c6f6245ac8..1b79b1e97df 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayTest.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayTest.md @@ -11,4 +11,8 @@ Name | Type | Description | Notes **arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCat.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCat.md index 8a075304abf..eec91a45802 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCat.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCat.md @@ -20,4 +20,8 @@ LEOPARDS | "leopards" JAGUARS | "jaguars" +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCatAllOf.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCatAllOf.md index 21177dbf089..d4c713b3e96 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCatAllOf.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/BigCatAllOf.md @@ -20,4 +20,8 @@ LEOPARDS | "leopards" JAGUARS | "jaguars" +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Capitalization.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Capitalization.md index 7b73c40b554..d7b56a6b99c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Capitalization.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Capitalization.md @@ -14,4 +14,8 @@ Name | Type | Description | Notes **ATT_NAME** | **String** | Name of the pet | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Cat.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Cat.md index 39c2f864df8..7c35c8fdba5 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Cat.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Cat.md @@ -9,4 +9,8 @@ Name | Type | Description | Notes **declawed** | **Boolean** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/CatAllOf.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/CatAllOf.md index 1098fd900c5..c8b10048700 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/CatAllOf.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/CatAllOf.md @@ -9,4 +9,8 @@ Name | Type | Description | Notes **declawed** | **Boolean** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Category.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Category.md index 613ea9f7ee2..eaa76f6bb22 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Category.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Category.md @@ -10,4 +10,8 @@ Name | Type | Description | Notes **name** | **String** | | +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ClassModel.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ClassModel.md index d5453c20133..ede422e87c2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ClassModel.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ClassModel.md @@ -10,4 +10,8 @@ Name | Type | Description | Notes **propertyClass** | **String** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Client.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Client.md index 228df492383..149537224cc 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Client.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Client.md @@ -9,4 +9,8 @@ Name | Type | Description | Notes **client** | **String** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Dog.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Dog.md index 73cedf2bc91..ffb0e9d2dc0 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Dog.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Dog.md @@ -9,4 +9,8 @@ Name | Type | Description | Notes **breed** | **String** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/DogAllOf.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/DogAllOf.md index cbeb9e9a22d..1ed266a241d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/DogAllOf.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/DogAllOf.md @@ -9,4 +9,8 @@ Name | Type | Description | Notes **breed** | **String** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumArrays.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumArrays.md index 869b7a6c066..f1193deea42 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumArrays.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumArrays.md @@ -28,4 +28,8 @@ FISH | "fish" CRAB | "crab" +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md index e066d77e5b0..5b0880f6c25 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md @@ -51,4 +51,8 @@ NUMBER_1_DOT_1 | 1.1 NUMBER_MINUS_1_DOT_2 | -1.2 +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FileSchemaTestClass.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FileSchemaTestClass.md index 3a95e27d7c0..69ba61e421b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FileSchemaTestClass.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FileSchemaTestClass.md @@ -10,4 +10,8 @@ Name | Type | Description | Notes **files** | [**List<java.io.File>**](java.io.File.md) | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FormatTest.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FormatTest.md index 60fa4300013..ea86e5d595c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FormatTest.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FormatTest.md @@ -22,4 +22,8 @@ Name | Type | Description | Notes **bigDecimal** | **BigDecimal** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/HasOnlyReadOnly.md index 4795b40ef65..b79bfb108f5 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/HasOnlyReadOnly.md @@ -10,4 +10,8 @@ Name | Type | Description | Notes **foo** | **String** | | [optional] [readonly] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MapTest.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MapTest.md index 9c3aeb6495c..575e33afaaf 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MapTest.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MapTest.md @@ -21,4 +21,8 @@ UPPER | "UPPER" LOWER | "lower" +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 52d10b2cc7a..68afad173e8 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -11,4 +11,8 @@ Name | Type | Description | Notes **map** | [**Map<String, Animal>**](Animal.md) | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Model200Response.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Model200Response.md index f9928d70622..9ba2d6a0f9c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Model200Response.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Model200Response.md @@ -11,4 +11,8 @@ Name | Type | Description | Notes **propertyClass** | **String** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelApiResponse.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelApiResponse.md index 14fb7f1ed27..02b3abc589e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelApiResponse.md @@ -11,4 +11,8 @@ Name | Type | Description | Notes **message** | **String** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelReturn.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelReturn.md index 5005d4b7239..44ef6c4dfcb 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelReturn.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelReturn.md @@ -10,4 +10,8 @@ Name | Type | Description | Notes **_return** | **Integer** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Name.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Name.md index b815a0b4c99..d439eec4bb6 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Name.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Name.md @@ -13,4 +13,8 @@ Name | Type | Description | Notes **_123number** | **Integer** | | [optional] [readonly] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/NumberOnly.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/NumberOnly.md index 4b9d048546c..982360b302c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/NumberOnly.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/NumberOnly.md @@ -9,4 +9,8 @@ Name | Type | Description | Notes **justNumber** | **BigDecimal** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Order.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Order.md index 30782d6ae77..3a50641dde8 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Order.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Order.md @@ -24,4 +24,8 @@ APPROVED | "approved" DELIVERED | "delivered" +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterComposite.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterComposite.md index 594951145a3..f539125ebe3 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterComposite.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterComposite.md @@ -11,4 +11,8 @@ Name | Type | Description | Notes **myBoolean** | **Boolean** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Pet.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Pet.md index bdcdad6b3e6..932bd08f0c5 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Pet.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Pet.md @@ -24,4 +24,8 @@ PENDING | "pending" SOLD | "sold" +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ReadOnlyFirst.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ReadOnlyFirst.md index a692499dc66..5702a47fb52 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ReadOnlyFirst.md @@ -10,4 +10,8 @@ Name | Type | Description | Notes **baz** | **String** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/SpecialModelName.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/SpecialModelName.md index 934b8f0f25d..ec66e930bdf 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/SpecialModelName.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/SpecialModelName.md @@ -9,4 +9,8 @@ Name | Type | Description | Notes **$specialPropertyName** | **Long** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Tag.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Tag.md index f24eba7d222..0bb43f42f24 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Tag.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Tag.md @@ -10,4 +10,8 @@ Name | Type | Description | Notes **name** | **String** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/TypeHolderDefault.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/TypeHolderDefault.md index e28c7a9df58..5c4a6f50d15 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/TypeHolderDefault.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/TypeHolderDefault.md @@ -13,4 +13,8 @@ Name | Type | Description | Notes **arrayItem** | **List<Integer>** | | +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/TypeHolderExample.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/TypeHolderExample.md index 96f0d4bebf4..76de8235c8a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/TypeHolderExample.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/TypeHolderExample.md @@ -14,4 +14,8 @@ Name | Type | Description | Notes **arrayItem** | **List<Integer>** | | +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/User.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/User.md index c4ea94b7fc1..76046312d5d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/User.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/User.md @@ -16,4 +16,8 @@ Name | Type | Description | Notes **userStatus** | **Integer** | User Status | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/XmlItem.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/XmlItem.md index 096fdc7b09a..06b218877b2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/XmlItem.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/XmlItem.md @@ -37,4 +37,8 @@ Name | Type | Description | Notes **prefixNsWrappedArray** | **List<Integer>** | | [optional] +## Implemented Interfaces + +* Parcelable + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/OAuthFlow.java index b2d11ff0c4f..75c2a0c9740 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -13,6 +13,10 @@ package org.openapitools.client.auth; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public enum OAuthFlow { - accessCode, implicit, password, application + accessCode, //called authorizationCode in OpenAPI 3.0 + implicit, + password, + application //called clientCredentials in OpenAPI 3.0 } 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 500c70c324c..8817e7d1ac9 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 @@ -32,7 +32,7 @@ import android.os.Parcel; * AdditionalPropertiesAnyType */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AdditionalPropertiesAnyType extends HashMap { +public class AdditionalPropertiesAnyType extends HashMap implements Parcelable { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) private String name; @@ -82,7 +82,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 cc89ddd2ac6..0565a50bd4f 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 @@ -33,7 +33,7 @@ import android.os.Parcel; * AdditionalPropertiesArray */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AdditionalPropertiesArray extends HashMap { +public class AdditionalPropertiesArray extends HashMap implements Parcelable { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) private String name; @@ -83,7 +83,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 fa580c5be82..92290427d32 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 @@ -32,7 +32,7 @@ import android.os.Parcel; * AdditionalPropertiesBoolean */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AdditionalPropertiesBoolean extends HashMap { +public class AdditionalPropertiesBoolean extends HashMap implements Parcelable { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) private String name; @@ -82,7 +82,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 95a60c8d07c..a310ccb549d 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 @@ -34,7 +34,7 @@ import android.os.Parcel; * AdditionalPropertiesClass */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AdditionalPropertiesClass { +public class AdditionalPropertiesClass implements Parcelable { public static final String SERIALIZED_NAME_MAP_STRING = "map_string"; @SerializedName(SERIALIZED_NAME_MAP_STRING) private Map mapString = null; @@ -426,7 +426,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 a2c86e65a21..e73be2717a8 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 @@ -32,7 +32,7 @@ import android.os.Parcel; * AdditionalPropertiesInteger */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AdditionalPropertiesInteger extends HashMap { +public class AdditionalPropertiesInteger extends HashMap implements Parcelable { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) private String name; @@ -82,7 +82,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 f9df8bbb0ce..3a7693d9cd5 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 @@ -33,7 +33,7 @@ import android.os.Parcel; * AdditionalPropertiesNumber */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AdditionalPropertiesNumber extends HashMap { +public class AdditionalPropertiesNumber extends HashMap implements Parcelable { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) private String name; @@ -83,7 +83,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 9fed1ee5313..929ee8601ad 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 @@ -32,7 +32,7 @@ import android.os.Parcel; * AdditionalPropertiesObject */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AdditionalPropertiesObject extends HashMap { +public class AdditionalPropertiesObject extends HashMap implements Parcelable { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) private String name; @@ -82,7 +82,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 b0b59b28b1c..0f752ea3d58 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 @@ -32,7 +32,7 @@ import android.os.Parcel; * AdditionalPropertiesString */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class AdditionalPropertiesString extends HashMap { +public class AdditionalPropertiesString extends HashMap implements Parcelable { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) private String name; @@ -82,7 +82,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 1ce96ba982a..5e7660d0258 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 @@ -33,7 +33,7 @@ import android.os.Parcel; * Animal */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Animal { +public class Animal implements Parcelable { public static final String SERIALIZED_NAME_CLASS_NAME = "className"; @SerializedName(SERIALIZED_NAME_CLASS_NAME) protected String className; @@ -109,7 +109,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 18d1d5c0feb..6af2a91abfe 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 @@ -33,7 +33,7 @@ import android.os.Parcel; * ArrayOfArrayOfNumberOnly */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ArrayOfArrayOfNumberOnly { +public class ArrayOfArrayOfNumberOnly implements Parcelable { public static final String SERIALIZED_NAME_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; @SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = null; @@ -89,7 +89,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 522be04febc..1751cd7e672 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 @@ -33,7 +33,7 @@ import android.os.Parcel; * ArrayOfNumberOnly */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ArrayOfNumberOnly { +public class ArrayOfNumberOnly implements Parcelable { public static final String SERIALIZED_NAME_ARRAY_NUMBER = "ArrayNumber"; @SerializedName(SERIALIZED_NAME_ARRAY_NUMBER) private List arrayNumber = null; @@ -89,7 +89,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 81d699bb0ee..366791bcb79 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 @@ -33,7 +33,7 @@ import android.os.Parcel; * ArrayTest */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ArrayTest { +public class ArrayTest implements Parcelable { public static final String SERIALIZED_NAME_ARRAY_OF_STRING = "array_of_string"; @SerializedName(SERIALIZED_NAME_ARRAY_OF_STRING) private List arrayOfString = null; @@ -161,7 +161,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 2dba2d3dcf3..c2da68b7d26 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 @@ -32,7 +32,7 @@ import android.os.Parcel; * BigCat */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BigCat extends Cat { +public class BigCat extends Cat implements Parcelable { /** * Gets or Sets kind */ @@ -134,7 +134,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 01c3dc8eb8e..1ed766c1e78 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 @@ -30,7 +30,7 @@ import android.os.Parcel; * BigCatAllOf */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class BigCatAllOf { +public class BigCatAllOf implements Parcelable { /** * Gets or Sets kind */ @@ -129,7 +129,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 92162a57b3d..48a61ddc2d2 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 @@ -30,7 +30,7 @@ import android.os.Parcel; * Capitalization */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Capitalization { +public class Capitalization implements Parcelable { public static final String SERIALIZED_NAME_SMALL_CAMEL = "smallCamel"; @SerializedName(SERIALIZED_NAME_SMALL_CAMEL) private String smallCamel; @@ -218,7 +218,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 19b4eea504a..ef9c0e620a0 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 @@ -33,7 +33,7 @@ import android.os.Parcel; * Cat */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Cat extends Animal { +public class Cat extends Animal implements Parcelable { public static final String SERIALIZED_NAME_DECLAWED = "declawed"; @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; @@ -84,7 +84,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 0f2d9b4bcc8..26415a2d8c4 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 @@ -30,7 +30,7 @@ import android.os.Parcel; * CatAllOf */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class CatAllOf { +public class CatAllOf implements Parcelable { public static final String SERIALIZED_NAME_DECLAWED = "declawed"; @SerializedName(SERIALIZED_NAME_DECLAWED) private Boolean declawed; @@ -78,7 +78,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 8f6dbc06f4f..48a16637cfa 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 @@ -30,7 +30,7 @@ import android.os.Parcel; * Category */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Category { +public class Category implements Parcelable { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) private Long id; @@ -105,7 +105,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 40b621a3b1e..4bee921b00d 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 @@ -31,7 +31,7 @@ import android.os.Parcel; */ @ApiModel(description = "Model for testing model with \"_class\" property") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ClassModel { +public class ClassModel implements Parcelable { public static final String SERIALIZED_NAME_PROPERTY_CLASS = "_class"; @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS) private String propertyClass; @@ -79,7 +79,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 fb62051922b..9a8db7cfb77 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 @@ -30,7 +30,7 @@ import android.os.Parcel; * Client */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Client { +public class Client implements Parcelable { public static final String SERIALIZED_NAME_CLIENT = "client"; @SerializedName(SERIALIZED_NAME_CLIENT) private String client; @@ -78,7 +78,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 3e9bd60bd0c..9e9f2f09a32 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 @@ -32,7 +32,7 @@ import android.os.Parcel; * Dog */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Dog extends Animal { +public class Dog extends Animal implements Parcelable { public static final String SERIALIZED_NAME_BREED = "breed"; @SerializedName(SERIALIZED_NAME_BREED) private String breed; @@ -83,7 +83,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 105f23c212c..d931385d39b 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 @@ -30,7 +30,7 @@ import android.os.Parcel; * DogAllOf */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class DogAllOf { +public class DogAllOf implements Parcelable { public static final String SERIALIZED_NAME_BREED = "breed"; @SerializedName(SERIALIZED_NAME_BREED) private String breed; @@ -78,7 +78,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 9cd622349b1..60a12b75f6e 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 @@ -32,7 +32,7 @@ import android.os.Parcel; * EnumArrays */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class EnumArrays { +public class EnumArrays implements Parcelable { /** * Gets or Sets justSymbol */ @@ -210,7 +210,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 8d67cd0c12a..da3d7683421 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 @@ -31,7 +31,7 @@ import android.os.Parcel; * EnumTest */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class EnumTest { +public class EnumTest implements Parcelable { /** * Gets or Sets enumString */ @@ -382,7 +382,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 17d2bc90ce2..d526b21a8ac 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 @@ -32,7 +32,7 @@ import android.os.Parcel; * FileSchemaTestClass */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FileSchemaTestClass { +public class FileSchemaTestClass implements Parcelable { public static final String SERIALIZED_NAME_FILE = "file"; @SerializedName(SERIALIZED_NAME_FILE) private java.io.File file; @@ -116,7 +116,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 575b8ba5d9b..c091e5f903e 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 @@ -35,7 +35,7 @@ import android.os.Parcel; * FormatTest */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FormatTest { +public class FormatTest implements Parcelable { public static final String SERIALIZED_NAME_INTEGER = "integer"; @SerializedName(SERIALIZED_NAME_INTEGER) private Integer integer; @@ -453,7 +453,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 2c83f5debb5..f6346371be2 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 @@ -30,7 +30,7 @@ import android.os.Parcel; * HasOnlyReadOnly */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class HasOnlyReadOnly { +public class HasOnlyReadOnly implements Parcelable { public static final String SERIALIZED_NAME_BAR = "bar"; @SerializedName(SERIALIZED_NAME_BAR) private String bar; @@ -88,7 +88,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 e3b394e269c..bbdeb5ea44e 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 @@ -33,7 +33,7 @@ import android.os.Parcel; * MapTest */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class MapTest { +public class MapTest implements Parcelable { public static final String SERIALIZED_NAME_MAP_MAP_OF_STRING = "map_map_of_string"; @SerializedName(SERIALIZED_NAME_MAP_MAP_OF_STRING) private Map> mapMapOfString = null; @@ -244,7 +244,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 bf7d7f9c8b6..f47bd4e4500 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 @@ -36,7 +36,7 @@ import android.os.Parcel; * MixedPropertiesAndAdditionalPropertiesClass */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class MixedPropertiesAndAdditionalPropertiesClass { +public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { public static final String SERIALIZED_NAME_UUID = "uuid"; @SerializedName(SERIALIZED_NAME_UUID) private UUID uuid; @@ -148,7 +148,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 feffa9b3f70..1370c6be17d 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 @@ -31,7 +31,7 @@ import android.os.Parcel; */ @ApiModel(description = "Model for testing model name starting with number") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Model200Response { +public class Model200Response implements Parcelable { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) private Integer name; @@ -107,7 +107,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 27c1e73ead0..122dc4d429a 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 @@ -30,7 +30,7 @@ import android.os.Parcel; * ModelApiResponse */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ModelApiResponse { +public class ModelApiResponse implements Parcelable { public static final String SERIALIZED_NAME_CODE = "code"; @SerializedName(SERIALIZED_NAME_CODE) private Integer code; @@ -134,7 +134,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 e8f006b882b..3684c5be5c7 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 @@ -31,7 +31,7 @@ import android.os.Parcel; */ @ApiModel(description = "Model for testing reserved words") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ModelReturn { +public class ModelReturn implements Parcelable { public static final String SERIALIZED_NAME_RETURN = "return"; @SerializedName(SERIALIZED_NAME_RETURN) private Integer _return; @@ -79,7 +79,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 7c45b68af7c..375ba87e132 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 @@ -31,7 +31,7 @@ import android.os.Parcel; */ @ApiModel(description = "Model for testing model name same as property name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Name { +public class Name implements Parcelable { public static final String SERIALIZED_NAME_NAME = "name"; @SerializedName(SERIALIZED_NAME_NAME) private Integer name; @@ -144,7 +144,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 5420a2aabeb..c3929e2ce7a 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 @@ -31,7 +31,7 @@ import android.os.Parcel; * NumberOnly */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class NumberOnly { +public class NumberOnly implements Parcelable { public static final String SERIALIZED_NAME_JUST_NUMBER = "JustNumber"; @SerializedName(SERIALIZED_NAME_JUST_NUMBER) private BigDecimal justNumber; @@ -79,7 +79,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 3a8ab2a1702..d6ec2f881d0 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 @@ -31,7 +31,7 @@ import android.os.Parcel; * Order */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Order { +public class Order implements Parcelable { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) private Long id; @@ -268,7 +268,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 69bf96b3537..6b84b6f36f4 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 @@ -31,7 +31,7 @@ import android.os.Parcel; * OuterComposite */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class OuterComposite { +public class OuterComposite implements Parcelable { public static final String SERIALIZED_NAME_MY_NUMBER = "my_number"; @SerializedName(SERIALIZED_NAME_MY_NUMBER) private BigDecimal myNumber; @@ -135,7 +135,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 b10d8d054ce..8ca22387251 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 @@ -36,7 +36,7 @@ import android.os.Parcel; * Pet */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Pet { +public class Pet implements Parcelable { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) private Long id; @@ -284,7 +284,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 41d96314ef8..abaf904bbba 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 @@ -30,7 +30,7 @@ import android.os.Parcel; * ReadOnlyFirst */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ReadOnlyFirst { +public class ReadOnlyFirst implements Parcelable { public static final String SERIALIZED_NAME_BAR = "bar"; @SerializedName(SERIALIZED_NAME_BAR) private String bar; @@ -97,7 +97,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 a65e7868fa2..2104c1e6062 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 @@ -30,7 +30,7 @@ import android.os.Parcel; * SpecialModelName */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class SpecialModelName { +public class SpecialModelName implements Parcelable { public static final String SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; @SerializedName(SERIALIZED_NAME_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; @@ -78,7 +78,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 98ae4043029..9f44e5098b8 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 @@ -30,7 +30,7 @@ import android.os.Parcel; * Tag */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class Tag { +public class Tag implements Parcelable { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) private Long id; @@ -106,7 +106,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 c2fa377d0d9..00568dbc260 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 @@ -33,7 +33,7 @@ import android.os.Parcel; * TypeHolderDefault */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TypeHolderDefault { +public class TypeHolderDefault implements Parcelable { public static final String SERIALIZED_NAME_STRING_ITEM = "string_item"; @SerializedName(SERIALIZED_NAME_STRING_ITEM) private String stringItem = "what"; @@ -193,7 +193,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 bf4a2d5a6cb..478c59e4aea 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 @@ -33,7 +33,7 @@ import android.os.Parcel; * TypeHolderExample */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class TypeHolderExample { +public class TypeHolderExample implements Parcelable { public static final String SERIALIZED_NAME_STRING_ITEM = "string_item"; @SerializedName(SERIALIZED_NAME_STRING_ITEM) private String stringItem; @@ -220,7 +220,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 6ba6e2adeb1..49df39a3805 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 @@ -30,7 +30,7 @@ import android.os.Parcel; * User */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class User { +public class User implements Parcelable { public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) private Long id; @@ -274,7 +274,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 7bcdd44ecc6..0e7fe46670d 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 @@ -33,7 +33,7 @@ import android.os.Parcel; * XmlItem */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class XmlItem { +public class XmlItem implements Parcelable { public static final String SERIALIZED_NAME_ATTRIBUTE_STRING = "attribute_string"; @SerializedName(SERIALIZED_NAME_ATTRIBUTE_STRING) private String attributeString; @@ -937,7 +937,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/OAuthFlow.java index b2d11ff0c4f..75c2a0c9740 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -13,6 +13,10 @@ package org.openapitools.client.auth; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public enum OAuthFlow { - accessCode, implicit, password, application + accessCode, //called authorizationCode in OpenAPI 3.0 + implicit, + password, + application //called clientCredentials in OpenAPI 3.0 } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index f79a901b71d..acb0175c213 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 3a728a76023..90e9afca2f0 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -78,7 +78,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 2bd69aca4ab..f6e70331f6e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 077571ff8df..0495881506d 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 @@ -422,7 +422,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index e38eb418615..208dfdbc15f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index ba5b2b9b2cf..b008b847a7e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -78,7 +78,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 4a236c28685..c2ce3b2fbe2 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index fa11b0dc474..dcecf6e69dd 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 6ba2cfafee7..67e9a14d06e 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 @@ -107,7 +107,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 fbc5067ee70..7e3ba8195c7 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 @@ -85,7 +85,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 72f6fee00ff..279edaea8a7 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 @@ -85,7 +85,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 4c9e81e8468..b1bfac1da86 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 @@ -157,7 +157,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java index 6fa51b1bde4..ee503f76942 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCat.java @@ -131,7 +131,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 99b2714b1b4..a6bdb2bbe3f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -125,7 +125,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 a18fd8ffdb0..42909659d9c 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 @@ -214,7 +214,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 a3a7ba7eba7..19705043a2f 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 @@ -81,7 +81,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 eede69dd633..6be8b4534b1 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 @@ -74,7 +74,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 e19b0174656..bc1672714e2 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 @@ -101,7 +101,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 29fd53f9c88..f43b881b90c 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 @@ -75,7 +75,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 4a40b04cd47..1702dbadd88 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 @@ -74,7 +74,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 02bd48cfa5e..5c80057e78e 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 @@ -80,7 +80,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 c76faa74e38..9e311a1f6af 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 @@ -74,7 +74,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 0ff5e9216ff..9a9c2f1a59a 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 @@ -206,7 +206,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 49527493f6a..7f325519f9b 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 @@ -378,7 +378,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 40a72877e62..a6c4008d1e9 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 @@ -112,7 +112,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 b5e841ec1d9..7809f39132a 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 @@ -449,7 +449,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 6b4d1f20626..7f915754ffa 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 @@ -84,7 +84,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 94379fa3137..f8fedfcde0c 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 @@ -240,7 +240,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 ced17913313..0c225d1f6cd 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 @@ -144,7 +144,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 e5e0c759fc9..f11d9e5d570 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 @@ -103,7 +103,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 ef176e1bd10..595d829ad8d 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 @@ -130,7 +130,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 ea05ccfecde..dc27972cb67 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 @@ -75,7 +75,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 b424973a4f8..48241077590 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 @@ -140,7 +140,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 9b1accdea88..172856aaf7a 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 @@ -75,7 +75,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 02cc2736b7f..34b170e3ecd 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 @@ -264,7 +264,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 9b933ccfa26..32829a45215 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 @@ -131,7 +131,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 079cf4e54fc..cdc15037c15 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 @@ -280,7 +280,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 061e70f8951..23ca124c518 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 @@ -93,7 +93,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 b597f67abe6..ffd53c78dee 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 @@ -74,7 +74,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 f6d6fbaf2c6..f34a659e794 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 @@ -102,7 +102,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 911e309fd86..5586c8e6a82 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -189,7 +189,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2b2985f15d4..0d6f48c11ea 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -216,7 +216,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); 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 ea8fb75113a..86d4751120a 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 @@ -270,7 +270,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/XmlItem.java index 3bd9a883c57..a09ec289d51 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/XmlItem.java @@ -933,7 +933,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 1b0f85ea821..ac7f3646e18 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -85,7 +85,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 530a2d2af50..6eac5af20da 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -86,7 +86,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 195ced31dfb..dbde88f9b06 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -85,7 +85,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 8f4e4f11345..48240c82341 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -455,7 +455,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index fb349f37b8e..0d4f46ef5db 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -85,7 +85,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index de35ebc6cb3..a906a139825 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -86,7 +86,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index e932ac3afd5..5da7386c139 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -85,7 +85,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 0d10d122d51..a66e3a25ccb 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -85,7 +85,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java index 292a0b35c13..9ae43c3ff0a 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java @@ -124,7 +124,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index f8258e1ce4d..9505daddb10 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -94,7 +94,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 3ed7941a3a4..097fa5a5864 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -94,7 +94,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java index 49953f10102..4bc57f9b036 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -171,7 +171,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java index 7d38a0ea6d1..50a6dae7fab 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java @@ -128,7 +128,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 51f909f6043..d01785b72cf 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -121,7 +121,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java index 7c5949f23b6..b74b3706816 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Capitalization.java @@ -232,7 +232,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java index 966caa81bf3..e2f3f992ab3 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Cat.java @@ -93,7 +93,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java index eededeed932..818f20e03c4 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -82,7 +82,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java index 8428649b95c..618c51c82d4 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Category.java @@ -112,7 +112,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java index 9bf242ec11e..cf105b8f04e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ClassModel.java @@ -83,7 +83,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java index 11e8f32ed81..cc732df66f4 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Client.java @@ -82,7 +82,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java index 6ebb75fc962..28086281fbb 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Dog.java @@ -89,7 +89,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java index 89c7c1f1424..7a44a9eef3f 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -82,7 +82,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java index 222fd41f176..0077afda65e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -192,7 +192,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java index 5a4259b60f2..6cfb06fdebf 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/EnumTest.java @@ -348,7 +348,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 565c508fe66..0774ba50ddd 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -124,7 +124,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java index dae27079274..27ee581d55b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/FormatTest.java @@ -493,7 +493,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 510b7604c1b..b7d84a73afb 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -94,7 +94,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java index 3c152244802..7132318d025 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MapTest.java @@ -243,7 +243,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index c5815ca8684..db774439c9e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -159,7 +159,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java index 3ef91801b01..0994dd28b4e 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Model200Response.java @@ -113,7 +113,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 5f33abe5d9d..2c4f7ea6df5 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -142,7 +142,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java index 29c8e20585b..f285424acf2 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -83,7 +83,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java index 3ad646c8efa..45e058db3f1 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Name.java @@ -155,7 +155,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java index 3f9dbefe504..d55295ede71 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -84,7 +84,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java index b925f5d026b..1e001ee7ff9 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Order.java @@ -271,7 +271,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java index a0fc150080f..b10d7e2a6cd 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -144,7 +144,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java index cd5bb7b256e..9f968025ad6 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java @@ -290,7 +290,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index be933220047..f4c3651fe16 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -103,7 +103,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java index 49b028ade70..2160dfb82db 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -82,7 +82,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java index d0ef844f6b8..34fda46f4b8 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Tag.java @@ -112,7 +112,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 36c55bfb4a7..40f4bb26f62 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -211,7 +211,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2c7ea241f6e..cbe4b8f43f5 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -241,7 +241,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java index 0254603b367..04e90e0e9fb 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/User.java @@ -292,7 +292,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java index 6a2775a81fc..01db682136b 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/XmlItem.java @@ -1002,7 +1002,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 902d054a711..ce745ee4ef6 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -80,7 +80,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index f8a6fb29812..8cce4941b32 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -81,7 +81,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 7b51fb445a9..90182c8b125 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -80,7 +80,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 55cbf3ef484..1b74276b62a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -430,7 +430,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index ee96ce6688c..0bc28f8419e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -80,7 +80,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index efb2ac443c8..f74b57204ca 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -81,7 +81,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 94bc0be0ef0..31375b34814 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -80,7 +80,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 88e278c1b85..da3b0758ca6 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -80,7 +80,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java index d5f085d99ac..ca996c926a5 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java @@ -111,7 +111,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 1130cb952bb..e8722a17ecb 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -89,7 +89,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 852c6df189f..db2ca52d05b 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -89,7 +89,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java index ff6848cbc9b..7d5f3424b6f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -162,7 +162,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java index caa71250705..41f04384b0f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCat.java @@ -134,7 +134,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 3f11bd68748..37247aea21b 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -128,7 +128,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java index 751bf2ccfab..e5b2f360b70 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Capitalization.java @@ -217,7 +217,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java index 38840251077..b71f9425340 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Cat.java @@ -84,7 +84,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java index f0d3aa5ff74..fe3831b05ec 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -77,7 +77,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java index 04c7fcb8621..3bdfcdd73a1 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Category.java @@ -105,7 +105,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java index 421a07df065..b10c2edf12d 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ClassModel.java @@ -78,7 +78,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java index c44160b94ac..ef207b1dba6 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Client.java @@ -77,7 +77,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java index 754915e1089..0afb21e75a2 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Dog.java @@ -83,7 +83,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java index 45fb72a7213..dbf0844cb40 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -77,7 +77,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java index 2daaad5b694..b3d2efba73a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -209,7 +209,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java index 351ee89465b..cacc86fc816 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/EnumTest.java @@ -383,7 +383,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index b2b6ed0fb47..3007cfaf0f5 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -117,7 +117,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java index e00a4500211..8c437f1fe1c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/FormatTest.java @@ -462,7 +462,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 82faa4a42db..7ebe8807f1e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -87,7 +87,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java index 8ef66b594c5..9b23ee3291c 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MapTest.java @@ -244,7 +244,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index e6897bd51f3..e7a34876fc4 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -150,7 +150,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java index 6f6bf4b71dd..8fabafe07eb 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Model200Response.java @@ -106,7 +106,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 8d8941ce49b..9ac46956160 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -133,7 +133,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java index 4452bfefab9..8c848546c53 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -78,7 +78,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java index aa03aa041ce..217eb056290 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Name.java @@ -144,7 +144,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java index 39d570eb9f7..2dc1f6f02a6 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -79,7 +79,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java index 69204c4ce74..477b9c8a3df 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Order.java @@ -268,7 +268,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java index 499252bb3e6..2013747843e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -135,7 +135,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java index f3530212571..bb57e68be58 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java @@ -287,7 +287,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index b7ebd8c5028..14b4529553f 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -96,7 +96,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java index ae9fe7a7392..264c1ec4856 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -77,7 +77,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java index d409103256c..d3fc7c16d14 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Tag.java @@ -105,7 +105,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 35981b8f108..77230529e89 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -198,7 +198,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java index d527ccc144b..b5c3e2c014e 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -226,7 +226,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java index e0e82adeaa6..f46e3487727 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/User.java @@ -273,7 +273,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java index a0286e54452..b0bf2ff8ee3 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/XmlItem.java @@ -941,7 +941,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/auth/OAuthFlow.java index b2d11ff0c4f..75c2a0c9740 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -13,6 +13,10 @@ package org.openapitools.client.auth; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public enum OAuthFlow { - accessCode, implicit, password, application + accessCode, //called authorizationCode in OpenAPI 3.0 + implicit, + password, + application //called clientCredentials in OpenAPI 3.0 } diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 497124467a2..366143d1fc0 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index d638cd95bf4..7a5e9587e65 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 5ce0e7937f5..8f017af3507 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index dca8ec41b68..e442eea3121 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -447,7 +447,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index e7f70c5fb0d..8e85dd20fe7 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index e96cab6e53e..50db851ff00 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index fb48dd0c264..b6fcfc25ba8 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 932cfecb044..20bbfd1117d 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java index 6f15310fd8c..c33e153c751 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java @@ -120,7 +120,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 27ce18d552d..459f4602965 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -90,7 +90,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index b6d3b256a24..8becb8dd2b0 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -90,7 +90,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java index 38399bfe582..8747730a9dd 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -166,7 +166,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java index c000e826f31..ccfdc5a5ec0 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java @@ -125,7 +125,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 81a5b56ed64..481e22e0df1 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -118,7 +118,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java index 27d2258b3fa..2065be194db 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java @@ -229,7 +229,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java index d04c3ecd1a5..10d8036c414 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java @@ -90,7 +90,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java index 153873956c9..38910bf5c69 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -79,7 +79,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java index ddd999f84c6..3737dbb3c3e 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java @@ -108,7 +108,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java index 3e2216e6ae4..227bdaae556 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java @@ -80,7 +80,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java index 2147430592b..9fea8958838 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java @@ -79,7 +79,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java index 559b170c4f7..d54ac1b7a2f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java @@ -86,7 +86,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java index 9f3d303c1ab..449c4e6f051 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -79,7 +79,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java index c38d53553cb..4944b28bdfe 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -189,7 +189,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java index bc6ce93c566..7589d69aa6d 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java @@ -343,7 +343,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index f427cf921f6..074b99080e7 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -119,7 +119,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java index 23f3e20db17..5f8a894641d 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java @@ -480,7 +480,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index bd976488179..4f7e8a75ca2 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -91,7 +91,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java index 1271533e5be..b5921775cfd 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java @@ -239,7 +239,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index fdb9393a657..dbb1682a919 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -153,7 +153,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java index 6bba2623f4b..bc3bee0e09a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java @@ -110,7 +110,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 97921db1707..47f88db907b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -139,7 +139,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java index f28c2ac46ea..1b2a532f60c 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -80,7 +80,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java index 7ba7d886ce2..1da9e1433c1 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java @@ -151,7 +151,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java index 54be0a4cbf0..d1f21fa5942 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -80,7 +80,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java index a8396385767..ef256856406 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java @@ -267,7 +267,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java index bfea026235e..32db00927cb 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -140,7 +140,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java index 2ac06b78334..fca1a5141de 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java @@ -283,7 +283,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 455300cd7f8..f866409c5bd 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -100,7 +100,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java index ac1bfcbd846..2a7c39ec8e8 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -79,7 +79,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java index a95f8f4a4d8..9630d272242 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java @@ -109,7 +109,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 53bf7905e15..5e13ac4ab73 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -202,7 +202,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 68fa374847d..7b89d392f5e 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -231,7 +231,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java index 49ed08dff9a..ba6825df44e 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java @@ -289,7 +289,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java index 1067826b0d5..1a621d2e710 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java @@ -994,7 +994,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index dfeff427205..8387ffb9d7f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -89,7 +89,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index c598fe3adc7..9bfa9e1dd34 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -90,7 +90,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index fac897ed6ca..8c4a52fb6d7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -89,7 +89,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 87aeed9fa26..96c4830090c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -490,7 +490,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 91ac1a36e87..bd5df4cfef7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -89,7 +89,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index f16c414c1ff..8282571e605 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -90,7 +90,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 82422bfbc93..e8eba34a8e2 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -89,7 +89,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 45f6e2ebf69..0eb4bcabea4 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -89,7 +89,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java index 7f0b89733ac..899db978f9e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java @@ -129,7 +129,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 34e15755d1a..563eefe73f4 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -99,7 +99,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 90b91865675..7d541000c63 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -99,7 +99,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java index c608ad4b827..f51ac1266fb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -183,7 +183,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java index 742777ba7d6..43aee30817f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java @@ -132,7 +132,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java index d193e571bfc..1b081179142 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -125,7 +125,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java index 7b8298c2b63..aac1ec0e232 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java @@ -246,7 +246,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java index f67b94b1767..ac98f4380f9 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java @@ -97,7 +97,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java index 40fc9e07e40..7ff5f466e2d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -86,7 +86,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java index aa2163c19fb..384110e1f44 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java @@ -117,7 +117,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java index 7b316f95a82..f538dedcfae 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java @@ -87,7 +87,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java index ab49e49f6d1..92f2df27410 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java @@ -86,7 +86,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java index 7f16af13ced..e64a250d553 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java @@ -93,7 +93,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java index 083d46651f7..142036009f6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -86,7 +86,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java index 5c59edc23f7..bf6293c0801 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -200,7 +200,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java index 3eaf1a6ddfc..922ca402ed6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java @@ -358,7 +358,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index ae70d339f3d..85810f4a827 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -130,7 +130,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java index 25198c3854c..a13aaeac244 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java @@ -513,7 +513,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 117a44fe53a..e728ade4ee7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -100,7 +100,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java index 70841a35988..87bd0e3132c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java @@ -260,7 +260,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 68c325a6537..21ccdd991c5 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -166,7 +166,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java index f565e80fcce..94a6e89ab88 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java @@ -119,7 +119,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 43207f5eec3..f9b2752ca3d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -150,7 +150,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java index 236a46c32f1..4c6988e9648 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -87,7 +87,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java index 5458f4f9f93..327dedcaf2e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java @@ -164,7 +164,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java index 2345a3dfb7d..e80fbe7f6a7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -87,7 +87,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java index 37cbdb1ccc2..cab2dcadf4a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java @@ -284,7 +284,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java index b5834711ded..ceb89c57e6c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -151,7 +151,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java index 66b6b012cc9..f6498477356 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java @@ -310,7 +310,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index ae416979044..4b104de8eba 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -109,7 +109,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java index 59c55cbfd70..00ace36bcfe 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -86,7 +86,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java index b6234138039..c978964642c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java @@ -118,7 +118,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 8799eb056c4..0ef707b6746 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -219,7 +219,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java index ebed8649f0f..80fb12122b3 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -250,7 +250,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java index 95215b55c57..d69d4cdcc23 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java @@ -310,7 +310,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java index 5d3a673bb8f..684ded6d3b1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java @@ -1090,7 +1090,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 497124467a2..366143d1fc0 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index d638cd95bf4..7a5e9587e65 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 5ce0e7937f5..8f017af3507 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index dca8ec41b68..e442eea3121 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -447,7 +447,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index e7f70c5fb0d..8e85dd20fe7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index e96cab6e53e..50db851ff00 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index fb48dd0c264..b6fcfc25ba8 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 932cfecb044..20bbfd1117d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java index 6f15310fd8c..c33e153c751 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java @@ -120,7 +120,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 27ce18d552d..459f4602965 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -90,7 +90,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index b6d3b256a24..8becb8dd2b0 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -90,7 +90,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java index 38399bfe582..8747730a9dd 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -166,7 +166,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java index c000e826f31..ccfdc5a5ec0 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java @@ -125,7 +125,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 81a5b56ed64..481e22e0df1 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -118,7 +118,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java index 27d2258b3fa..2065be194db 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java @@ -229,7 +229,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java index d04c3ecd1a5..10d8036c414 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java @@ -90,7 +90,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java index 153873956c9..38910bf5c69 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -79,7 +79,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java index ddd999f84c6..3737dbb3c3e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java @@ -108,7 +108,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java index 3e2216e6ae4..227bdaae556 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java @@ -80,7 +80,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java index 2147430592b..9fea8958838 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java @@ -79,7 +79,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java index 559b170c4f7..d54ac1b7a2f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java @@ -86,7 +86,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java index 9f3d303c1ab..449c4e6f051 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -79,7 +79,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java index c38d53553cb..4944b28bdfe 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -189,7 +189,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java index bc6ce93c566..7589d69aa6d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java @@ -343,7 +343,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index f427cf921f6..074b99080e7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -119,7 +119,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java index 23f3e20db17..5f8a894641d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java @@ -480,7 +480,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index bd976488179..4f7e8a75ca2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -91,7 +91,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java index 1271533e5be..b5921775cfd 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java @@ -239,7 +239,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index fdb9393a657..dbb1682a919 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -153,7 +153,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java index 6bba2623f4b..bc3bee0e09a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java @@ -110,7 +110,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 97921db1707..47f88db907b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -139,7 +139,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java index f28c2ac46ea..1b2a532f60c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -80,7 +80,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java index 7ba7d886ce2..1da9e1433c1 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java @@ -151,7 +151,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java index 54be0a4cbf0..d1f21fa5942 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -80,7 +80,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java index a8396385767..ef256856406 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java @@ -267,7 +267,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java index bfea026235e..32db00927cb 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -140,7 +140,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java index 2ac06b78334..fca1a5141de 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java @@ -283,7 +283,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 455300cd7f8..f866409c5bd 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -100,7 +100,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java index ac1bfcbd846..2a7c39ec8e8 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -79,7 +79,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java index a95f8f4a4d8..9630d272242 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java @@ -109,7 +109,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 53bf7905e15..5e13ac4ab73 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -202,7 +202,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 68fa374847d..7b89d392f5e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -231,7 +231,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java index 49ed08dff9a..ba6825df44e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java @@ -289,7 +289,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java index 1067826b0d5..1a621d2e710 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java @@ -994,7 +994,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 144b47e2d7c..108c5441731 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -84,7 +84,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 6478ffb05fb..afd118c1604 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -85,7 +85,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index edd2bc2949a..c029a331395 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -84,7 +84,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 9a2ae4aa491..016851e60d5 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -454,7 +454,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index e756ab49bd8..1749bdbab0b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -84,7 +84,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index bb5dcc2d281..9641760739b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -85,7 +85,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index e02323889d7..0919d9853c0 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -84,7 +84,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index caac18bf2c8..4a37d8fd1c5 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -84,7 +84,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java index 580f1e1e405..1843bdc8010 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java @@ -123,7 +123,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 61735419075..a198249bc5d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -93,7 +93,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index ba62e31e97a..b9985f1bb89 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -93,7 +93,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java index 543ef525a46..40ec5a9f1ca 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -170,7 +170,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java index 9c57db183ba..f06ac3b65c9 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java @@ -127,7 +127,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 4a88944ad3e..a048db4855d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -120,7 +120,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java index 4b3f68e992d..b37ca9a3061 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java @@ -231,7 +231,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java index 286e0959df4..daad65c9248 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java @@ -92,7 +92,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java index ff278cc11cf..c4bb17072e4 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -81,7 +81,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java index ab930b472d1..9cec2c4afc7 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java @@ -111,7 +111,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java index 7cf79bc5df0..cca89d753ff 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java @@ -82,7 +82,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java index f494760ce31..ebeb9efdaef 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java @@ -81,7 +81,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java index 87a374873f3..e0b5ddf0b5a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java @@ -88,7 +88,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java index 422d92d8f23..76a440b0b7d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -81,7 +81,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java index 02fcd6f3b73..e50eb2f3f10 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -191,7 +191,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java index 63753f124dc..ede00732dc9 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java @@ -347,7 +347,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index a9b6de87bcc..18e35f8d431 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -123,7 +123,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java index 089d1867402..22b93699569 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java @@ -492,7 +492,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index fb3a53ed5b8..2b95c45be10 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -93,7 +93,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java index cc5c1a797a5..561ac6a6e48 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java @@ -242,7 +242,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index d6cd5acc7d4..62a690889d8 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -158,7 +158,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java index ecaec06a7e1..31c0cf95c44 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java @@ -112,7 +112,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 90d9704701f..dfbe3b0d9f1 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -141,7 +141,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java index db09aa0380d..3156ea25136 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -82,7 +82,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java index 12115c28cbc..80219556372 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java @@ -154,7 +154,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java index 26556a3ebe2..2fa9c4ee331 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -83,7 +83,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java index a9d4770c437..a406d64c07b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java @@ -270,7 +270,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java index 1b2193710e1..66abc21150d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -143,7 +143,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java index 487d1cbc1e5..a10d99865da 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java @@ -289,7 +289,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 0dcf55396a4..6c711fd90d2 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -102,7 +102,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java index 4760bc0cc9c..2a39bcd5a7f 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -81,7 +81,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java index afe0284cec5..f7844afbd2f 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java @@ -111,7 +111,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 18bf2f175a9..3138e14f0c7 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -210,7 +210,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java index de94f0b1350..639a8335beb 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -240,7 +240,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java index f13daf5990f..75dbe101bdf 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java @@ -291,7 +291,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java index 156b020f7a9..e8c3b0997cd 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java @@ -1001,7 +1001,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/auth/OAuthFlow.java index b2d11ff0c4f..75c2a0c9740 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -13,6 +13,10 @@ package org.openapitools.client.auth; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public enum OAuthFlow { - accessCode, implicit, password, application + accessCode, //called authorizationCode in OpenAPI 3.0 + implicit, + password, + application //called clientCredentials in OpenAPI 3.0 } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index f79a901b71d..acb0175c213 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 3a728a76023..90e9afca2f0 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -78,7 +78,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 2bd69aca4ab..f6e70331f6e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 077571ff8df..0495881506d 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -422,7 +422,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index e38eb418615..208dfdbc15f 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index ba5b2b9b2cf..b008b847a7e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -78,7 +78,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 4a236c28685..c2ce3b2fbe2 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index fa11b0dc474..dcecf6e69dd 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java index 6ba2cfafee7..67e9a14d06e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java @@ -107,7 +107,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index fbc5067ee70..7e3ba8195c7 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -85,7 +85,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 72f6fee00ff..279edaea8a7 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -85,7 +85,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java index 4c9e81e8468..b1bfac1da86 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -157,7 +157,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java index 6fa51b1bde4..ee503f76942 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCat.java @@ -131,7 +131,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 99b2714b1b4..a6bdb2bbe3f 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -125,7 +125,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Capitalization.java index a18fd8ffdb0..42909659d9c 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Capitalization.java @@ -214,7 +214,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java index a3a7ba7eba7..19705043a2f 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Cat.java @@ -81,7 +81,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/CatAllOf.java index eede69dd633..6be8b4534b1 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -74,7 +74,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Category.java index e19b0174656..bc1672714e2 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Category.java @@ -101,7 +101,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ClassModel.java index 29fd53f9c88..f43b881b90c 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ClassModel.java @@ -75,7 +75,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Client.java index 4a40b04cd47..1702dbadd88 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Client.java @@ -74,7 +74,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java index 02bd48cfa5e..5c80057e78e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Dog.java @@ -80,7 +80,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/DogAllOf.java index c76faa74e38..9e311a1f6af 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -74,7 +74,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java index 0ff5e9216ff..9a9c2f1a59a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -206,7 +206,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java index 49527493f6a..7f325519f9b 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -378,7 +378,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 40a72877e62..a6c4008d1e9 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -112,7 +112,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java index b5e841ec1d9..7809f39132a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/FormatTest.java @@ -449,7 +449,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 6b4d1f20626..7f915754ffa 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -84,7 +84,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java index 94379fa3137..f8fedfcde0c 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MapTest.java @@ -240,7 +240,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index ced17913313..0c225d1f6cd 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -144,7 +144,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Model200Response.java index e5e0c759fc9..f11d9e5d570 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Model200Response.java @@ -103,7 +103,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelApiResponse.java index ef176e1bd10..595d829ad8d 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -130,7 +130,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelReturn.java index ea05ccfecde..dc27972cb67 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -75,7 +75,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Name.java index b424973a4f8..48241077590 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Name.java @@ -140,7 +140,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/NumberOnly.java index 9b1accdea88..172856aaf7a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -75,7 +75,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java index 02cc2736b7f..34b170e3ecd 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Order.java @@ -264,7 +264,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java index 9b933ccfa26..32829a45215 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -131,7 +131,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java index 079cf4e54fc..cdc15037c15 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java @@ -280,7 +280,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 061e70f8951..23ca124c518 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -93,7 +93,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/SpecialModelName.java index b597f67abe6..ffd53c78dee 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -74,7 +74,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Tag.java index f6d6fbaf2c6..f34a659e794 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Tag.java @@ -102,7 +102,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 911e309fd86..5586c8e6a82 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -189,7 +189,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2b2985f15d4..0d6f48c11ea 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -216,7 +216,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/User.java index ea8fb75113a..86d4751120a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/User.java @@ -270,7 +270,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java index 3bd9a883c57..a09ec289d51 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/XmlItem.java @@ -933,7 +933,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/auth/OAuthFlow.java index b2d11ff0c4f..75c2a0c9740 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -13,6 +13,10 @@ package org.openapitools.client.auth; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public enum OAuthFlow { - accessCode, implicit, password, application + accessCode, //called authorizationCode in OpenAPI 3.0 + implicit, + password, + application //called clientCredentials in OpenAPI 3.0 } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index f79a901b71d..acb0175c213 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 3a728a76023..90e9afca2f0 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -78,7 +78,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 2bd69aca4ab..f6e70331f6e 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 077571ff8df..0495881506d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -422,7 +422,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index e38eb418615..208dfdbc15f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index ba5b2b9b2cf..b008b847a7e 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -78,7 +78,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 4a236c28685..c2ce3b2fbe2 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index fa11b0dc474..dcecf6e69dd 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java index 6ba2cfafee7..67e9a14d06e 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java @@ -107,7 +107,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index fbc5067ee70..7e3ba8195c7 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -85,7 +85,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 72f6fee00ff..279edaea8a7 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -85,7 +85,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java index 4c9e81e8468..b1bfac1da86 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -157,7 +157,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java index 6fa51b1bde4..ee503f76942 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCat.java @@ -131,7 +131,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 99b2714b1b4..a6bdb2bbe3f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -125,7 +125,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Capitalization.java index a18fd8ffdb0..42909659d9c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Capitalization.java @@ -214,7 +214,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java index a3a7ba7eba7..19705043a2f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Cat.java @@ -81,7 +81,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/CatAllOf.java index eede69dd633..6be8b4534b1 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -74,7 +74,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Category.java index e19b0174656..bc1672714e2 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Category.java @@ -101,7 +101,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ClassModel.java index 29fd53f9c88..f43b881b90c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ClassModel.java @@ -75,7 +75,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Client.java index 4a40b04cd47..1702dbadd88 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Client.java @@ -74,7 +74,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java index 02bd48cfa5e..5c80057e78e 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Dog.java @@ -80,7 +80,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/DogAllOf.java index c76faa74e38..9e311a1f6af 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -74,7 +74,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java index 0ff5e9216ff..9a9c2f1a59a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -206,7 +206,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java index 49527493f6a..7f325519f9b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -378,7 +378,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 40a72877e62..a6c4008d1e9 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -112,7 +112,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java index b5e841ec1d9..7809f39132a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/FormatTest.java @@ -449,7 +449,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 6b4d1f20626..7f915754ffa 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -84,7 +84,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java index 94379fa3137..f8fedfcde0c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MapTest.java @@ -240,7 +240,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index ced17913313..0c225d1f6cd 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -144,7 +144,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Model200Response.java index e5e0c759fc9..f11d9e5d570 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Model200Response.java @@ -103,7 +103,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelApiResponse.java index ef176e1bd10..595d829ad8d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -130,7 +130,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelReturn.java index ea05ccfecde..dc27972cb67 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -75,7 +75,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Name.java index b424973a4f8..48241077590 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Name.java @@ -140,7 +140,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/NumberOnly.java index 9b1accdea88..172856aaf7a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -75,7 +75,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java index 02cc2736b7f..34b170e3ecd 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Order.java @@ -264,7 +264,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java index 9b933ccfa26..32829a45215 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -131,7 +131,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java index 079cf4e54fc..cdc15037c15 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java @@ -280,7 +280,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 061e70f8951..23ca124c518 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -93,7 +93,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/SpecialModelName.java index b597f67abe6..ffd53c78dee 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -74,7 +74,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Tag.java index f6d6fbaf2c6..f34a659e794 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Tag.java @@ -102,7 +102,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 911e309fd86..5586c8e6a82 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -189,7 +189,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2b2985f15d4..0d6f48c11ea 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -216,7 +216,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/User.java index ea8fb75113a..86d4751120a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/User.java @@ -270,7 +270,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java index 3bd9a883c57..a09ec289d51 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/XmlItem.java @@ -933,7 +933,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/auth/OAuthFlow.java index b2d11ff0c4f..75c2a0c9740 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -13,6 +13,10 @@ package org.openapitools.client.auth; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public enum OAuthFlow { - accessCode, implicit, password, application + accessCode, //called authorizationCode in OpenAPI 3.0 + implicit, + password, + application //called clientCredentials in OpenAPI 3.0 } diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index f79a901b71d..acb0175c213 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 3a728a76023..90e9afca2f0 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -78,7 +78,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 2bd69aca4ab..f6e70331f6e 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 077571ff8df..0495881506d 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -422,7 +422,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index e38eb418615..208dfdbc15f 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index ba5b2b9b2cf..b008b847a7e 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -78,7 +78,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 4a236c28685..c2ce3b2fbe2 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index fa11b0dc474..dcecf6e69dd 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -77,7 +77,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java index 6ba2cfafee7..67e9a14d06e 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Animal.java @@ -107,7 +107,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index fbc5067ee70..7e3ba8195c7 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -85,7 +85,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 72f6fee00ff..279edaea8a7 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -85,7 +85,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java index 4c9e81e8468..b1bfac1da86 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -157,7 +157,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java index 6fa51b1bde4..ee503f76942 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCat.java @@ -131,7 +131,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 99b2714b1b4..a6bdb2bbe3f 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -125,7 +125,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Capitalization.java index a18fd8ffdb0..42909659d9c 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Capitalization.java @@ -214,7 +214,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java index a3a7ba7eba7..19705043a2f 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Cat.java @@ -81,7 +81,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/CatAllOf.java index eede69dd633..6be8b4534b1 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -74,7 +74,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Category.java index e19b0174656..bc1672714e2 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Category.java @@ -101,7 +101,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ClassModel.java index 29fd53f9c88..f43b881b90c 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ClassModel.java @@ -75,7 +75,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Client.java index 4a40b04cd47..1702dbadd88 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Client.java @@ -74,7 +74,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java index 02bd48cfa5e..5c80057e78e 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Dog.java @@ -80,7 +80,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/DogAllOf.java index c76faa74e38..9e311a1f6af 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -74,7 +74,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java index 0ff5e9216ff..9a9c2f1a59a 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -206,7 +206,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java index 49527493f6a..7f325519f9b 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/EnumTest.java @@ -378,7 +378,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 40a72877e62..a6c4008d1e9 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -112,7 +112,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java index b5e841ec1d9..7809f39132a 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/FormatTest.java @@ -449,7 +449,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 6b4d1f20626..7f915754ffa 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -84,7 +84,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java index 94379fa3137..f8fedfcde0c 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MapTest.java @@ -240,7 +240,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index ced17913313..0c225d1f6cd 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -144,7 +144,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Model200Response.java index e5e0c759fc9..f11d9e5d570 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Model200Response.java @@ -103,7 +103,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelApiResponse.java index ef176e1bd10..595d829ad8d 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -130,7 +130,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelReturn.java index ea05ccfecde..dc27972cb67 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -75,7 +75,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Name.java index b424973a4f8..48241077590 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Name.java @@ -140,7 +140,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/NumberOnly.java index 9b1accdea88..172856aaf7a 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -75,7 +75,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java index 02cc2736b7f..34b170e3ecd 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Order.java @@ -264,7 +264,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/OuterComposite.java index 9b933ccfa26..32829a45215 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -131,7 +131,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java index 079cf4e54fc..cdc15037c15 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Pet.java @@ -280,7 +280,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 061e70f8951..23ca124c518 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -93,7 +93,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/SpecialModelName.java index b597f67abe6..ffd53c78dee 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -74,7 +74,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Tag.java index f6d6fbaf2c6..f34a659e794 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/Tag.java @@ -102,7 +102,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 911e309fd86..5586c8e6a82 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -189,7 +189,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2b2985f15d4..0d6f48c11ea 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -216,7 +216,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/User.java index ea8fb75113a..86d4751120a 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/User.java @@ -270,7 +270,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java index 3bd9a883c57..a09ec289d51 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/XmlItem.java @@ -933,7 +933,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/ApiClient.java index c7b8edf8743..10f7d1935d0 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/ApiClient.java @@ -112,10 +112,10 @@ public class ApiClient extends JavaTimeFormatter { public synchronized WebClient getWebClient() { String webClientIdentifier = "web-client-" + identifier; - WebClient webClient = Vertx.currentContext().get(webClientIdentifier); + WebClient webClient = this.vertx.getOrCreateContext().get(webClientIdentifier); if (webClient == null) { webClient = buildWebClient(vertx, config); - Vertx.currentContext().put(webClientIdentifier, webClient); + this.vertx.getOrCreateContext().put(webClientIdentifier, webClient); } return webClient; } diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 497124467a2..366143d1fc0 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index d638cd95bf4..7a5e9587e65 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 5ce0e7937f5..8f017af3507 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index e133c0e8218..94d3394a381 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -447,7 +447,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index e7f70c5fb0d..8e85dd20fe7 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index e96cab6e53e..50db851ff00 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index fb48dd0c264..b6fcfc25ba8 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 932cfecb044..20bbfd1117d 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java index 6f15310fd8c..c33e153c751 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Animal.java @@ -120,7 +120,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 366494a73a5..6f7b19e3be4 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -90,7 +90,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 60a0c6bb707..18c4a58ef99 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -90,7 +90,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java index cf38d789167..41d2808a066 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -166,7 +166,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java index c000e826f31..ccfdc5a5ec0 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java @@ -125,7 +125,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 81a5b56ed64..481e22e0df1 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -118,7 +118,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java index 27d2258b3fa..2065be194db 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Capitalization.java @@ -229,7 +229,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java index d04c3ecd1a5..10d8036c414 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Cat.java @@ -90,7 +90,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java index 153873956c9..38910bf5c69 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -79,7 +79,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java index ddd999f84c6..3737dbb3c3e 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Category.java @@ -108,7 +108,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java index 3e2216e6ae4..227bdaae556 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ClassModel.java @@ -80,7 +80,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java index 2147430592b..9fea8958838 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Client.java @@ -79,7 +79,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java index 559b170c4f7..d54ac1b7a2f 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Dog.java @@ -86,7 +86,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java index 9f3d303c1ab..449c4e6f051 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -79,7 +79,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java index 6ed55a192bc..3836607265e 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -189,7 +189,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java index bc6ce93c566..7589d69aa6d 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java @@ -343,7 +343,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index bac6aa62f07..67596f2c9bd 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -119,7 +119,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java index 719ffd4c8d0..a5de78e55dc 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java @@ -480,7 +480,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index bd976488179..4f7e8a75ca2 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -91,7 +91,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java index ccb739e3bb8..dc0f170c75a 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java @@ -239,7 +239,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 9ce84ceeb3c..ec219837214 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -153,7 +153,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java index 6bba2623f4b..bc3bee0e09a 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java @@ -110,7 +110,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 97921db1707..47f88db907b 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -139,7 +139,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java index f28c2ac46ea..1b2a532f60c 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -80,7 +80,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java index 7ba7d886ce2..1da9e1433c1 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Name.java @@ -151,7 +151,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java index 54be0a4cbf0..d1f21fa5942 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -80,7 +80,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java index a8396385767..ef256856406 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Order.java @@ -267,7 +267,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java index bfea026235e..32db00927cb 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -140,7 +140,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java index 25d1f3c49f0..457cab4ac41 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Pet.java @@ -283,7 +283,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 455300cd7f8..f866409c5bd 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -100,7 +100,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java index ac1bfcbd846..2a7c39ec8e8 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -79,7 +79,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java index a95f8f4a4d8..9630d272242 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/Tag.java @@ -109,7 +109,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 027702c3767..5232c14dbc3 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -202,7 +202,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2c8941f56e7..58d82e2d6fc 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -231,7 +231,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java index 49ed08dff9a..ba6825df44e 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/User.java @@ -289,7 +289,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java index 2ffd4927861..a68ed7a61d1 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java @@ -994,7 +994,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java index 07b0da20acc..7b2ef6e985f 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/ApiClient.java @@ -115,10 +115,10 @@ public class ApiClient extends JavaTimeFormatter { public synchronized WebClient getWebClient() { String webClientIdentifier = "web-client-" + identifier; - WebClient webClient = Vertx.currentContext().get(webClientIdentifier); + WebClient webClient = this.vertx.getOrCreateContext().get(webClientIdentifier); if (webClient == null) { webClient = buildWebClient(vertx, config); - Vertx.currentContext().put(webClientIdentifier, webClient); + this.vertx.getOrCreateContext().put(webClientIdentifier, webClient); } return webClient; } diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 497124467a2..366143d1fc0 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index d638cd95bf4..7a5e9587e65 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 5ce0e7937f5..8f017af3507 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index e133c0e8218..94d3394a381 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -447,7 +447,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index e7f70c5fb0d..8e85dd20fe7 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index e96cab6e53e..50db851ff00 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index fb48dd0c264..b6fcfc25ba8 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 932cfecb044..20bbfd1117d 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java index 6f15310fd8c..c33e153c751 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java @@ -120,7 +120,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 366494a73a5..6f7b19e3be4 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -90,7 +90,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 60a0c6bb707..18c4a58ef99 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -90,7 +90,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java index cf38d789167..41d2808a066 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -166,7 +166,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java index c000e826f31..ccfdc5a5ec0 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java @@ -125,7 +125,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 81a5b56ed64..481e22e0df1 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -118,7 +118,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java index 27d2258b3fa..2065be194db 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java @@ -229,7 +229,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java index d04c3ecd1a5..10d8036c414 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java @@ -90,7 +90,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java index 153873956c9..38910bf5c69 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -79,7 +79,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java index ddd999f84c6..3737dbb3c3e 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java @@ -108,7 +108,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java index 3e2216e6ae4..227bdaae556 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java @@ -80,7 +80,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java index 2147430592b..9fea8958838 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java @@ -79,7 +79,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java index 559b170c4f7..d54ac1b7a2f 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java @@ -86,7 +86,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java index 9f3d303c1ab..449c4e6f051 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -79,7 +79,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java index 6ed55a192bc..3836607265e 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -189,7 +189,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java index bc6ce93c566..7589d69aa6d 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java @@ -343,7 +343,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index bac6aa62f07..67596f2c9bd 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -119,7 +119,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java index d806519b175..ef57b215bdd 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java @@ -480,7 +480,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index bd976488179..4f7e8a75ca2 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -91,7 +91,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java index ccb739e3bb8..dc0f170c75a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java @@ -239,7 +239,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index a8261ac47a5..c674dc908b7 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -153,7 +153,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java index 6bba2623f4b..bc3bee0e09a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java @@ -110,7 +110,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 97921db1707..47f88db907b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -139,7 +139,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java index f28c2ac46ea..1b2a532f60c 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -80,7 +80,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java index 7ba7d886ce2..1da9e1433c1 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java @@ -151,7 +151,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java index 54be0a4cbf0..d1f21fa5942 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -80,7 +80,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java index d975c6afa6b..20ad6ca5d34 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java @@ -267,7 +267,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java index bfea026235e..32db00927cb 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -140,7 +140,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java index 25d1f3c49f0..457cab4ac41 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java @@ -283,7 +283,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 455300cd7f8..f866409c5bd 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -100,7 +100,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java index ac1bfcbd846..2a7c39ec8e8 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -79,7 +79,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java index a95f8f4a4d8..9630d272242 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java @@ -109,7 +109,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 027702c3767..5232c14dbc3 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -202,7 +202,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2c8941f56e7..58d82e2d6fc 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -231,7 +231,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java index 49ed08dff9a..ba6825df44e 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java @@ -289,7 +289,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java index 2ffd4927861..a68ed7a61d1 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java @@ -994,7 +994,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 497124467a2..366143d1fc0 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesAnyType extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index d638cd95bf4..7a5e9587e65 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesArray extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 5ce0e7937f5..8f017af3507 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesBoolean extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index e133c0e8218..94d3394a381 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -447,7 +447,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index e7f70c5fb0d..8e85dd20fe7 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesInteger extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index e96cab6e53e..50db851ff00 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -83,7 +83,6 @@ public class AdditionalPropertiesNumber extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index fb48dd0c264..b6fcfc25ba8 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesObject extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 932cfecb044..20bbfd1117d 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -82,7 +82,6 @@ public class AdditionalPropertiesString extends HashMap { return Objects.hash(name, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java index 6f15310fd8c..c33e153c751 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java @@ -120,7 +120,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 366494a73a5..6f7b19e3be4 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -90,7 +90,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 60a0c6bb707..18c4a58ef99 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -90,7 +90,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java index cf38d789167..41d2808a066 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -166,7 +166,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java index c000e826f31..ccfdc5a5ec0 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCat.java @@ -125,7 +125,6 @@ public class BigCat extends Cat { return Objects.hash(kind, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 81a5b56ed64..481e22e0df1 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -118,7 +118,6 @@ public class BigCatAllOf { return Objects.hash(kind); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java index 27d2258b3fa..2065be194db 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java @@ -229,7 +229,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java index d04c3ecd1a5..10d8036c414 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java @@ -90,7 +90,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java index 153873956c9..38910bf5c69 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -79,7 +79,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java index ddd999f84c6..3737dbb3c3e 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java @@ -108,7 +108,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java index 3e2216e6ae4..227bdaae556 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java @@ -80,7 +80,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java index 2147430592b..9fea8958838 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java @@ -79,7 +79,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java index 559b170c4f7..d54ac1b7a2f 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java @@ -86,7 +86,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java index 9f3d303c1ab..449c4e6f051 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -79,7 +79,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java index 6ed55a192bc..3836607265e 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -189,7 +189,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java index bc6ce93c566..7589d69aa6d 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java @@ -343,7 +343,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index bac6aa62f07..67596f2c9bd 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -119,7 +119,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java index aa437a6852f..fe1790374be 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java @@ -480,7 +480,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index bd976488179..4f7e8a75ca2 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -91,7 +91,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java index ccb739e3bb8..dc0f170c75a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java @@ -239,7 +239,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index a8261ac47a5..c674dc908b7 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -153,7 +153,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java index 6bba2623f4b..bc3bee0e09a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java @@ -110,7 +110,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 97921db1707..47f88db907b 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -139,7 +139,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java index f28c2ac46ea..1b2a532f60c 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -80,7 +80,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java index 7ba7d886ce2..1da9e1433c1 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java @@ -151,7 +151,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java index 54be0a4cbf0..d1f21fa5942 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -80,7 +80,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java index d975c6afa6b..20ad6ca5d34 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java @@ -267,7 +267,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java index bfea026235e..32db00927cb 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -140,7 +140,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java index 25d1f3c49f0..457cab4ac41 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java @@ -283,7 +283,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 455300cd7f8..f866409c5bd 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -100,7 +100,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java index ac1bfcbd846..2a7c39ec8e8 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -79,7 +79,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java index a95f8f4a4d8..9630d272242 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java @@ -109,7 +109,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 027702c3767..5232c14dbc3 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -202,7 +202,6 @@ public class TypeHolderDefault { return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2c8941f56e7..58d82e2d6fc 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -231,7 +231,6 @@ public class TypeHolderExample { return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java index 49ed08dff9a..ba6825df44e 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java @@ -289,7 +289,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java index 2ffd4927861..a68ed7a61d1 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java @@ -994,7 +994,6 @@ public class XmlItem { return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/client/petstore/javascript-es6/src/ApiClient.js b/samples/client/petstore/javascript-es6/src/ApiClient.js index 4a73394c094..dffe9dda22f 100644 --- a/samples/client/petstore/javascript-es6/src/ApiClient.js +++ b/samples/client/petstore/javascript-es6/src/ApiClient.js @@ -53,7 +53,9 @@ class ApiClient { * @type {Array.} * @default {} */ - this.defaultHeaders = {}; + this.defaultHeaders = { + 'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript' + }; /** * The default HTTP timeout for all API calls. diff --git a/samples/client/petstore/javascript-promise-es6/src/ApiClient.js b/samples/client/petstore/javascript-promise-es6/src/ApiClient.js index d5d9e1a7230..c1143615624 100644 --- a/samples/client/petstore/javascript-promise-es6/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise-es6/src/ApiClient.js @@ -53,7 +53,9 @@ class ApiClient { * @type {Array.} * @default {} */ - this.defaultHeaders = {}; + this.defaultHeaders = { + 'User-Agent': 'OpenAPI-Generator/1.0.0/Javascript' + }; /** * The default HTTP timeout for all API calls. diff --git a/samples/client/petstore/jmeter/PetApi.jmx b/samples/client/petstore/jmeter/PetApi.jmx index 6624d24e38f..6fdef6ad04e 100644 --- a/samples/client/petstore/jmeter/PetApi.jmx +++ b/samples/client/petstore/jmeter/PetApi.jmx @@ -121,6 +121,10 @@ Content-Type application/json + + + Bearer ${__P(oathToken,token)} + @@ -130,7 +134,7 @@ false - ${body} + ${__javaScript("${body}".replace(/'/g\, '"'),)} = @@ -197,6 +201,10 @@ apiKey ${__RandomString(10,qwertyuiopasdfghjklzxcvbnm)} + + + Bearer ${__P(oathToken,token)} + @@ -268,6 +276,10 @@ accept application/xml + + + Bearer ${__P(oathToken,token)} + @@ -346,6 +358,10 @@ accept application/xml + + + Bearer ${__P(oathToken,token)} + @@ -424,6 +440,10 @@ accept application/xml + + api_key + ${__P(apiKey,key)} + @@ -495,6 +515,10 @@ Content-Type application/json + + + Bearer ${__P(oathToken,token)} + @@ -504,7 +528,7 @@ false - ${body} + ${__javaScript("${body}".replace(/'/g\, '"'),)} = @@ -571,6 +595,10 @@ Content-Type application/x-www-form-urlencoded + + + Bearer ${__P(oathToken,token)} + @@ -646,6 +674,10 @@ accept application/json + + + Bearer ${__P(oathToken,token)} + diff --git a/samples/client/petstore/jmeter/StoreApi.jmx b/samples/client/petstore/jmeter/StoreApi.jmx index 8113bd3c3ca..6c10ea74074 100644 --- a/samples/client/petstore/jmeter/StoreApi.jmx +++ b/samples/client/petstore/jmeter/StoreApi.jmx @@ -168,6 +168,10 @@ accept application/json + + api_key + ${__P(apiKey,key)} + @@ -319,7 +323,7 @@ false - ${body} + ${__javaScript("${body}".replace(/'/g\, '"'),)} = diff --git a/samples/client/petstore/jmeter/UserApi.jmx b/samples/client/petstore/jmeter/UserApi.jmx index 208580536e1..fc1ff67ed39 100644 --- a/samples/client/petstore/jmeter/UserApi.jmx +++ b/samples/client/petstore/jmeter/UserApi.jmx @@ -126,7 +126,7 @@ false - ${body} + ${__javaScript("${body}".replace(/'/g\, '"'),)} = @@ -198,7 +198,7 @@ false - ${body} + ${__javaScript("${body}".replace(/'/g\, '"'),)} = @@ -270,7 +270,7 @@ false - ${body} + ${__javaScript("${body}".replace(/'/g\, '"'),)} = @@ -632,7 +632,7 @@ false - ${body} + ${__javaScript("${body}".replace(/'/g\, '"'),)} = diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index e4f7f4eeae0..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,374 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.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 kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.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) - } - } - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 08822c67e32..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,198 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/store/order", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 258a2540e9e..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,363 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/login", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a6..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 5d64a9add42..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.gson.toJson(content, T::class.java).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.gson.fromJson(bodyContent, T::class.java) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - 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-gson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfa..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(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() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index 6120b081929..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,33 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException - -class ByteArrayAdapter : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: ByteArray?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(String(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): ByteArray? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return out.nextString().toByteArray() - } - } - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt deleted file mode 100644 index c5d330ac075..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt +++ /dev/null @@ -1,37 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.text.DateFormat -import java.text.SimpleDateFormat -import java.util.Date -import java.util.Locale - -class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: Date?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): Date? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return formatter.parse(out.nextString()) - } - } - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@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-gson/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index 30ef6697183..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: LocalDate?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): LocalDate? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return LocalDate.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index 3ad781c66ca..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: LocalDateTime?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): LocalDateTime? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return LocalDateTime.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index e615135c9cc..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -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-gson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 9c22257e223..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf() -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc14..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 6465f148553..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,24 +0,0 @@ -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 -import java.util.Date - -object Serializer { - @JvmStatic - val gsonBuilder: GsonBuilder = GsonBuilder() - .registerTypeAdapter(Date::class.java, DateAdapter()) - .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-gson/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index 54df813fcee..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @SerializedName("code") - val code: kotlin.Int? = null, - @SerializedName("type") - val type: kotlin.String? = null, - @SerializedName("message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index fdefa74fda0..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index 049c89df313..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @SerializedName(value = "placed") placed("placed"), - @SerializedName(value = "approved") approved("approved"), - @SerializedName(value = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index af29ef2b61b..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @SerializedName(value = "available") available("available"), - @SerializedName(value = "pending") pending("pending"), - @SerializedName(value = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 28e82b1df68..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index 62baf33e927..00000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-jackson/bin/main/org/openapitools/client/Application.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/Application.kt deleted file mode 100644 index a48b80eecd4..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/Application.kt +++ /dev/null @@ -1,20 +0,0 @@ -package org.openapitools - -import org.openapitools.client.apis.PetApi -import org.openapitools.client.apis.StoreApi -import org.openapitools.client.models.Category -import org.openapitools.client.models.Pet -import org.openapitools.client.models.Tag - -fun main() { - println(".main") - val inventory = StoreApi().getInventory() - println("Inventory : $inventory") - val pet = Pet(name = "Elliot", photoUrls = listOf("https://jameshooverstudios.com/wp-content/uploads/2015/04/Majestic-Dog-Photography-Elliot-Nov-5-2014.jpg", "https://express-images.franklymedia.com/6616/sites/981/2020/01/22105725/Elliott.jpg"), id = 123456453, category = Category(id = 13259476, name = "dog"), tags = listOf(Tag(id = 194093, name = "Elliot")), status = Pet.Status.AVAILABLE) - PetApi().addPet(pet) - val elliot = PetApi().getPetById(123456453) - println("Elliot : $elliot") - assert(pet == elliot) - println(".main") - -} diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index e4f7f4eeae0..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,374 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.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 kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.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) - } - } - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 08822c67e32..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,198 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/store/order", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 258a2540e9e..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,363 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/login", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a6..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -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-jackson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 2c15d73b189..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.jacksonObjectMapper.writeValueAsString(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.jacksonObjectMapper.readValue(bodyContent, T::class.java) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - 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-jackson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfa..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(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() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index fff39c7ac24..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,3 +0,0 @@ -package org.openapitools.client.infrastructure - - diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@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-jackson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 9c22257e223..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf() -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc14..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 8b34e629c4e..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,18 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.fasterxml.jackson.databind.ObjectMapper -import com.fasterxml.jackson.databind.SerializationFeature -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule -import com.fasterxml.jackson.annotation.JsonInclude -import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper -import java.util.Date - -object Serializer { - @JvmStatic - val jacksonObjectMapper: ObjectMapper = jacksonObjectMapper() - .registerModule(Jdk8Module()) - .registerModule(JavaTimeModule()) - .setSerializationInclusion(JsonInclude.Include.NON_ABSENT) - .configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) -} diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index c341f8ca321..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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 ApiResponse ( - @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-jackson/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index 2ed5390c1f3..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-jackson/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index c7df5b55614..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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? = null -) { - - /** - * 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-jackson/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index be5b168e2d8..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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") - 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-jackson/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 7243f42ed7d..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-jackson/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index e8f639e5092..00000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-json-request-string/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index 6685f0a73d4..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,376 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.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) - } - } - } - - /** - * Get all pets - * - * @param lastUpdated When this endpoint was hit last to help indentify if the client already has the latest copy. (optional) - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getAllPets(lastUpdated: java.time.OffsetDateTime?) : kotlin.collections.List { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - if (lastUpdated != null) { - put("lastUpdated", listOf(parseDateToQueryString(lastUpdated))) - } - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/getAll", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return 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) - } - } - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 08822c67e32..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,198 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/store/order", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 258a2540e9e..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,363 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/login", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a6..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -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-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index a69de1961da..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,245 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - return value.toString() - } -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfa..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(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() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -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-json-request-string/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@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-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479a..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db94811..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-json-request-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a31..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 9c22257e223..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf() -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc14..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 697559b2ec1..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b7..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index fafca8738f6..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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 ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index a4c17c3b49d..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-json-request-string/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index a66c335904e..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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? = null -) { - - /** - * 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-json-request-string/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index a3df06cb6eb..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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") - 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-json-request-string/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 6e619023a5c..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-json-request-string/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index af1e270325d..00000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-moshi-codegen/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index e4f7f4eeae0..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,374 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.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 kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.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) - } - } - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 08822c67e32..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,198 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/store/order", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 258a2540e9e..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,363 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/login", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a6..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -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-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index e7f366d02cd..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - 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-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfa..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(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() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -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-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@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-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479a..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db94811..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-moshi-codegen/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a31..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 9c22257e223..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf() -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc14..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 06d9fe0bdc8..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b7..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index 18d2ce3dbbe..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,33 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ -@JsonClass(generateAdapter = true) -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index 8396fa42357..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,30 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * A category for a pet - * @param id - * @param name - */ -@JsonClass(generateAdapter = true) -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-moshi-codegen/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index d7091dd4c0c..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,55 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ -@JsonClass(generateAdapter = true) -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? = null -) { - - /** - * 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-moshi-codegen/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index 8b4e6b44d4c..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,57 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * 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 - */ -@JsonClass(generateAdapter = true) -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") - 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-moshi-codegen/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index e7cdab2bb5d..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,30 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * A tag for a pet - * @param id - * @param name - */ -@JsonClass(generateAdapter = true) -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-moshi-codegen/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index 1bfad844904..00000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,49 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * 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 - */ -@JsonClass(generateAdapter = true) -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-nonpublic/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index 69cb6b35ef2..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,374 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.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 kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.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) - } - } - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 4f8898adf9b..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,198 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/store/order", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 725b36b0106..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,363 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/login", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index d26cda9091c..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -internal typealias MultiValueMap = MutableMap> - -internal fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -internal val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -internal fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -internal 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-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 473b3fd42ce..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -internal open class ApiClient(val baseUrl: String) { - internal companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - 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-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index c618544573e..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -internal enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -internal interface Response - -internal abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -internal class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -internal class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -internal class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -internal class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -internal class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index d7f9079c0d5..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -internal object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index 86bcb51fba6..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -internal 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-nonpublic/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index 204b69dcb08..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -internal open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - internal companion object { - private const val serialVersionUID: Long = 123L - } -} - -internal open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - internal companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index e86215d5717..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -internal 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-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index fe7069904ca..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -internal 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-nonpublic/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index be7703c103d..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -internal 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-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 3e87d2c30f9..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -internal data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf() -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index e0fbb1e6526..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -internal enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 858d1b7339b..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -internal val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -internal val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -internal val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -internal val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 371e2a7013e..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -internal object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index 02fa692b57d..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -internal class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index a695278dfa3..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -internal data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index 376994a9b25..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A category for a pet - * @param id - * @param name - */ - -internal 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-nonpublic/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index a943b97c1ea..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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 - */ - -internal 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? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - internal 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-nonpublic/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index 544fab20f5a..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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 - */ - -internal 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") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - internal 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-nonpublic/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index d9b84e93eaf..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A tag for a pet - * @param id - * @param name - */ - -internal 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-nonpublic/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index e0e821cd7e3..00000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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 - */ - -internal 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-nullable/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index ef80c520fd2..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,374 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.List or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List? { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.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 kotlin.collections.List or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List? { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.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) - } - } - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet? { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse? { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index b9dd7b38f59..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,198 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.Map or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map? { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 Order or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order? { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body order placed for purchasing the pet - * @return Order or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order? { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/store/order", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 2ae5998489d..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,363 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 User or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User? { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.String or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String? { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/login", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a6..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index e7f366d02cd..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - 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-nullable/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 77066de4e55..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(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() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@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-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479a..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db94811..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a31..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-nullable/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 9c22257e223..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf() -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc14..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 697559b2ec1..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b7..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index 7d40c8efbc2..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,38 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index ceb0fbc8fe6..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index ed8f8b13a43..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,58 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index 105f485f021..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,60 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A pet for sale in the pet store - * @param 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") - val status: Pet.Status? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 944b1cd0a14..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index 9697f07d5bf..00000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index e4f7f4eeae0..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,374 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.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 kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.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) - } - } - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 08822c67e32..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,198 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/store/order", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 258a2540e9e..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,363 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/login", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a6..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -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-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index f60e40309bc..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,249 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.MediaType -import okhttp3.FormBody -import okhttp3.HttpUrl -import okhttp3.ResponseBody -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> RequestBody.create( - MediaType.parse(mediaType), content - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.of( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = MediaType.parse(guessContentTypeFromFile(value)) - addPart(partHeaders, RequestBody.create(fileMediaType, value)) - } else { - val partHeaders = Headers.of( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - RequestBody.create(null, parameterToString(value)) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> RequestBody.create( - MediaType.parse(mediaType), Serializer.moshi.adapter(T::class.java).toJson(content) - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { - val httpUrl = HttpUrl.parse(baseUrl) ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code(), - response.headers().toMultimap() - ) - response.isInformational -> return Informational( - response.message(), - response.code(), - response.headers().toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body(), accept), - response.code(), - response.headers().toMultimap() - ) - response.isClientError -> return ClientError( - response.message(), - response.body()?.string(), - response.code(), - response.headers().toMultimap() - ) - else -> return ServerError( - response.message(), - response.body()?.string(), - response.code(), - response.headers().toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - 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-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfa..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(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() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -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-okhttp3/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@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-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479a..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db94811..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-okhttp3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a31..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 9c22257e223..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf() -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 037fedbd18b..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code() in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code() in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code() in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code() in 500..999 diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 697559b2ec1..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b7..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index fafca8738f6..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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 ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index a4c17c3b49d..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-okhttp3/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index a66c335904e..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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? = null -) { - - /** - * 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-okhttp3/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index a3df06cb6eb..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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") - 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-okhttp3/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 6e619023a5c..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-okhttp3/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index af1e270325d..00000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-retrofit2-rx3/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index b52cebf4c31..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,125 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import okhttp3.RequestBody -import io.reactivex.rxjava3.core.Single; -import io.reactivex.rxjava3.core.Completable; - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import okhttp3.MultipartBody - -interface PetApi { - /** - * Add a new pet to the store - * - * Responses: - * - 405: Invalid input - * - * @param body Pet object that needs to be added to the store - * @return [Call]<[Unit]> - */ - @POST("pet") - fun addPet(@Body body: Pet): Completable - - /** - * Deletes a pet - * - * Responses: - * - 400: Invalid pet value - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return [Call]<[Unit]> - */ - @DELETE("pet/{petId}") - fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Completable - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Responses: - * - 200: successful operation - * - 400: Invalid status value - * - * @param status Status values that need to be considered for filter - * @return [Call]<[kotlin.collections.List]> - */ - @GET("pet/findByStatus") - fun findPetsByStatus(@Query("status") status: CSVParams): Single> - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Responses: - * - 200: successful operation - * - 400: Invalid tag value - * - * @param tags Tags to filter by - * @return [Call]<[kotlin.collections.List]> - */ - @Deprecated("This api was deprecated") - @GET("pet/findByTags") - fun findPetsByTags(@Query("tags") tags: CSVParams): Single> - - /** - * Find pet by ID - * Returns a single pet - * Responses: - * - 200: successful operation - * - 400: Invalid ID supplied - * - 404: Pet not found - * - * @param petId ID of pet to return - * @return [Call]<[Pet]> - */ - @GET("pet/{petId}") - fun getPetById(@Path("petId") petId: kotlin.Long): Single - - /** - * Update an existing pet - * - * Responses: - * - 400: Invalid ID supplied - * - 404: Pet not found - * - 405: Validation exception - * - * @param body Pet object that needs to be added to the store - * @return [Call]<[Unit]> - */ - @PUT("pet") - fun updatePet(@Body body: Pet): Completable - - /** - * Updates a pet in the store with form data - * - * Responses: - * - 405: Invalid input - * - * @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 [Call]<[Unit]> - */ - @FormUrlEncoded - @POST("pet/{petId}") - fun updatePetWithForm(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String, @Field("status") status: kotlin.String): Completable - - /** - * uploads an image - * - * Responses: - * - 200: successful operation - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return [Call]<[ApiResponse]> - */ - @Multipart - @POST("pet/{petId}/uploadImage") - fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part): Single - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 96603a0729a..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import okhttp3.RequestBody -import io.reactivex.rxjava3.core.Single; -import io.reactivex.rxjava3.core.Completable; - -import org.openapitools.client.models.Order - -interface StoreApi { - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Responses: - * - 400: Invalid ID supplied - * - 404: Order not found - * - * @param orderId ID of the order that needs to be deleted - * @return [Call]<[Unit]> - */ - @DELETE("store/order/{orderId}") - fun deleteOrder(@Path("orderId") orderId: kotlin.String): Completable - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Responses: - * - 200: successful operation - * - * @return [Call]<[kotlin.collections.Map]> - */ - @GET("store/inventory") - fun getInventory(): Single> - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Responses: - * - 200: successful operation - * - 400: Invalid ID supplied - * - 404: Order not found - * - * @param orderId ID of pet that needs to be fetched - * @return [Call]<[Order]> - */ - @GET("store/order/{orderId}") - fun getOrderById(@Path("orderId") orderId: kotlin.Long): Single - - /** - * Place an order for a pet - * - * Responses: - * - 200: successful operation - * - 400: Invalid Order - * - * @param body order placed for purchasing the pet - * @return [Call]<[Order]> - */ - @POST("store/order") - fun placeOrder(@Body body: Order): Single - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 4e04bc3627e..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,114 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import okhttp3.RequestBody -import io.reactivex.rxjava3.core.Single; -import io.reactivex.rxjava3.core.Completable; - -import org.openapitools.client.models.User - -interface UserApi { - /** - * Create user - * This can only be done by the logged in user. - * Responses: - * - 0: successful operation - * - * @param body Created user object - * @return [Call]<[Unit]> - */ - @POST("user") - fun createUser(@Body body: User): Completable - - /** - * Creates list of users with given input array - * - * Responses: - * - 0: successful operation - * - * @param body List of user object - * @return [Call]<[Unit]> - */ - @POST("user/createWithArray") - fun createUsersWithArrayInput(@Body body: kotlin.collections.List): Completable - - /** - * Creates list of users with given input array - * - * Responses: - * - 0: successful operation - * - * @param body List of user object - * @return [Call]<[Unit]> - */ - @POST("user/createWithList") - fun createUsersWithListInput(@Body body: kotlin.collections.List): Completable - - /** - * Delete user - * This can only be done by the logged in user. - * Responses: - * - 400: Invalid username supplied - * - 404: User not found - * - * @param username The name that needs to be deleted - * @return [Call]<[Unit]> - */ - @DELETE("user/{username}") - fun deleteUser(@Path("username") username: kotlin.String): Completable - - /** - * Get user by user name - * - * Responses: - * - 200: successful operation - * - 400: Invalid username supplied - * - 404: User not found - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return [Call]<[User]> - */ - @GET("user/{username}") - fun getUserByName(@Path("username") username: kotlin.String): Single - - /** - * Logs user into the system - * - * Responses: - * - 200: successful operation - * - 400: Invalid username/password supplied - * - * @param username The user name for login - * @param password The password for login in clear text - * @return [Call]<[kotlin.String]> - */ - @GET("user/login") - fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Single - - /** - * Logs out current logged in user session - * - * Responses: - * - 0: successful operation - * - * @return [Call]<[Unit]> - */ - @GET("user/logout") - fun logoutUser(): Completable - - /** - * Updated user - * This can only be done by the logged in user. - * Responses: - * - 400: Invalid user supplied - * - 404: User not found - * - * @param username name that need to be deleted - * @param body Updated user object - * @return [Call]<[Unit]> - */ - @PUT("user/{username}") - fun updateUser(@Path("username") username: kotlin.String, @Body body: User): Completable - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt deleted file mode 100644 index 524d5190ef8..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt +++ /dev/null @@ -1,50 +0,0 @@ -package org.openapitools.client.auth - -import java.io.IOException -import java.net.URI -import java.net.URISyntaxException - -import okhttp3.Interceptor -import okhttp3.Response - -class ApiKeyAuth( - private val location: String = "", - private val paramName: String = "", - private var apiKey: String = "" -) : Interceptor { - - @Throws(IOException::class) - override fun intercept(chain: Interceptor.Chain): Response { - var request = chain.request() - - if ("query" == location) { - var newQuery = request.url.toUri().query - val paramValue = "$paramName=$apiKey" - if (newQuery == null) { - newQuery = paramValue - } else { - newQuery += "&$paramValue" - } - - val newUri: URI - try { - val oldUri = request.url.toUri() - newUri = URI(oldUri.scheme, oldUri.authority, - oldUri.path, newQuery, oldUri.fragment) - } catch (e: URISyntaxException) { - throw IOException(e) - } - - request = request.newBuilder().url(newUri.toURL()).build() - } else if ("header" == location) { - request = request.newBuilder() - .addHeader(paramName, apiKey) - .build() - } else if ("cookie" == location) { - request = request.newBuilder() - .addHeader("Cookie", "$paramName=$apiKey") - .build() - } - return chain.proceed(request) - } -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuth.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuth.kt deleted file mode 100644 index 311a8f43979..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuth.kt +++ /dev/null @@ -1,151 +0,0 @@ -package org.openapitools.client.auth - -import java.net.HttpURLConnection.HTTP_UNAUTHORIZED -import java.net.HttpURLConnection.HTTP_FORBIDDEN - -import java.io.IOException - -import org.apache.oltu.oauth2.client.OAuthClient -import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest -import org.apache.oltu.oauth2.client.request.OAuthClientRequest -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import org.apache.oltu.oauth2.common.exception.OAuthProblemException -import org.apache.oltu.oauth2.common.exception.OAuthSystemException -import org.apache.oltu.oauth2.common.message.types.GrantType -import org.apache.oltu.oauth2.common.token.BasicOAuthToken - -import okhttp3.Interceptor -import okhttp3.OkHttpClient -import okhttp3.Response - -class OAuth( - client: OkHttpClient, - var tokenRequestBuilder: TokenRequestBuilder -) : Interceptor { - - interface AccessTokenListener { - fun notify(token: BasicOAuthToken) - } - - private var oauthClient: OAuthClient = OAuthClient(OAuthOkHttpClient(client)) - - @Volatile - private var accessToken: String? = null - var authenticationRequestBuilder: AuthenticationRequestBuilder? = null - private var accessTokenListener: AccessTokenListener? = null - - constructor( - requestBuilder: TokenRequestBuilder - ) : this( - OkHttpClient(), - requestBuilder - ) - - constructor( - flow: OAuthFlow, - authorizationUrl: String, - tokenUrl: String, - scopes: String - ) : this( - OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes) - ) { - setFlow(flow); - authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl); - } - - fun setFlow(flow: OAuthFlow) { - when (flow) { - OAuthFlow.accessCode, OAuthFlow.implicit -> - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE) - OAuthFlow.password -> - tokenRequestBuilder.setGrantType(GrantType.PASSWORD) - OAuthFlow.application -> - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS) - } - } - - @Throws(IOException::class) - override fun intercept(chain: Interceptor.Chain): Response { - return retryingIntercept(chain, true) - } - - @Throws(IOException::class) - private fun retryingIntercept(chain: Interceptor.Chain, updateTokenAndRetryOnAuthorizationFailure: Boolean): Response { - var request = chain.request() - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") != null) { - return chain.proceed(request) - } - - // If first time, get the token - val oAuthRequest: OAuthClientRequest - if (accessToken == null) { - updateAccessToken(null) - } - - if (accessToken != null) { - // Build the request - val rb = request.newBuilder() - - val requestAccessToken = accessToken - try { - oAuthRequest = OAuthBearerClientRequest(request.url.toString()) - .setAccessToken(requestAccessToken) - .buildHeaderMessage() - } catch (e: OAuthSystemException) { - throw IOException(e) - } - - oAuthRequest.headers.entries.forEach { header -> - rb.addHeader(header.key, header.value) - } - rb.url(oAuthRequest.locationUri) - - //Execute the request - val response = chain.proceed(rb.build()) - - // 401/403 most likely indicates that access token has expired. Unless it happens two times in a row. - if ((response.code == HTTP_UNAUTHORIZED || response.code == HTTP_FORBIDDEN) && updateTokenAndRetryOnAuthorizationFailure) { - try { - if (updateAccessToken(requestAccessToken)) { - response.body?.close() - return retryingIntercept(chain, false) - } - } catch (e: Exception) { - response.body?.close() - throw e - } - } - return response - } else { - return chain.proceed(chain.request()) - } - } - - /** - * Returns true if the access token has been updated - */ - @Throws(IOException::class) - @Synchronized - fun updateAccessToken(requestAccessToken: String?): Boolean { - if (accessToken == null || accessToken.equals(requestAccessToken)) { - return try { - val accessTokenResponse = oauthClient.accessToken(this.tokenRequestBuilder.buildBodyMessage()) - if (accessTokenResponse != null && accessTokenResponse.accessToken != null) { - accessToken = accessTokenResponse.accessToken - accessTokenListener?.notify(accessTokenResponse.oAuthToken as BasicOAuthToken) - !accessToken.equals(requestAccessToken) - } else { - false - } - } catch (e: OAuthSystemException) { - throw IOException(e) - } catch (e: OAuthProblemException) { - throw IOException(e) - } - } - return true; - } -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthFlow.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthFlow.kt deleted file mode 100644 index bcada9b7a6a..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthFlow.kt +++ /dev/null @@ -1,5 +0,0 @@ -package org.openapitools.client.auth - -enum class OAuthFlow { - accessCode, implicit, password, application -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt deleted file mode 100644 index 93adbda3fc9..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt +++ /dev/null @@ -1,61 +0,0 @@ -package org.openapitools.client.auth - -import java.io.IOException - -import org.apache.oltu.oauth2.client.HttpClient -import org.apache.oltu.oauth2.client.request.OAuthClientRequest -import org.apache.oltu.oauth2.client.response.OAuthClientResponse -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory -import org.apache.oltu.oauth2.common.exception.OAuthProblemException -import org.apache.oltu.oauth2.common.exception.OAuthSystemException - -import okhttp3.OkHttpClient -import okhttp3.Request -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.RequestBody - - -class OAuthOkHttpClient( - private var client: OkHttpClient -) : HttpClient { - - constructor() : this(OkHttpClient()) - - @Throws(OAuthSystemException::class, OAuthProblemException::class) - override fun execute( - request: OAuthClientRequest, - headers: Map?, - requestMethod: String, - responseClass: Class?): T { - - var mediaType = "application/json".toMediaTypeOrNull() - val requestBuilder = Request.Builder().url(request.locationUri) - - headers?.forEach { entry -> - if (entry.key.equals("Content-Type", true)) { - mediaType = entry.value.toMediaTypeOrNull() - } else { - requestBuilder.addHeader(entry.key, entry.value) - } - } - - val body: RequestBody? = if (request.body != null) RequestBody.create(mediaType, request.body) else null - requestBuilder.method(requestMethod, body) - - try { - val response = client.newCall(requestBuilder.build()).execute() - return OAuthClientResponseFactory.createCustomResponse( - response.body?.string(), - response.body?.contentType()?.toString(), - response.code, - responseClass) - } catch (e: IOException) { - throw OAuthSystemException(e) - } - } - - override fun shutdown() { - // Nothing to do here - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index e3962e0c0f2..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,204 +0,0 @@ -package org.openapitools.client.infrastructure - -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import org.openapitools.client.auth.ApiKeyAuth -import org.openapitools.client.auth.OAuth -import org.openapitools.client.auth.OAuth.AccessTokenListener -import org.openapitools.client.auth.OAuthFlow - -import okhttp3.Interceptor -import okhttp3.OkHttpClient -import retrofit2.Retrofit -import okhttp3.logging.HttpLoggingInterceptor -import retrofit2.converter.scalars.ScalarsConverterFactory -import retrofit2.adapter.rxjava3.RxJava3CallAdapterFactory -import com.squareup.moshi.Moshi -import retrofit2.converter.moshi.MoshiConverterFactory - -class ApiClient( - private var baseUrl: String = defaultBasePath, - private val okHttpClientBuilder: OkHttpClient.Builder? = null, - private val serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - private val okHttpClient : OkHttpClient? = null -) { - private val apiAuthorizations = mutableMapOf() - var logger: ((String) -> Unit)? = null - - private val retrofitBuilder: Retrofit.Builder by lazy { - Retrofit.Builder() - .baseUrl(baseUrl) - .addConverterFactory(ScalarsConverterFactory.create()) - - .addCallAdapterFactory(RxJava3CallAdapterFactory.create()) - .addConverterFactory(MoshiConverterFactory.create(serializerBuilder.build())) - } - - private val clientBuilder: OkHttpClient.Builder by lazy { - okHttpClientBuilder ?: defaultClientBuilder - } - - private val defaultClientBuilder: OkHttpClient.Builder by lazy { - OkHttpClient() - .newBuilder() - .addInterceptor(HttpLoggingInterceptor(object : HttpLoggingInterceptor.Logger { - override fun log(message: String) { - logger?.invoke(message) - } - }).apply { - level = HttpLoggingInterceptor.Level.BODY - }) - } - - init { - normalizeBaseUrl() - } - - constructor( - baseUrl: String = defaultBasePath, - okHttpClientBuilder: OkHttpClient.Builder? = null, - serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - authNames: Array - ) : this(baseUrl, okHttpClientBuilder, serializerBuilder) { - authNames.forEach { authName -> - val auth = when (authName) { - "api_key" -> ApiKeyAuth("header", "api_key")"petstore_auth" -> OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets") - else -> throw RuntimeException("auth name $authName not found in available auth names") - } - addAuthorization(authName, auth); - } - } - - constructor( - baseUrl: String = defaultBasePath, - okHttpClientBuilder: OkHttpClient.Builder? = null, - serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - authName: String, - clientId: String, - secret: String, - username: String, - password: String - ) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) { - getTokenEndPoint() - ?.setClientId(clientId) - ?.setClientSecret(secret) - ?.setUsername(username) - ?.setPassword(password) - } - - /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ - fun getTokenEndPoint(): TokenRequestBuilder? { - var result: TokenRequestBuilder? = null - apiAuthorizations.values.runOnFirst { - result = tokenRequestBuilder - } - return result - } - - /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ - fun getAuthorizationEndPoint(): AuthenticationRequestBuilder? { - var result: AuthenticationRequestBuilder? = null - apiAuthorizations.values.runOnFirst { - result = authenticationRequestBuilder - } - return result - } - - /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - * @return ApiClient - */ - fun setAccessToken(accessToken: String): ApiClient { - apiAuthorizations.values.runOnFirst { - setAccessToken(accessToken) - } - return this - } - - /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - * @return ApiClient - */ - fun configureAuthorizationFlow(clientId: String, clientSecret: String, redirectURI: String): ApiClient { - apiAuthorizations.values.runOnFirst { - tokenRequestBuilder - .setClientId(clientId) - .setClientSecret(clientSecret) - .setRedirectURI(redirectURI) - authenticationRequestBuilder - ?.setClientId(clientId) - ?.setRedirectURI(redirectURI) - } - return this; - } - - /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - * @return ApiClient - */ - fun registerAccessTokenListener(accessTokenListener: AccessTokenListener): ApiClient { - apiAuthorizations.values.runOnFirst { - registerAccessTokenListener(accessTokenListener) - } - return this; - } - - /** - * Adds an authorization to be used by the client - * @param authName Authentication name - * @param authorization Authorization interceptor - * @return ApiClient - */ - fun addAuthorization(authName: String, authorization: Interceptor): ApiClient { - if (apiAuthorizations.containsKey(authName)) { - throw RuntimeException("auth name $authName already in api authorizations") - } - apiAuthorizations[authName] = authorization - clientBuilder.addInterceptor(authorization) - return this - } - - fun setLogger(logger: (String) -> Unit): ApiClient { - this.logger = logger - return this - } - - fun createService(serviceClass: Class): S { - var usedClient: OkHttpClient? = null - this.okHttpClient?.let { usedClient = it } ?: run {usedClient = clientBuilder.build()} - return retrofitBuilder.client(usedClient).build().create(serviceClass) - } - - private fun normalizeBaseUrl() { - if (!baseUrl.endsWith("/")) { - baseUrl += "/" - } - } - - private inline fun Iterable.runOnFirst(callback: U.() -> Unit) { - for (element in this) { - if (element is U) { - callback.invoke(element) - break - } - } - } - - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -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-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt deleted file mode 100644 index 001e99325d2..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.client.infrastructure - -class CollectionFormats { - - open class CSVParams { - - var params: List - - constructor(params: List) { - this.params = params - } - - constructor(vararg params: String) { - this.params = listOf(*params) - } - - override fun toString(): String { - return params.joinToString(",") - } - } - - open class SSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString(" ") - } - } - - class TSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("\t") - } - } - - class PIPESParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("|") - } - } - - class SPACEParams : SSVParams() -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479a..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db94811..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a31..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt deleted file mode 100644 index 1804d1ae2bb..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.JsonDataException -import com.squareup.moshi.Moshi -import retrofit2.Response - -@Throws(JsonDataException::class) -inline fun Response<*>.getErrorResponse(serializerBuilder: Moshi.Builder = Serializer.moshiBuilder): T? { - val serializer = serializerBuilder.build() - val parser = serializer.adapter(T::class.java) - val response = errorBody()?.string() - if(response != null) { - return parser.fromJson(response) - } - return null -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 697559b2ec1..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b7..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index fafca8738f6..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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 ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index a4c17c3b49d..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-retrofit2-rx3/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index a66c335904e..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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? = null -) { - - /** - * 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-retrofit2-rx3/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index a3df06cb6eb..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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") - 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-retrofit2-rx3/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 6e619023a5c..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-retrofit2-rx3/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index af1e270325d..00000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-retrofit2/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index 4d78248129c..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,124 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import retrofit2.Call -import okhttp3.RequestBody - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import okhttp3.MultipartBody - -interface PetApi { - /** - * Add a new pet to the store - * - * Responses: - * - 405: Invalid input - * - * @param body Pet object that needs to be added to the store - * @return [Call]<[Unit]> - */ - @POST("pet") - fun addPet(@Body body: Pet): Call - - /** - * Deletes a pet - * - * Responses: - * - 400: Invalid pet value - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return [Call]<[Unit]> - */ - @DELETE("pet/{petId}") - fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Call - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Responses: - * - 200: successful operation - * - 400: Invalid status value - * - * @param status Status values that need to be considered for filter - * @return [Call]<[kotlin.collections.List]> - */ - @GET("pet/findByStatus") - fun findPetsByStatus(@Query("status") status: CSVParams): Call> - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Responses: - * - 200: successful operation - * - 400: Invalid tag value - * - * @param tags Tags to filter by - * @return [Call]<[kotlin.collections.List]> - */ - @Deprecated("This api was deprecated") - @GET("pet/findByTags") - fun findPetsByTags(@Query("tags") tags: CSVParams): Call> - - /** - * Find pet by ID - * Returns a single pet - * Responses: - * - 200: successful operation - * - 400: Invalid ID supplied - * - 404: Pet not found - * - * @param petId ID of pet to return - * @return [Call]<[Pet]> - */ - @GET("pet/{petId}") - fun getPetById(@Path("petId") petId: kotlin.Long): Call - - /** - * Update an existing pet - * - * Responses: - * - 400: Invalid ID supplied - * - 404: Pet not found - * - 405: Validation exception - * - * @param body Pet object that needs to be added to the store - * @return [Call]<[Unit]> - */ - @PUT("pet") - fun updatePet(@Body body: Pet): Call - - /** - * Updates a pet in the store with form data - * - * Responses: - * - 405: Invalid input - * - * @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 [Call]<[Unit]> - */ - @FormUrlEncoded - @POST("pet/{petId}") - fun updatePetWithForm(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String, @Field("status") status: kotlin.String): Call - - /** - * uploads an image - * - * Responses: - * - 200: successful operation - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return [Call]<[ApiResponse]> - */ - @Multipart - @POST("pet/{petId}/uploadImage") - fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part): Call - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 45b6d20b1c7..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,62 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import retrofit2.Call -import okhttp3.RequestBody - -import org.openapitools.client.models.Order - -interface StoreApi { - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Responses: - * - 400: Invalid ID supplied - * - 404: Order not found - * - * @param orderId ID of the order that needs to be deleted - * @return [Call]<[Unit]> - */ - @DELETE("store/order/{orderId}") - fun deleteOrder(@Path("orderId") orderId: kotlin.String): Call - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Responses: - * - 200: successful operation - * - * @return [Call]<[kotlin.collections.Map]> - */ - @GET("store/inventory") - fun getInventory(): Call> - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Responses: - * - 200: successful operation - * - 400: Invalid ID supplied - * - 404: Order not found - * - * @param orderId ID of pet that needs to be fetched - * @return [Call]<[Order]> - */ - @GET("store/order/{orderId}") - fun getOrderById(@Path("orderId") orderId: kotlin.Long): Call - - /** - * Place an order for a pet - * - * Responses: - * - 200: successful operation - * - 400: Invalid Order - * - * @param body order placed for purchasing the pet - * @return [Call]<[Order]> - */ - @POST("store/order") - fun placeOrder(@Body body: Order): Call - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 33f031ec714..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,113 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import retrofit2.Call -import okhttp3.RequestBody - -import org.openapitools.client.models.User - -interface UserApi { - /** - * Create user - * This can only be done by the logged in user. - * Responses: - * - 0: successful operation - * - * @param body Created user object - * @return [Call]<[Unit]> - */ - @POST("user") - fun createUser(@Body body: User): Call - - /** - * Creates list of users with given input array - * - * Responses: - * - 0: successful operation - * - * @param body List of user object - * @return [Call]<[Unit]> - */ - @POST("user/createWithArray") - fun createUsersWithArrayInput(@Body body: kotlin.collections.List): Call - - /** - * Creates list of users with given input array - * - * Responses: - * - 0: successful operation - * - * @param body List of user object - * @return [Call]<[Unit]> - */ - @POST("user/createWithList") - fun createUsersWithListInput(@Body body: kotlin.collections.List): Call - - /** - * Delete user - * This can only be done by the logged in user. - * Responses: - * - 400: Invalid username supplied - * - 404: User not found - * - * @param username The name that needs to be deleted - * @return [Call]<[Unit]> - */ - @DELETE("user/{username}") - fun deleteUser(@Path("username") username: kotlin.String): Call - - /** - * Get user by user name - * - * Responses: - * - 200: successful operation - * - 400: Invalid username supplied - * - 404: User not found - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return [Call]<[User]> - */ - @GET("user/{username}") - fun getUserByName(@Path("username") username: kotlin.String): Call - - /** - * Logs user into the system - * - * Responses: - * - 200: successful operation - * - 400: Invalid username/password supplied - * - * @param username The user name for login - * @param password The password for login in clear text - * @return [Call]<[kotlin.String]> - */ - @GET("user/login") - fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Call - - /** - * Logs out current logged in user session - * - * Responses: - * - 0: successful operation - * - * @return [Call]<[Unit]> - */ - @GET("user/logout") - fun logoutUser(): Call - - /** - * Updated user - * This can only be done by the logged in user. - * Responses: - * - 400: Invalid user supplied - * - 404: User not found - * - * @param username name that need to be deleted - * @param body Updated user object - * @return [Call]<[Unit]> - */ - @PUT("user/{username}") - fun updateUser(@Path("username") username: kotlin.String, @Body body: User): Call - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt deleted file mode 100644 index 524d5190ef8..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt +++ /dev/null @@ -1,50 +0,0 @@ -package org.openapitools.client.auth - -import java.io.IOException -import java.net.URI -import java.net.URISyntaxException - -import okhttp3.Interceptor -import okhttp3.Response - -class ApiKeyAuth( - private val location: String = "", - private val paramName: String = "", - private var apiKey: String = "" -) : Interceptor { - - @Throws(IOException::class) - override fun intercept(chain: Interceptor.Chain): Response { - var request = chain.request() - - if ("query" == location) { - var newQuery = request.url.toUri().query - val paramValue = "$paramName=$apiKey" - if (newQuery == null) { - newQuery = paramValue - } else { - newQuery += "&$paramValue" - } - - val newUri: URI - try { - val oldUri = request.url.toUri() - newUri = URI(oldUri.scheme, oldUri.authority, - oldUri.path, newQuery, oldUri.fragment) - } catch (e: URISyntaxException) { - throw IOException(e) - } - - request = request.newBuilder().url(newUri.toURL()).build() - } else if ("header" == location) { - request = request.newBuilder() - .addHeader(paramName, apiKey) - .build() - } else if ("cookie" == location) { - request = request.newBuilder() - .addHeader("Cookie", "$paramName=$apiKey") - .build() - } - return chain.proceed(request) - } -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuth.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuth.kt deleted file mode 100644 index 311a8f43979..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuth.kt +++ /dev/null @@ -1,151 +0,0 @@ -package org.openapitools.client.auth - -import java.net.HttpURLConnection.HTTP_UNAUTHORIZED -import java.net.HttpURLConnection.HTTP_FORBIDDEN - -import java.io.IOException - -import org.apache.oltu.oauth2.client.OAuthClient -import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest -import org.apache.oltu.oauth2.client.request.OAuthClientRequest -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import org.apache.oltu.oauth2.common.exception.OAuthProblemException -import org.apache.oltu.oauth2.common.exception.OAuthSystemException -import org.apache.oltu.oauth2.common.message.types.GrantType -import org.apache.oltu.oauth2.common.token.BasicOAuthToken - -import okhttp3.Interceptor -import okhttp3.OkHttpClient -import okhttp3.Response - -class OAuth( - client: OkHttpClient, - var tokenRequestBuilder: TokenRequestBuilder -) : Interceptor { - - interface AccessTokenListener { - fun notify(token: BasicOAuthToken) - } - - private var oauthClient: OAuthClient = OAuthClient(OAuthOkHttpClient(client)) - - @Volatile - private var accessToken: String? = null - var authenticationRequestBuilder: AuthenticationRequestBuilder? = null - private var accessTokenListener: AccessTokenListener? = null - - constructor( - requestBuilder: TokenRequestBuilder - ) : this( - OkHttpClient(), - requestBuilder - ) - - constructor( - flow: OAuthFlow, - authorizationUrl: String, - tokenUrl: String, - scopes: String - ) : this( - OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes) - ) { - setFlow(flow); - authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl); - } - - fun setFlow(flow: OAuthFlow) { - when (flow) { - OAuthFlow.accessCode, OAuthFlow.implicit -> - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE) - OAuthFlow.password -> - tokenRequestBuilder.setGrantType(GrantType.PASSWORD) - OAuthFlow.application -> - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS) - } - } - - @Throws(IOException::class) - override fun intercept(chain: Interceptor.Chain): Response { - return retryingIntercept(chain, true) - } - - @Throws(IOException::class) - private fun retryingIntercept(chain: Interceptor.Chain, updateTokenAndRetryOnAuthorizationFailure: Boolean): Response { - var request = chain.request() - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") != null) { - return chain.proceed(request) - } - - // If first time, get the token - val oAuthRequest: OAuthClientRequest - if (accessToken == null) { - updateAccessToken(null) - } - - if (accessToken != null) { - // Build the request - val rb = request.newBuilder() - - val requestAccessToken = accessToken - try { - oAuthRequest = OAuthBearerClientRequest(request.url.toString()) - .setAccessToken(requestAccessToken) - .buildHeaderMessage() - } catch (e: OAuthSystemException) { - throw IOException(e) - } - - oAuthRequest.headers.entries.forEach { header -> - rb.addHeader(header.key, header.value) - } - rb.url(oAuthRequest.locationUri) - - //Execute the request - val response = chain.proceed(rb.build()) - - // 401/403 most likely indicates that access token has expired. Unless it happens two times in a row. - if ((response.code == HTTP_UNAUTHORIZED || response.code == HTTP_FORBIDDEN) && updateTokenAndRetryOnAuthorizationFailure) { - try { - if (updateAccessToken(requestAccessToken)) { - response.body?.close() - return retryingIntercept(chain, false) - } - } catch (e: Exception) { - response.body?.close() - throw e - } - } - return response - } else { - return chain.proceed(chain.request()) - } - } - - /** - * Returns true if the access token has been updated - */ - @Throws(IOException::class) - @Synchronized - fun updateAccessToken(requestAccessToken: String?): Boolean { - if (accessToken == null || accessToken.equals(requestAccessToken)) { - return try { - val accessTokenResponse = oauthClient.accessToken(this.tokenRequestBuilder.buildBodyMessage()) - if (accessTokenResponse != null && accessTokenResponse.accessToken != null) { - accessToken = accessTokenResponse.accessToken - accessTokenListener?.notify(accessTokenResponse.oAuthToken as BasicOAuthToken) - !accessToken.equals(requestAccessToken) - } else { - false - } - } catch (e: OAuthSystemException) { - throw IOException(e) - } catch (e: OAuthProblemException) { - throw IOException(e) - } - } - return true; - } -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthFlow.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthFlow.kt deleted file mode 100644 index bcada9b7a6a..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthFlow.kt +++ /dev/null @@ -1,5 +0,0 @@ -package org.openapitools.client.auth - -enum class OAuthFlow { - accessCode, implicit, password, application -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt deleted file mode 100644 index 93adbda3fc9..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt +++ /dev/null @@ -1,61 +0,0 @@ -package org.openapitools.client.auth - -import java.io.IOException - -import org.apache.oltu.oauth2.client.HttpClient -import org.apache.oltu.oauth2.client.request.OAuthClientRequest -import org.apache.oltu.oauth2.client.response.OAuthClientResponse -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory -import org.apache.oltu.oauth2.common.exception.OAuthProblemException -import org.apache.oltu.oauth2.common.exception.OAuthSystemException - -import okhttp3.OkHttpClient -import okhttp3.Request -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.RequestBody - - -class OAuthOkHttpClient( - private var client: OkHttpClient -) : HttpClient { - - constructor() : this(OkHttpClient()) - - @Throws(OAuthSystemException::class, OAuthProblemException::class) - override fun execute( - request: OAuthClientRequest, - headers: Map?, - requestMethod: String, - responseClass: Class?): T { - - var mediaType = "application/json".toMediaTypeOrNull() - val requestBuilder = Request.Builder().url(request.locationUri) - - headers?.forEach { entry -> - if (entry.key.equals("Content-Type", true)) { - mediaType = entry.value.toMediaTypeOrNull() - } else { - requestBuilder.addHeader(entry.key, entry.value) - } - } - - val body: RequestBody? = if (request.body != null) RequestBody.create(mediaType, request.body) else null - requestBuilder.method(requestMethod, body) - - try { - val response = client.newCall(requestBuilder.build()).execute() - return OAuthClientResponseFactory.createCustomResponse( - response.body?.string(), - response.body?.contentType()?.toString(), - response.code, - responseClass) - } catch (e: IOException) { - throw OAuthSystemException(e) - } - } - - override fun shutdown() { - // Nothing to do here - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 8f822585a6e..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,201 +0,0 @@ -package org.openapitools.client.infrastructure - -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import org.openapitools.client.auth.ApiKeyAuth -import org.openapitools.client.auth.OAuth -import org.openapitools.client.auth.OAuth.AccessTokenListener -import org.openapitools.client.auth.OAuthFlow - -import okhttp3.Interceptor -import okhttp3.OkHttpClient -import retrofit2.Retrofit -import okhttp3.logging.HttpLoggingInterceptor -import retrofit2.converter.scalars.ScalarsConverterFactory -import com.squareup.moshi.Moshi -import retrofit2.converter.moshi.MoshiConverterFactory - -class ApiClient( - private var baseUrl: String = defaultBasePath, - private val okHttpClientBuilder: OkHttpClient.Builder? = null, - private val serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - private val okHttpClient : OkHttpClient? = null -) { - private val apiAuthorizations = mutableMapOf() - var logger: ((String) -> Unit)? = null - - private val retrofitBuilder: Retrofit.Builder by lazy { - Retrofit.Builder() - .baseUrl(baseUrl) - .addConverterFactory(ScalarsConverterFactory.create()) - .addConverterFactory(MoshiConverterFactory.create(serializerBuilder.build())) - } - - private val clientBuilder: OkHttpClient.Builder by lazy { - okHttpClientBuilder ?: defaultClientBuilder - } - - private val defaultClientBuilder: OkHttpClient.Builder by lazy { - OkHttpClient() - .newBuilder() - .addInterceptor(HttpLoggingInterceptor(object : HttpLoggingInterceptor.Logger { - override fun log(message: String) { - logger?.invoke(message) - } - }).apply { - level = HttpLoggingInterceptor.Level.BODY - }) - } - - init { - normalizeBaseUrl() - } - - constructor( - baseUrl: String = defaultBasePath, - okHttpClientBuilder: OkHttpClient.Builder? = null, - serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - authNames: Array - ) : this(baseUrl, okHttpClientBuilder, serializerBuilder) { - authNames.forEach { authName -> - val auth = when (authName) { - "api_key" -> ApiKeyAuth("header", "api_key")"petstore_auth" -> OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets") - else -> throw RuntimeException("auth name $authName not found in available auth names") - } - addAuthorization(authName, auth); - } - } - - constructor( - baseUrl: String = defaultBasePath, - okHttpClientBuilder: OkHttpClient.Builder? = null, - serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - authName: String, - clientId: String, - secret: String, - username: String, - password: String - ) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) { - getTokenEndPoint() - ?.setClientId(clientId) - ?.setClientSecret(secret) - ?.setUsername(username) - ?.setPassword(password) - } - - /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ - fun getTokenEndPoint(): TokenRequestBuilder? { - var result: TokenRequestBuilder? = null - apiAuthorizations.values.runOnFirst { - result = tokenRequestBuilder - } - return result - } - - /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ - fun getAuthorizationEndPoint(): AuthenticationRequestBuilder? { - var result: AuthenticationRequestBuilder? = null - apiAuthorizations.values.runOnFirst { - result = authenticationRequestBuilder - } - return result - } - - /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - * @return ApiClient - */ - fun setAccessToken(accessToken: String): ApiClient { - apiAuthorizations.values.runOnFirst { - setAccessToken(accessToken) - } - return this - } - - /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - * @return ApiClient - */ - fun configureAuthorizationFlow(clientId: String, clientSecret: String, redirectURI: String): ApiClient { - apiAuthorizations.values.runOnFirst { - tokenRequestBuilder - .setClientId(clientId) - .setClientSecret(clientSecret) - .setRedirectURI(redirectURI) - authenticationRequestBuilder - ?.setClientId(clientId) - ?.setRedirectURI(redirectURI) - } - return this; - } - - /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - * @return ApiClient - */ - fun registerAccessTokenListener(accessTokenListener: AccessTokenListener): ApiClient { - apiAuthorizations.values.runOnFirst { - registerAccessTokenListener(accessTokenListener) - } - return this; - } - - /** - * Adds an authorization to be used by the client - * @param authName Authentication name - * @param authorization Authorization interceptor - * @return ApiClient - */ - fun addAuthorization(authName: String, authorization: Interceptor): ApiClient { - if (apiAuthorizations.containsKey(authName)) { - throw RuntimeException("auth name $authName already in api authorizations") - } - apiAuthorizations[authName] = authorization - clientBuilder.addInterceptor(authorization) - return this - } - - fun setLogger(logger: (String) -> Unit): ApiClient { - this.logger = logger - return this - } - - fun createService(serviceClass: Class): S { - var usedClient: OkHttpClient? = null - this.okHttpClient?.let { usedClient = it } ?: run {usedClient = clientBuilder.build()} - return retrofitBuilder.client(usedClient).build().create(serviceClass) - } - - private fun normalizeBaseUrl() { - if (!baseUrl.endsWith("/")) { - baseUrl += "/" - } - } - - private inline fun Iterable.runOnFirst(callback: U.() -> Unit) { - for (element in this) { - if (element is U) { - callback.invoke(element) - break - } - } - } - - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -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-retrofit2/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt deleted file mode 100644 index 001e99325d2..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.client.infrastructure - -class CollectionFormats { - - open class CSVParams { - - var params: List - - constructor(params: List) { - this.params = params - } - - constructor(vararg params: String) { - this.params = listOf(*params) - } - - override fun toString(): String { - return params.joinToString(",") - } - } - - open class SSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString(" ") - } - } - - class TSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("\t") - } - } - - class PIPESParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("|") - } - } - - class SPACEParams : SSVParams() -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479a..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db94811..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-retrofit2/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a31..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-retrofit2/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt deleted file mode 100644 index 1804d1ae2bb..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.JsonDataException -import com.squareup.moshi.Moshi -import retrofit2.Response - -@Throws(JsonDataException::class) -inline fun Response<*>.getErrorResponse(serializerBuilder: Moshi.Builder = Serializer.moshiBuilder): T? { - val serializer = serializerBuilder.build() - val parser = serializer.adapter(T::class.java) - val response = errorBody()?.string() - if(response != null) { - return parser.fromJson(response) - } - return null -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 697559b2ec1..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b7..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index fafca8738f6..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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 ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index a4c17c3b49d..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-retrofit2/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index a66c335904e..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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? = null -) { - - /** - * 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-retrofit2/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index a3df06cb6eb..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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") - 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-retrofit2/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 6e619023a5c..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-retrofit2/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index af1e270325d..00000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-string/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index da9784198d1..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,374 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 apiKey (optional) - * @param petId Pet id to delete - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(apiKey: kotlin.String?, petId: kotlin.Long) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.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 kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.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) - } - } - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 08822c67e32..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,198 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/store/order", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 258a2540e9e..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,363 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/login", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a6..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -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-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index e7f366d02cd..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - 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-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfa..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(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() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -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-string/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@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-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479a..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db94811..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a31..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -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-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 9c22257e223..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf() -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc14..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 697559b2ec1..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b7..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index 7d40c8efbc2..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,38 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index ceb0fbc8fe6..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index ec768d1acef..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,58 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: kotlin.String? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index 66667bf07cd..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,60 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A pet for sale in the pet store - * @param id - * @param category - * @param name - * @param photoUrls - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 944b1cd0a14..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index 9697f07d5bf..00000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-string/bin/test/org/openapitools/client/PetApiTest.kt b/samples/client/petstore/kotlin-string/bin/test/org/openapitools/client/PetApiTest.kt deleted file mode 100644 index 5ae1468ad07..00000000000 --- a/samples/client/petstore/kotlin-string/bin/test/org/openapitools/client/PetApiTest.kt +++ /dev/null @@ -1,104 +0,0 @@ -package org.openapitools.client - -import io.kotlintest.shouldBe -import io.kotlintest.matchers.numerics.shouldBeGreaterThan -import io.kotlintest.matchers.string.shouldContain -import io.kotlintest.shouldThrow -import io.kotlintest.specs.ShouldSpec -import org.openapitools.client.apis.PetApi -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.models.Category -import org.openapitools.client.models.Pet -import org.openapitools.client.models.Tag - -class PetApiTest : ShouldSpec() { - init { - - val petId:Long = 10006 - val api = PetApi() - - should("add a pet") { - - val pet = Pet( - id = petId, - name = "kotlin client test", - photoUrls = listOf("http://test_kotlin_unit_test.com"), - category = Category(petId, "test kotlin category"), - tags = listOf(Tag(petId, "test kotlin tag")) - ) - api.addPet(pet) - - } - - should("get pet by id") { - val result = api.getPetById(petId) - - result.id shouldBe (petId) - result.name shouldBe ("kotlin client test") - result.photoUrls[0] shouldBe ("http://test_kotlin_unit_test.com") - result.category!!.id shouldBe (petId) - result.category!!.name shouldBe ("test kotlin category") - result.tags!![0].id shouldBe (petId) - result.tags!![0].name shouldBe ("test kotlin tag") - - } - - should("find pet by status") { - val result = api.findPetsByStatus(listOf("available")) - - result.size.shouldBeGreaterThan(0) - - for(onePet in result) { - onePet.status.shouldBe(Pet.Status.available) - } - - val result2 = api.findPetsByStatus(listOf("unknown_and_incorrect_status")) - - result2.size.shouldBe(0) - - } - - should("update a pet") { - val pet = Pet( - id = petId, - name = "kotlin client updatePet", - status = Pet.Status.pending, - photoUrls = listOf("http://test_kotlin_unit_test.com") - ) - api.updatePet(pet) - - // verify updated Pet - val result = api.getPetById(petId) - result.id shouldBe (petId) - result.name shouldBe ("kotlin client updatePet") - result.status shouldBe (Pet.Status.pending) - - } - - should("update a pet with form") { - val name = "kotlin client updatePet with Form" - val status = "pending" - - api.updatePetWithForm(petId, name, status) - - // verify updated Pet - val result = api.getPetById(petId) - result.id shouldBe (petId) - result.name shouldBe ("kotlin client updatePet with Form") - result.status shouldBe (Pet.Status.pending) - - } - - should("delete a pet") { - api.deletePet("apiKey", petId) - - // verify updated Pet - val exception = shouldThrow { - api.getPetById(petId) - } - exception.message?.shouldContain("Pet not found") - } - - } - -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index e4f7f4eeae0..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,374 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.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 kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.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) - } - } - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 08822c67e32..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,198 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/store/order", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 258a2540e9e..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,363 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/login", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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 body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - 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) - } - } - } - -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a6..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -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-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index cb540f6ebd7..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import org.threeten.bp.LocalDate -import org.threeten.bp.LocalDateTime -import org.threeten.bp.LocalTime -import org.threeten.bp.OffsetDateTime -import org.threeten.bp.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - 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-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfa..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(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() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -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-threetenbp/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@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-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index ff5439aeb42..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import org.threeten.bp.LocalDate -import org.threeten.bp.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-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index 710a9cc1317..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import org.threeten.bp.LocalDateTime -import org.threeten.bp.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-threetenbp/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 28b3eb3cd70..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import org.threeten.bp.OffsetDateTime -import org.threeten.bp.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-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 9c22257e223..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf() -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc14..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 697559b2ec1..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b7..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index fafca8738f6..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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 ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index a4c17c3b49d..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-threetenbp/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index 300f94d8545..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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: org.threeten.bp.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - 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-threetenbp/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index a3df06cb6eb..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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") - 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-threetenbp/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 6e619023a5c..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-threetenbp/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index af1e270325d..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -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-threetenbp/bin/test/org/openapitools/client/PetApiTest.kt b/samples/client/petstore/kotlin-threetenbp/bin/test/org/openapitools/client/PetApiTest.kt deleted file mode 100644 index 5da4f9082a8..00000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/test/org/openapitools/client/PetApiTest.kt +++ /dev/null @@ -1,104 +0,0 @@ -package org.openapitools.client - -import io.kotlintest.shouldBe -import io.kotlintest.matchers.numerics.shouldBeGreaterThan -import io.kotlintest.matchers.string.shouldContain -import io.kotlintest.shouldThrow -import io.kotlintest.specs.ShouldSpec -import org.openapitools.client.apis.PetApi -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.models.Category -import org.openapitools.client.models.Pet -import org.openapitools.client.models.Tag - -class PetApiTest : ShouldSpec() { - init { - - val petId:Long = 10006 - val api = PetApi() - - should("add a pet") { - - val pet = Pet( - id = petId, - name = "kotlin client test", - photoUrls = listOf("http://test_kotlin_unit_test.com"), - category = Category(petId, "test kotlin category"), - tags = listOf(Tag(petId, "test kotlin tag")) - ) - api.addPet(pet) - - } - - should("get pet by id") { - val result = api.getPetById(petId) - - result.id shouldBe (petId) - result.name shouldBe ("kotlin client test") - result.photoUrls[0] shouldBe ("http://test_kotlin_unit_test.com") - result.category!!.id shouldBe (petId) - result.category!!.name shouldBe ("test kotlin category") - result.tags!![0].id shouldBe (petId) - result.tags!![0].name shouldBe ("test kotlin tag") - - } - - should("find pet by status") { - val result = api.findPetsByStatus(listOf("available")) - - result.size.shouldBeGreaterThan(0) - - for(onePet in result) { - onePet.status.shouldBe(Pet.Status.available) - } - - val result2 = api.findPetsByStatus(listOf("unknown_and_incorrect_status")) - - result2.size.shouldBe(0) - - } - - should("update a pet") { - val pet = Pet( - id = petId, - name = "kotlin client updatePet", - status = Pet.Status.pending, - photoUrls = listOf("http://test_kotlin_unit_test.com") - ) - api.updatePet(pet) - - // verify updated Pet - val result = api.getPetById(petId) - result.id shouldBe (petId) - result.name shouldBe ("kotlin client updatePet") - result.status shouldBe (Pet.Status.pending) - - } - - should("update a pet with form") { - val name = "kotlin client updatePet with Form" - val status = "pending" - - api.updatePetWithForm(petId, name, status) - - // verify updated Pet - val result = api.getPetById(petId) - result.id shouldBe (petId) - result.name shouldBe ("kotlin client updatePet with Form") - result.status shouldBe (Pet.Status.pending) - - } - - should("delete a pet") { - api.deletePet(petId, "apiKey") - - // verify updated Pet - val exception = shouldThrow { - api.getPetById(petId) - } - exception.message?.shouldContain("Pet not found") - } - - } - -} diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index 72d24c820e7..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,278 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* OpenAPI spec version: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.* - -class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - */ - fun addPet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional, default to null) - * @return void - */ - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf("api_key" to apiKey.toString()) - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.Array - */ - @Suppress("UNCHECKED_CAST") - fun findPetsByStatus(status: kotlin.Array) : kotlin.Array { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mapOf("status" to toMultiValue(status.toList(), "csv")) - val localVariableHeaders: kotlin.collections.Map = mapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request>( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.Array - */ - @Suppress("UNCHECKED_CAST") - fun findPetsByTags(tags: kotlin.Array) : kotlin.Array { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mapOf("tags" to toMultiValue(tags.toList(), "csv")) - val localVariableHeaders: kotlin.collections.Map = mapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request>( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - */ - @Suppress("UNCHECKED_CAST") - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Pet - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - */ - fun updatePet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional, default to null) - * @param status Updated status of the pet (optional, default to null) - * @return void - */ - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String, status: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = mapOf("name" to "$name", "status" to "$status") - val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf("Content-Type" to "multipart/form-data") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional, default to null) - * @param file file to upload (optional, default to null) - * @return ApiResponse - */ - @Suppress("UNCHECKED_CAST") - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String, file: java.io.File) : ApiResponse { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to "$additionalMetadata", "file" to "$file") - val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf("Content-Type" to "multipart/form-data") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as ApiResponse - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - -} diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 48ecd493a1e..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,146 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* OpenAPI spec version: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.* - -class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - */ - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational reponses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Rediration responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - */ - @Suppress("UNCHECKED_CAST") - fun getInventory() : kotlin.collections.Map { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request>( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - */ - @Suppress("UNCHECKED_CAST") - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Order - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - */ - @Suppress("UNCHECKED_CAST") - fun placeOrder(body: Order) : Order { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/store/order", - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Order - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - -} diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 130def3847f..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,271 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* OpenAPI spec version: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.* - -class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - */ - fun createUser(body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user", - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - */ - fun createUsersWithArrayInput(body: kotlin.Array) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - */ - fun createUsersWithListInput(body: kotlin.Array) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - */ - fun deleteUser(username: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - */ - @Suppress("UNCHECKED_CAST") - fun getUserByName(username: kotlin.String) : User { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as User - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - */ - @Suppress("UNCHECKED_CAST") - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mapOf("username" to listOf("$username"), "password" to listOf("$password")) - val localVariableHeaders: kotlin.collections.Map = mapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/login", - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.String - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - - /** - * Logs out current logged in user session - * - * @return void - */ - fun logoutUser() : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - */ - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mapOf() - val localVariableHeaders: kotlin.collections.Map = mapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val response = request( - localVariableConfig, - localVariableBody - ) - - return when (response.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> TODO() - ResponseType.Redirection -> TODO() - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") - else -> throw kotlin.IllegalStateException("Undefined ResponseType.") - } - } - -} diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index c2c3f1f0eae..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,20 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = Map> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipes" -> "|" - "ssv" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: List, collectionFormat: String, map: (item: Any?) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.map(map).joinToString(separator = collectionDelimiter(collectionFormat))) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 9e79028a90b..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,141 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.Moshi -import com.squareup.moshi.ToJson -import okhttp3.* -import java.io.File -import java.util.* - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val XmlMediaType = "application/xml" - - @JvmStatic - val client by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - - @JvmStatic - var defaultHeaders: Map by ApplicationDelegates.setOnce(mapOf(ContentType to JsonMediaType, Accept to JsonMediaType)) - - @JvmStatic - val jsonHeaders: Map = mapOf(ContentType to JsonMediaType, Accept to JsonMediaType) - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> RequestBody.create( - MediaType.parse(mediaType), content - ) - mediaType == FormDataMediaType -> { - var builder = FormBody.Builder() - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { key, value -> - builder = builder.add(key, value) - } - builder.build() - } - mediaType == JsonMediaType -> RequestBody.create( - MediaType.parse(mediaType), Serializer.moshi.adapter(T::class.java).toJson(content) - ) - mediaType == XmlMediaType -> TODO("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> TODO("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String = JsonMediaType): T? { - if(body == null) return null - return when(mediaType) { - JsonMediaType -> Moshi.Builder().add(object { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - @FromJson - fun fromJson(s: String) = UUID.fromString(s) - }) - .add(ByteArrayAdapter()) - .build().adapter(T::class.java).fromJson(body.source()) - else -> TODO() - } - } - - protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { - val httpUrl = HttpUrl.parse(baseUrl) ?: throw IllegalStateException("baseUrl is invalid.") - - var urlBuilder = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - urlBuilder = urlBuilder.addQueryParameter(query.key, queryValue) - } - } - - val url = urlBuilder.build() - val headers = requestConfig.headers + defaultHeaders - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType,accept options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - val accept = (headers[Accept] as String).substringBefore(";").toLowerCase() - - var request : Request.Builder = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete() - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - } - - headers.forEach { header -> request = request.addHeader(header.key, header.value) } - - val realRequest = request.build() - val response = client.newCall(realRequest).execute() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code(), - response.headers().toMultimap() - ) - response.isInformational -> return Informational( - response.message(), - response.code(), - response.headers().toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body(), accept), - response.code(), - response.headers().toMultimap() - ) - response.isClientError -> return ClientError( - response.body()?.string(), - response.code(), - response.headers().toMultimap() - ) - else -> return ServerError( - null, - response.body()?.string(), - response.code(), - response.headers().toMultimap() - ) - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index f1a8aecc914..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,40 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -abstract class ApiInfrastructureResponse(val responseType: ResponseType) { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index 617ac3fe906..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -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() -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index 2f3b0157ba7..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,42 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException : RuntimeException { - - /** - * Constructs an [ClientException] with no detail message. - */ - constructor() : super() - - /** - * Constructs an [ClientException] with the specified detail message. - - * @param message the detail message. - */ - constructor(message: kotlin.String) : super(message) - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException : RuntimeException { - - /** - * Constructs an [ServerException] with no detail message. - */ - constructor() : super() - - /** - * Constructs an [ServerException] with the specified detail message. - - * @param message the detail message. - */ - constructor(message: kotlin.String) : super(message) - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 86e2dadf9a8..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: Map = mapOf(), - val query: Map> = mapOf() -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index f50104a6f35..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code() in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -val Response.isRedirect : Boolean get() = this.code() in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code() in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code() in 500..999 \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index cf3fe8203d5..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,14 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.KotlinJsonAdapterFactory -import com.squareup.moshi.Moshi -import com.squareup.moshi.Rfc3339DateJsonAdapter -import java.util.* - -object Serializer { - @JvmStatic - val moshi: Moshi = Moshi.Builder() - .add(KotlinJsonAdapterFactory()) - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) - .build() -} diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index b950bdafb57..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,28 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* OpenAPI spec version: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ -data class ApiResponse ( - val code: kotlin.Int? = null, - val type: kotlin.String? = null, - val message: kotlin.String? = null -) { - -} - diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/models/Category.kt deleted file mode 100644 index af700f5488a..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,26 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* OpenAPI spec version: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -/** - * A category for a pet - * @param id - * @param name - */ -data class Category ( - val id: kotlin.Long? = null, - val name: kotlin.String? = null -) { - -} - diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/models/Order.kt deleted file mode 100644 index 44a8b1f896c..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,50 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* OpenAPI spec version: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -/** - * 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 ( - val id: kotlin.Long? = null, - val petId: kotlin.Long? = null, - val quantity: kotlin.Int? = null, - val shipDate: java.time.LocalDateTime? = null, - /* Order Status */ - val status: Order.Status? = null, - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - enum class Status(val value: kotlin.String){ - - @Json(name = "placed") placed("placed"), - - @Json(name = "approved") approved("approved"), - - @Json(name = "delivered") delivered("delivered"); - - } - -} - diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/models/Pet.kt deleted file mode 100644 index 583dd3fb3ae..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,52 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* OpenAPI spec version: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json -/** - * A pet for sale in the pet store - * @param id - * @param category - * @param name - * @param photoUrls - * @param tags - * @param status pet status in the store - */ -data class Pet ( - val name: kotlin.String, - val photoUrls: kotlin.Array, - val id: kotlin.Long? = null, - val category: Category? = null, - val tags: kotlin.Array? = null, - /* pet status in the store */ - 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/bin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/models/Tag.kt deleted file mode 100644 index d2ae2ead613..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,26 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* OpenAPI spec version: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -/** - * A tag for a pet - * @param id - * @param name - */ -data class Tag ( - val id: kotlin.Long? = null, - val name: kotlin.String? = null -) { - -} - diff --git a/samples/client/petstore/kotlin/bin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin/bin/org/openapitools/client/models/User.kt deleted file mode 100644 index a9695bb62ba..00000000000 --- a/samples/client/petstore/kotlin/bin/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,39 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* OpenAPI spec version: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -/** - * 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 ( - val id: kotlin.Long? = null, - val username: kotlin.String? = null, - val firstName: kotlin.String? = null, - val lastName: kotlin.String? = null, - val email: kotlin.String? = null, - val password: kotlin.String? = null, - val phone: kotlin.String? = null, - /* User Status */ - val userStatus: kotlin.Int? = null -) { - -} - diff --git a/samples/client/petstore/powershell/docs/PSPetApi.md b/samples/client/petstore/powershell/docs/PSPetApi.md index fef72996026..862d4898be7 100644 --- a/samples/client/petstore/powershell/docs/PSPetApi.md +++ b/samples/client/petstore/powershell/docs/PSPetApi.md @@ -25,12 +25,12 @@ Add a new pet to the store ```powershell Import-Module -Name PSPetstore -$Configuration = Get-PSPetstoreConfiguration +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration # Configure OAuth2 access token for authorization: petstore_auth -$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; +$Configuration.AccessToken = "YOUR_ACCESS_TOKEN" - -$Pet = (Initialize-Pet-Id 123 -Category (Initialize-Category-Id 123 -Name "Name_example") -Name "Name_example" -PhotoUrls @("PhotoUrls_example") -Tags @((Initialize-Tag-Id 123 -Name "Name_example")) -Status "Status_example") # Pet | Pet object that needs to be added to the store +$Pet = (Initialize-Pet -Id 123 -Category (Initialize-Category -Id 123 -Name "Name_example") -Name "Name_example" -PhotoUrls @("PhotoUrls_example") -Tags @((Initialize-Tag -Id 123 -Name "Name_example")) -Status "available") # Pet | Pet object that needs to be added to the store # Add a new pet to the store try { @@ -74,10 +74,10 @@ Deletes a pet ```powershell Import-Module -Name PSPetstore -$Configuration = Get-PSPetstoreConfiguration +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration # Configure OAuth2 access token for authorization: petstore_auth -$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; - +$Configuration.AccessToken = "YOUR_ACCESS_TOKEN" $PetId = 987 # Int64 | Pet id to delete $ApiKey = "ApiKey_example" # String | (optional) @@ -126,12 +126,12 @@ Multiple status values can be provided with comma separated strings ```powershell Import-Module -Name PSPetstore -$Configuration = Get-PSPetstoreConfiguration +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration # Configure OAuth2 access token for authorization: petstore_auth -$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; +$Configuration.AccessToken = "YOUR_ACCESS_TOKEN" - -$Status = @("Status_example") # String[] | Status values that need to be considered for filter +$Status = @("available") # String[] | Status values that need to be considered for filter # Finds Pets by status try { @@ -176,10 +176,10 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ```powershell Import-Module -Name PSPetstore -$Configuration = Get-PSPetstoreConfiguration +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration # Configure OAuth2 access token for authorization: petstore_auth -$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; - +$Configuration.AccessToken = "YOUR_ACCESS_TOKEN" $Tags = @("Inner_example") # String[] | Tags to filter by @@ -226,12 +226,12 @@ Returns a single pet ```powershell Import-Module -Name PSPetstore -$Configuration = Get-PSPetstoreConfiguration +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration # Configure API key authorization: api_key -$Configuration["ApiKey"]["api_key"] = "YOUR_API_KEY" +$Configuration.ApiKey.api_key = "YOUR_API_KEY" # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -#$Configuration["ApiKeyPrefix"]["api_key"] = "Bearer" - +#$Configuration.ApiKeyPrefix.api_key = "Bearer" $PetId = 987 # Int64 | ID of pet to return @@ -276,12 +276,12 @@ Update an existing pet ```powershell Import-Module -Name PSPetstore -$Configuration = Get-PSPetstoreConfiguration +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration # Configure OAuth2 access token for authorization: petstore_auth -$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; +$Configuration.AccessToken = "YOUR_ACCESS_TOKEN" - -$Pet = (Initialize-Pet-Id 123 -Category (Initialize-Category-Id 123 -Name "Name_example") -Name "Name_example" -PhotoUrls @("PhotoUrls_example") -Tags @((Initialize-Tag-Id 123 -Name "Name_example")) -Status "Status_example") # Pet | Pet object that needs to be added to the store +$Pet = (Initialize-Pet -Id 123 -Category (Initialize-Category -Id 123 -Name "Name_example") -Name "Name_example" -PhotoUrls @("PhotoUrls_example") -Tags @((Initialize-Tag -Id 123 -Name "Name_example")) -Status "available") # Pet | Pet object that needs to be added to the store # Update an existing pet try { @@ -326,10 +326,10 @@ Updates a pet in the store with form data ```powershell Import-Module -Name PSPetstore -$Configuration = Get-PSPetstoreConfiguration +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration # Configure OAuth2 access token for authorization: petstore_auth -$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; - +$Configuration.AccessToken = "YOUR_ACCESS_TOKEN" $PetId = 987 # Int64 | ID of pet that needs to be updated $Name = "Name_example" # String | Updated name of the pet (optional) @@ -380,10 +380,10 @@ uploads an image ```powershell Import-Module -Name PSPetstore -$Configuration = Get-PSPetstoreConfiguration +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration # Configure OAuth2 access token for authorization: petstore_auth -$Configuration["AccessToken"] = "YOUR_ACCESS_TOKEN"; - +$Configuration.AccessToken = "YOUR_ACCESS_TOKEN" $PetId = 987 # Int64 | ID of pet to update $AdditionalMetadata = "AdditionalMetadata_example" # String | Additional data to pass to server (optional) diff --git a/samples/client/petstore/powershell/docs/PSStoreApi.md b/samples/client/petstore/powershell/docs/PSStoreApi.md index c411c2f854f..f12946fb546 100644 --- a/samples/client/petstore/powershell/docs/PSStoreApi.md +++ b/samples/client/petstore/powershell/docs/PSStoreApi.md @@ -67,12 +67,12 @@ Returns a map of status codes to quantities ```powershell Import-Module -Name PSPetstore -$Configuration = Get-PSPetstoreConfiguration +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration # Configure API key authorization: api_key -$Configuration["ApiKey"]["api_key"] = "YOUR_API_KEY" +$Configuration.ApiKey.api_key = "YOUR_API_KEY" # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -#$Configuration["ApiKeyPrefix"]["api_key"] = "Bearer" - +#$Configuration.ApiKeyPrefix.api_key = "Bearer" # Returns pet inventories by status @@ -158,7 +158,7 @@ Place an order for a pet ```powershell Import-Module -Name PSPetstore -$Order = (Initialize-Order-Id 123 -PetId 123 -Quantity 123 -ShipDate Get-Date -Status "Status_example" -Complete $false) # Order | order placed for purchasing the pet +$Order = (Initialize-Order -Id 123 -PetId 123 -Quantity 123 -ShipDate Get-Date -Status "placed" -Complete $false) # Order | order placed for purchasing the pet # Place an order for a pet try { diff --git a/samples/client/petstore/powershell/docs/PSUserApi.md b/samples/client/petstore/powershell/docs/PSUserApi.md index f6ed241c88b..1548935037c 100644 --- a/samples/client/petstore/powershell/docs/PSUserApi.md +++ b/samples/client/petstore/powershell/docs/PSUserApi.md @@ -27,14 +27,14 @@ This can only be done by the logged in user. ```powershell Import-Module -Name PSPetstore -$Configuration = Get-PSPetstoreConfiguration +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration # Configure API key authorization: auth_cookie -$Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY" +$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY" # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer" +#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer" - -$User = (Initialize-User-Id 123 -Username "Username_example" -FirstName "FirstName_example" -LastName "LastName_example" -Email "Email_example" -Password "Password_example" -Phone "Phone_example" -UserStatus 123) # User | Created user object +$User = (Initialize-User -Id 123 -Username "Username_example" -FirstName "FirstName_example" -LastName "LastName_example" -Email "Email_example" -Password "Password_example" -Phone "Phone_example" -UserStatus 123) # User | Created user object # Create user try { @@ -77,14 +77,14 @@ Creates list of users with given input array ```powershell Import-Module -Name PSPetstore -$Configuration = Get-PSPetstoreConfiguration +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration # Configure API key authorization: auth_cookie -$Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY" +$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY" # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer" +#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer" - -$User = @((Initialize-User-Id 123 -Username "Username_example" -FirstName "FirstName_example" -LastName "LastName_example" -Email "Email_example" -Password "Password_example" -Phone "Phone_example" -UserStatus 123)) # User[] | List of user object +$User = @((Initialize-User -Id 123 -Username "Username_example" -FirstName "FirstName_example" -LastName "LastName_example" -Email "Email_example" -Password "Password_example" -Phone "Phone_example" -UserStatus 123)) # User[] | List of user object # Creates list of users with given input array try { @@ -127,12 +127,12 @@ Creates list of users with given input array ```powershell Import-Module -Name PSPetstore -$Configuration = Get-PSPetstoreConfiguration +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration # Configure API key authorization: auth_cookie -$Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY" +$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY" # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer" - +#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer" $User = @() # User[] | List of user object @@ -179,12 +179,12 @@ This can only be done by the logged in user. ```powershell Import-Module -Name PSPetstore -$Configuration = Get-PSPetstoreConfiguration +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration # Configure API key authorization: auth_cookie -$Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY" +$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY" # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer" - +#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer" $Username = "Username_example" # String | The name that needs to be deleted @@ -317,12 +317,12 @@ Logs out current logged in user session ```powershell Import-Module -Name PSPetstore -$Configuration = Get-PSPetstoreConfiguration +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration # Configure API key authorization: auth_cookie -$Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY" +$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY" # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer" - +#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer" # Logs out current logged in user session @@ -366,12 +366,12 @@ This can only be done by the logged in user. ```powershell Import-Module -Name PSPetstore -$Configuration = Get-PSPetstoreConfiguration +# general setting of the PowerShell module, e.g. base URL, authentication, etc +$Configuration = Get-Configuration # Configure API key authorization: auth_cookie -$Configuration["ApiKey"]["AUTH_KEY"] = "YOUR_API_KEY" +$Configuration.ApiKey.AUTH_KEY = "YOUR_API_KEY" # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -#$Configuration["ApiKeyPrefix"]["AUTH_KEY"] = "Bearer" - +#$Configuration.ApiKeyPrefix.AUTH_KEY = "Bearer" $Username = "Username_example" # String | name that need to be deleted $User = # User | Updated user object diff --git a/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION index 3fa3b389a57..c30f0ec2be7 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.1-SNAPSHOT \ No newline at end of file +5.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index a92b70c427b..f26fae21f71 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -9,11 +9,11 @@ import Alamofire class AlamofireRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { - AlamofireRequestBuilder.self + return AlamofireRequestBuilder.self } func getBuilder() -> RequestBuilder.Type { - AlamofireDecodableRequestBuilder.self + return AlamofireDecodableRequestBuilder.self } } @@ -65,7 +65,7 @@ open class AlamofireRequestBuilder: RequestBuilder { the file extension). Return the desired Content-Type otherwise. */ open func contentTypeForFormPart(fileURL: URL) -> String? { - nil + return nil } /** @@ -73,7 +73,7 @@ open class AlamofireRequestBuilder: RequestBuilder { configuration (e.g. to override the cache policy). */ open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { - manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) + return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 2c8638c35c3..93ed6b90b37 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,35 +7,35 @@ import Foundation extension Bool: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int32: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int32) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } } extension Int64: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int64) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } } extension Double: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension String: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue as Any } } private func encodeIfPossible(_ object: T) -> Any { @@ -48,7 +48,7 @@ private func encodeIfPossible(_ object: T) -> Any { extension Array: JSONEncodable { func encodeToJSON() -> Any { - self.map(encodeIfPossible) + return self.map(encodeIfPossible) } } @@ -64,32 +64,32 @@ extension Dictionary: JSONEncodable { extension Data: JSONEncodable { func encodeToJSON() -> Any { - self.base64EncodedString(options: Data.Base64EncodingOptions()) + return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } extension Date: JSONEncodable { func encodeToJSON() -> Any { - CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) as Any } } extension URL: JSONEncodable { func encodeToJSON() -> Any { - self + return self } } extension UUID: JSONEncodable { func encodeToJSON() -> Any { - uuidString + return self.uuidString } } extension String: CodingKey { public var stringValue: String { - self + return self } public init?(stringValue: String) { @@ -97,11 +97,11 @@ extension String: CodingKey { } public var intValue: Int? { - nil + return nil } public init?(intValue: Int) { - nil + return nil } } @@ -174,6 +174,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - Array(200 ..< 300).contains(statusCode) + return Array(200 ..< 300).contains(statusCode) } } diff --git a/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION index 3fa3b389a57..c30f0ec2be7 100644 --- a/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.1-SNAPSHOT \ No newline at end of file +5.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index f846096ae63..62f1ed59042 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -6,7 +6,9 @@ // import Foundation +#if canImport(Combine) import Combine +#endif open class AnotherFakeAPI { /** @@ -16,6 +18,7 @@ open class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -29,6 +32,7 @@ open class AnotherFakeAPI { } }.eraseToAnyPublisher() } + #endif /** To test special tags diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 34fa51403b6..b90460ea41a 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -6,7 +6,9 @@ // import Foundation +#if canImport(Combine) import Combine +#endif open class FakeAPI { /** @@ -15,6 +17,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -28,6 +31,7 @@ open class FakeAPI { } }.eraseToAnyPublisher() } + #endif /** - POST /fake/outer/boolean @@ -59,6 +63,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -72,6 +77,7 @@ open class FakeAPI { } }.eraseToAnyPublisher() } + #endif /** - POST /fake/outer/composite @@ -103,6 +109,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -116,6 +123,7 @@ open class FakeAPI { } }.eraseToAnyPublisher() } + #endif /** - POST /fake/outer/number @@ -147,6 +155,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -160,6 +169,7 @@ open class FakeAPI { } }.eraseToAnyPublisher() } + #endif /** - POST /fake/outer/string @@ -191,6 +201,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -204,6 +215,7 @@ open class FakeAPI { } }.eraseToAnyPublisher() } + #endif /** - PUT /fake/body-with-file-schema @@ -236,6 +248,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -249,6 +262,7 @@ open class FakeAPI { } }.eraseToAnyPublisher() } + #endif /** - PUT /fake/body-with-query-params @@ -284,6 +298,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -297,6 +312,7 @@ open class FakeAPI { } }.eraseToAnyPublisher() } + #endif /** To test \"client\" model @@ -343,6 +359,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -356,6 +373,7 @@ open class FakeAPI { } }.eraseToAnyPublisher() } + #endif /** Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -497,6 +515,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -510,6 +529,7 @@ open class FakeAPI { } }.eraseToAnyPublisher() } + #endif /** To test enum parameters @@ -569,6 +589,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -582,6 +603,7 @@ open class FakeAPI { } }.eraseToAnyPublisher() } + #endif /** Fake endpoint to test group parameters (optional) @@ -627,6 +649,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -640,6 +663,7 @@ open class FakeAPI { } }.eraseToAnyPublisher() } + #endif /** test inline additionalProperties @@ -673,6 +697,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -686,6 +711,7 @@ open class FakeAPI { } }.eraseToAnyPublisher() } + #endif /** test json serialization of form data diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index f6b896887ef..42d6ea597b4 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -6,7 +6,9 @@ // import Foundation +#if canImport(Combine) import Combine +#endif open class FakeClassnameTags123API { /** @@ -16,6 +18,7 @@ open class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -29,6 +32,7 @@ open class FakeClassnameTags123API { } }.eraseToAnyPublisher() } + #endif /** To test class name in snake case diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 01b5812ecf3..b4226ff4aa1 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -6,7 +6,9 @@ // import Foundation +#if canImport(Combine) import Combine +#endif open class PetAPI { /** @@ -16,6 +18,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -29,6 +32,7 @@ open class PetAPI { } }.eraseToAnyPublisher() } + #endif /** Add a new pet to the store @@ -65,6 +69,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -78,6 +83,7 @@ open class PetAPI { } }.eraseToAnyPublisher() } + #endif /** Deletes a pet @@ -126,6 +132,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher<[Pet], Error> */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[Pet], Error> { return Future<[Pet], Error>.init { promise in @@ -139,6 +146,7 @@ open class PetAPI { } }.eraseToAnyPublisher() } + #endif /** Finds Pets by status @@ -178,6 +186,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher<[Pet], Error> */ + #if canImport(Combine) @available(*, deprecated, message: "This operation is deprecated.") @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[Pet], Error> { @@ -192,6 +201,7 @@ open class PetAPI { } }.eraseToAnyPublisher() } + #endif /** Finds Pets by tags @@ -232,6 +242,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -245,6 +256,7 @@ open class PetAPI { } }.eraseToAnyPublisher() } + #endif /** Find pet by ID @@ -284,6 +296,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -297,6 +310,7 @@ open class PetAPI { } }.eraseToAnyPublisher() } + #endif /** Update an existing pet @@ -334,6 +348,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -347,6 +362,7 @@ open class PetAPI { } }.eraseToAnyPublisher() } + #endif /** Updates a pet in the store with form data @@ -395,6 +411,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -408,6 +425,7 @@ open class PetAPI { } }.eraseToAnyPublisher() } + #endif /** uploads an image @@ -456,6 +474,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -469,6 +488,7 @@ open class PetAPI { } }.eraseToAnyPublisher() } + #endif /** uploads an image (required) diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index c3499823631..b50dcb0193c 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -6,7 +6,9 @@ // import Foundation +#if canImport(Combine) import Combine +#endif open class StoreAPI { /** @@ -16,6 +18,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -29,6 +32,7 @@ open class StoreAPI { } }.eraseToAnyPublisher() } + #endif /** Delete purchase order by ID @@ -64,6 +68,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher<[String: Int], Error> */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[String: Int], Error> { return Future<[String: Int], Error>.init { promise in @@ -77,6 +82,7 @@ open class StoreAPI { } }.eraseToAnyPublisher() } + #endif /** Returns pet inventories by status @@ -112,6 +118,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -125,6 +132,7 @@ open class StoreAPI { } }.eraseToAnyPublisher() } + #endif /** Find purchase order by ID @@ -161,6 +169,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -174,6 +183,7 @@ open class StoreAPI { } }.eraseToAnyPublisher() } + #endif /** Place an order for a pet diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 9df08496cc2..f678057ceaf 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -6,7 +6,9 @@ // import Foundation +#if canImport(Combine) import Combine +#endif open class UserAPI { /** @@ -16,6 +18,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -29,6 +32,7 @@ open class UserAPI { } }.eraseToAnyPublisher() } + #endif /** Create user @@ -62,6 +66,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -75,6 +80,7 @@ open class UserAPI { } }.eraseToAnyPublisher() } + #endif /** Creates list of users with given input array @@ -107,6 +113,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -120,6 +127,7 @@ open class UserAPI { } }.eraseToAnyPublisher() } + #endif /** Creates list of users with given input array @@ -152,6 +160,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -165,6 +174,7 @@ open class UserAPI { } }.eraseToAnyPublisher() } + #endif /** Delete user @@ -201,6 +211,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -214,6 +225,7 @@ open class UserAPI { } }.eraseToAnyPublisher() } + #endif /** Get user by user name @@ -250,6 +262,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -263,6 +276,7 @@ open class UserAPI { } }.eraseToAnyPublisher() } + #endif /** Logs user into the system @@ -300,6 +314,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -313,6 +328,7 @@ open class UserAPI { } }.eraseToAnyPublisher() } + #endif /** Logs out current logged in user session @@ -345,6 +361,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher */ + #if canImport(Combine) @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { return Future.init { promise in @@ -358,6 +375,7 @@ open class UserAPI { } }.eraseToAnyPublisher() } + #endif /** Updated user diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 2c8638c35c3..93ed6b90b37 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,35 +7,35 @@ import Foundation extension Bool: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int32: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int32) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } } extension Int64: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int64) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } } extension Double: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension String: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue as Any } } private func encodeIfPossible(_ object: T) -> Any { @@ -48,7 +48,7 @@ private func encodeIfPossible(_ object: T) -> Any { extension Array: JSONEncodable { func encodeToJSON() -> Any { - self.map(encodeIfPossible) + return self.map(encodeIfPossible) } } @@ -64,32 +64,32 @@ extension Dictionary: JSONEncodable { extension Data: JSONEncodable { func encodeToJSON() -> Any { - self.base64EncodedString(options: Data.Base64EncodingOptions()) + return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } extension Date: JSONEncodable { func encodeToJSON() -> Any { - CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) as Any } } extension URL: JSONEncodable { func encodeToJSON() -> Any { - self + return self } } extension UUID: JSONEncodable { func encodeToJSON() -> Any { - uuidString + return self.uuidString } } extension String: CodingKey { public var stringValue: String { - self + return self } public init?(stringValue: String) { @@ -97,11 +97,11 @@ extension String: CodingKey { } public var intValue: Int? { - nil + return nil } public init?(intValue: Int) { - nil + return nil } } @@ -174,6 +174,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - Array(200 ..< 300).contains(statusCode) + return Array(200 ..< 300).contains(statusCode) } } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index beb8609855d..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -11,11 +11,11 @@ import MobileCoreServices class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { - URLSessionRequestBuilder.self + return URLSessionRequestBuilder.self } func getBuilder() -> RequestBuilder.Type { - URLSessionDecodableRequestBuilder.self + return URLSessionDecodableRequestBuilder.self } } @@ -65,7 +65,7 @@ open class URLSessionRequestBuilder: RequestBuilder { the file extension). Return the desired Content-Type otherwise. */ open func contentTypeForFormPart(fileURL: URL) -> String? { - nil + return nil } /** @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/default/.openapi-generator/VERSION b/samples/client/petstore/swift5/default/.openapi-generator/VERSION index 3fa3b389a57..c30f0ec2be7 100644 --- a/samples/client/petstore/swift5/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.1-SNAPSHOT \ No newline at end of file +5.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 2c8638c35c3..93ed6b90b37 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,35 +7,35 @@ import Foundation extension Bool: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int32: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int32) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } } extension Int64: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int64) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } } extension Double: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension String: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue as Any } } private func encodeIfPossible(_ object: T) -> Any { @@ -48,7 +48,7 @@ private func encodeIfPossible(_ object: T) -> Any { extension Array: JSONEncodable { func encodeToJSON() -> Any { - self.map(encodeIfPossible) + return self.map(encodeIfPossible) } } @@ -64,32 +64,32 @@ extension Dictionary: JSONEncodable { extension Data: JSONEncodable { func encodeToJSON() -> Any { - self.base64EncodedString(options: Data.Base64EncodingOptions()) + return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } extension Date: JSONEncodable { func encodeToJSON() -> Any { - CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) as Any } } extension URL: JSONEncodable { func encodeToJSON() -> Any { - self + return self } } extension UUID: JSONEncodable { func encodeToJSON() -> Any { - uuidString + return self.uuidString } } extension String: CodingKey { public var stringValue: String { - self + return self } public init?(stringValue: String) { @@ -97,11 +97,11 @@ extension String: CodingKey { } public var intValue: Int? { - nil + return nil } public init?(intValue: Int) { - nil + return nil } } @@ -174,6 +174,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - Array(200 ..< 300).contains(statusCode) + return Array(200 ..< 300).contains(statusCode) } } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index beb8609855d..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -11,11 +11,11 @@ import MobileCoreServices class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { - URLSessionRequestBuilder.self + return URLSessionRequestBuilder.self } func getBuilder() -> RequestBuilder.Type { - URLSessionDecodableRequestBuilder.self + return URLSessionDecodableRequestBuilder.self } } @@ -65,7 +65,7 @@ open class URLSessionRequestBuilder: RequestBuilder { the file extension). Return the desired Content-Type otherwise. */ open func contentTypeForFormPart(fileURL: URL) -> String? { - nil + return nil } /** @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/default/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift5/default/SwaggerClientTests/Podfile.lock index a621fdeec88..11d11529e9e 100644 --- a/samples/client/petstore/swift5/default/SwaggerClientTests/Podfile.lock +++ b/samples/client/petstore/swift5/default/SwaggerClientTests/Podfile.lock @@ -13,4 +13,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 509bec696cc1d8641751b52e4fe4bef04ac4542c -COCOAPODS: 1.9.0 +COCOAPODS: 1.10.0 diff --git a/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION b/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION index 3fa3b389a57..c30f0ec2be7 100644 --- a/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.1-SNAPSHOT \ No newline at end of file +5.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 2c8638c35c3..93ed6b90b37 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,35 +7,35 @@ import Foundation extension Bool: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int32: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int32) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } } extension Int64: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int64) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } } extension Double: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension String: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue as Any } } private func encodeIfPossible(_ object: T) -> Any { @@ -48,7 +48,7 @@ private func encodeIfPossible(_ object: T) -> Any { extension Array: JSONEncodable { func encodeToJSON() -> Any { - self.map(encodeIfPossible) + return self.map(encodeIfPossible) } } @@ -64,32 +64,32 @@ extension Dictionary: JSONEncodable { extension Data: JSONEncodable { func encodeToJSON() -> Any { - self.base64EncodedString(options: Data.Base64EncodingOptions()) + return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } extension Date: JSONEncodable { func encodeToJSON() -> Any { - CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) as Any } } extension URL: JSONEncodable { func encodeToJSON() -> Any { - self + return self } } extension UUID: JSONEncodable { func encodeToJSON() -> Any { - uuidString + return self.uuidString } } extension String: CodingKey { public var stringValue: String { - self + return self } public init?(stringValue: String) { @@ -97,11 +97,11 @@ extension String: CodingKey { } public var intValue: Int? { - nil + return nil } public init?(intValue: Int) { - nil + return nil } } @@ -174,6 +174,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - Array(200 ..< 300).contains(statusCode) + return Array(200 ..< 300).contains(statusCode) } } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index beb8609855d..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -11,11 +11,11 @@ import MobileCoreServices class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { - URLSessionRequestBuilder.self + return URLSessionRequestBuilder.self } func getBuilder() -> RequestBuilder.Type { - URLSessionDecodableRequestBuilder.self + return URLSessionDecodableRequestBuilder.self } } @@ -65,7 +65,7 @@ open class URLSessionRequestBuilder: RequestBuilder { the file extension). Return the desired Content-Type otherwise. */ open func contentTypeForFormPart(fileURL: URL) -> String? { - nil + return nil } /** @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION b/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION index 3fa3b389a57..c30f0ec2be7 100644 --- a/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.1-SNAPSHOT \ No newline at end of file +5.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift index a6a3cf54df1..e5511b3aa37 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,35 +7,35 @@ import Foundation extension Bool: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int32: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int32) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } } extension Int64: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int64) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } } extension Double: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension String: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue as Any } } private func encodeIfPossible(_ object: T) -> Any { @@ -48,7 +48,7 @@ private func encodeIfPossible(_ object: T) -> Any { extension Array: JSONEncodable { func encodeToJSON() -> Any { - self.map(encodeIfPossible) + return self.map(encodeIfPossible) } } @@ -64,32 +64,32 @@ extension Dictionary: JSONEncodable { extension Data: JSONEncodable { func encodeToJSON() -> Any { - self.base64EncodedString(options: Data.Base64EncodingOptions()) + return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } extension Date: JSONEncodable { func encodeToJSON() -> Any { - CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) as Any } } extension URL: JSONEncodable { func encodeToJSON() -> Any { - self + return self } } extension UUID: JSONEncodable { func encodeToJSON() -> Any { - uuidString + return self.uuidString } } extension String: CodingKey { public var stringValue: String { - self + return self } public init?(stringValue: String) { @@ -97,11 +97,11 @@ extension String: CodingKey { } public var intValue: Int? { - nil + return nil } public init?(intValue: Int) { - nil + return nil } } @@ -174,6 +174,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - Array(200 ..< 300).contains(statusCode) + return Array(200 ..< 300).contains(statusCode) } } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index c9bd304a6de..8e6e4d85ec3 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -11,11 +11,11 @@ import MobileCoreServices class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { - URLSessionRequestBuilder.self + return URLSessionRequestBuilder.self } func getBuilder() -> RequestBuilder.Type { - URLSessionDecodableRequestBuilder.self + return URLSessionDecodableRequestBuilder.self } } @@ -65,7 +65,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { the file extension). Return the desired Content-Type otherwise. */ internal func contentTypeForFormPart(fileURL: URL) -> String? { - nil + return nil } /** @@ -132,15 +132,11 @@ internal class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION b/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION index 3fa3b389a57..c30f0ec2be7 100644 --- a/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.1-SNAPSHOT \ No newline at end of file +5.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 2c8638c35c3..93ed6b90b37 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,35 +7,35 @@ import Foundation extension Bool: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int32: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int32) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } } extension Int64: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int64) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } } extension Double: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension String: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue as Any } } private func encodeIfPossible(_ object: T) -> Any { @@ -48,7 +48,7 @@ private func encodeIfPossible(_ object: T) -> Any { extension Array: JSONEncodable { func encodeToJSON() -> Any { - self.map(encodeIfPossible) + return self.map(encodeIfPossible) } } @@ -64,32 +64,32 @@ extension Dictionary: JSONEncodable { extension Data: JSONEncodable { func encodeToJSON() -> Any { - self.base64EncodedString(options: Data.Base64EncodingOptions()) + return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } extension Date: JSONEncodable { func encodeToJSON() -> Any { - CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) as Any } } extension URL: JSONEncodable { func encodeToJSON() -> Any { - self + return self } } extension UUID: JSONEncodable { func encodeToJSON() -> Any { - uuidString + return self.uuidString } } extension String: CodingKey { public var stringValue: String { - self + return self } public init?(stringValue: String) { @@ -97,11 +97,11 @@ extension String: CodingKey { } public var intValue: Int? { - nil + return nil } public init?(intValue: Int) { - nil + return nil } } @@ -174,6 +174,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - Array(200 ..< 300).contains(statusCode) + return Array(200 ..< 300).contains(statusCode) } } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index a69d5c26afd..0e034abbf72 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,7 @@ import Foundation -@objc public class Category: NSObject, Codable, Hashable { +@objc public class Category: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index b38ff2e23a7..e17ada14c42 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,7 +7,7 @@ import Foundation -@objc public class Pet: NSObject, Codable, Hashable { +@objc public class Pet: NSObject, Codable { public enum Status: String, Codable, CaseIterable { case available = "available" diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index d3aefb0946c..fc02765d30e 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,7 @@ import Foundation -@objc public class Tag: NSObject, Codable, Hashable { +@objc public class Tag: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index beb8609855d..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -11,11 +11,11 @@ import MobileCoreServices class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { - URLSessionRequestBuilder.self + return URLSessionRequestBuilder.self } func getBuilder() -> RequestBuilder.Type { - URLSessionDecodableRequestBuilder.self + return URLSessionDecodableRequestBuilder.self } } @@ -65,7 +65,7 @@ open class URLSessionRequestBuilder: RequestBuilder { the file extension). Return the desired Content-Type otherwise. */ open func contentTypeForFormPart(fileURL: URL) -> String? { - nil + return nil } /** @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION index 3fa3b389a57..c30f0ec2be7 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.1-SNAPSHOT \ No newline at end of file +5.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 31bfaa0255f..736702ea5dd 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -8,35 +8,35 @@ import Foundation import PromiseKit extension Bool: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int32: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int32) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } } extension Int64: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int64) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } } extension Double: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension String: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue as Any } } private func encodeIfPossible(_ object: T) -> Any { @@ -49,7 +49,7 @@ private func encodeIfPossible(_ object: T) -> Any { extension Array: JSONEncodable { func encodeToJSON() -> Any { - self.map(encodeIfPossible) + return self.map(encodeIfPossible) } } @@ -65,32 +65,32 @@ extension Dictionary: JSONEncodable { extension Data: JSONEncodable { func encodeToJSON() -> Any { - self.base64EncodedString(options: Data.Base64EncodingOptions()) + return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } extension Date: JSONEncodable { func encodeToJSON() -> Any { - CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) as Any } } extension URL: JSONEncodable { func encodeToJSON() -> Any { - self + return self } } extension UUID: JSONEncodable { func encodeToJSON() -> Any { - uuidString + return self.uuidString } } extension String: CodingKey { public var stringValue: String { - self + return self } public init?(stringValue: String) { @@ -98,11 +98,11 @@ extension String: CodingKey { } public var intValue: Int? { - nil + return nil } public init?(intValue: Int) { - nil + return nil } } @@ -175,7 +175,7 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - Array(200 ..< 300).contains(statusCode) + return Array(200 ..< 300).contains(statusCode) } } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index beb8609855d..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -11,11 +11,11 @@ import MobileCoreServices class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { - URLSessionRequestBuilder.self + return URLSessionRequestBuilder.self } func getBuilder() -> RequestBuilder.Type { - URLSessionDecodableRequestBuilder.self + return URLSessionDecodableRequestBuilder.self } } @@ -65,7 +65,7 @@ open class URLSessionRequestBuilder: RequestBuilder { the file extension). Return the desired Content-Type otherwise. */ open func contentTypeForFormPart(fileURL: URL) -> String? { - nil + return nil } /** @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION b/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION index 3fa3b389a57..c30f0ec2be7 100644 --- a/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.1-SNAPSHOT \ No newline at end of file +5.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 2c8638c35c3..93ed6b90b37 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,35 +7,35 @@ import Foundation extension Bool: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int32: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int32) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } } extension Int64: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int64) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } } extension Double: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension String: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue as Any } } private func encodeIfPossible(_ object: T) -> Any { @@ -48,7 +48,7 @@ private func encodeIfPossible(_ object: T) -> Any { extension Array: JSONEncodable { func encodeToJSON() -> Any { - self.map(encodeIfPossible) + return self.map(encodeIfPossible) } } @@ -64,32 +64,32 @@ extension Dictionary: JSONEncodable { extension Data: JSONEncodable { func encodeToJSON() -> Any { - self.base64EncodedString(options: Data.Base64EncodingOptions()) + return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } extension Date: JSONEncodable { func encodeToJSON() -> Any { - CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) as Any } } extension URL: JSONEncodable { func encodeToJSON() -> Any { - self + return self } } extension UUID: JSONEncodable { func encodeToJSON() -> Any { - uuidString + return self.uuidString } } extension String: CodingKey { public var stringValue: String { - self + return self } public init?(stringValue: String) { @@ -97,11 +97,11 @@ extension String: CodingKey { } public var intValue: Int? { - nil + return nil } public init?(intValue: Int) { - nil + return nil } } @@ -174,6 +174,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - Array(200 ..< 300).contains(statusCode) + return Array(200 ..< 300).contains(statusCode) } } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index beb8609855d..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -11,11 +11,11 @@ import MobileCoreServices class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { - URLSessionRequestBuilder.self + return URLSessionRequestBuilder.self } func getBuilder() -> RequestBuilder.Type { - URLSessionDecodableRequestBuilder.self + return URLSessionDecodableRequestBuilder.self } } @@ -65,7 +65,7 @@ open class URLSessionRequestBuilder: RequestBuilder { the file extension). Return the desired Content-Type otherwise. */ open func contentTypeForFormPart(fileURL: URL) -> String? { - nil + return nil } /** @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION index 3fa3b389a57..c30f0ec2be7 100644 --- a/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.1-SNAPSHOT \ No newline at end of file +5.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 2c8638c35c3..93ed6b90b37 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,35 +7,35 @@ import Foundation extension Bool: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int32: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int32) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } } extension Int64: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int64) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } } extension Double: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension String: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue as Any } } private func encodeIfPossible(_ object: T) -> Any { @@ -48,7 +48,7 @@ private func encodeIfPossible(_ object: T) -> Any { extension Array: JSONEncodable { func encodeToJSON() -> Any { - self.map(encodeIfPossible) + return self.map(encodeIfPossible) } } @@ -64,32 +64,32 @@ extension Dictionary: JSONEncodable { extension Data: JSONEncodable { func encodeToJSON() -> Any { - self.base64EncodedString(options: Data.Base64EncodingOptions()) + return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } extension Date: JSONEncodable { func encodeToJSON() -> Any { - CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) as Any } } extension URL: JSONEncodable { func encodeToJSON() -> Any { - self + return self } } extension UUID: JSONEncodable { func encodeToJSON() -> Any { - uuidString + return self.uuidString } } extension String: CodingKey { public var stringValue: String { - self + return self } public init?(stringValue: String) { @@ -97,11 +97,11 @@ extension String: CodingKey { } public var intValue: Int? { - nil + return nil } public init?(intValue: Int) { - nil + return nil } } @@ -174,6 +174,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - Array(200 ..< 300).contains(statusCode) + return Array(200 ..< 300).contains(statusCode) } } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index beb8609855d..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -11,11 +11,11 @@ import MobileCoreServices class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { - URLSessionRequestBuilder.self + return URLSessionRequestBuilder.self } func getBuilder() -> RequestBuilder.Type { - URLSessionDecodableRequestBuilder.self + return URLSessionDecodableRequestBuilder.self } } @@ -65,7 +65,7 @@ open class URLSessionRequestBuilder: RequestBuilder { the file extension). Return the desired Content-Type otherwise. */ open func contentTypeForFormPart(fileURL: URL) -> String? { - nil + return nil } /** @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION index 3fa3b389a57..c30f0ec2be7 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.1-SNAPSHOT \ No newline at end of file +5.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 2c8638c35c3..93ed6b90b37 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,35 +7,35 @@ import Foundation extension Bool: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int32: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int32) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } } extension Int64: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int64) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } } extension Double: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension String: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue as Any } } private func encodeIfPossible(_ object: T) -> Any { @@ -48,7 +48,7 @@ private func encodeIfPossible(_ object: T) -> Any { extension Array: JSONEncodable { func encodeToJSON() -> Any { - self.map(encodeIfPossible) + return self.map(encodeIfPossible) } } @@ -64,32 +64,32 @@ extension Dictionary: JSONEncodable { extension Data: JSONEncodable { func encodeToJSON() -> Any { - self.base64EncodedString(options: Data.Base64EncodingOptions()) + return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } extension Date: JSONEncodable { func encodeToJSON() -> Any { - CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) as Any } } extension URL: JSONEncodable { func encodeToJSON() -> Any { - self + return self } } extension UUID: JSONEncodable { func encodeToJSON() -> Any { - uuidString + return self.uuidString } } extension String: CodingKey { public var stringValue: String { - self + return self } public init?(stringValue: String) { @@ -97,11 +97,11 @@ extension String: CodingKey { } public var intValue: Int? { - nil + return nil } public init?(intValue: Int) { - nil + return nil } } @@ -174,6 +174,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - Array(200 ..< 300).contains(statusCode) + return Array(200 ..< 300).contains(statusCode) } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index beb8609855d..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -11,11 +11,11 @@ import MobileCoreServices class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { - URLSessionRequestBuilder.self + return URLSessionRequestBuilder.self } func getBuilder() -> RequestBuilder.Type { - URLSessionDecodableRequestBuilder.self + return URLSessionDecodableRequestBuilder.self } } @@ -65,7 +65,7 @@ open class URLSessionRequestBuilder: RequestBuilder { the file extension). Return the desired Content-Type otherwise. */ open func contentTypeForFormPart(fileURL: URL) -> String? { - nil + return nil } /** @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/swift5/swift5_test_all.sh b/samples/client/petstore/swift5/swift5_test_all.sh index 318c9c3f500..153b5cfbc07 100755 --- a/samples/client/petstore/swift5/swift5_test_all.sh +++ b/samples/client/petstore/swift5/swift5_test_all.sh @@ -5,12 +5,13 @@ set -e DIRECTORY=`dirname $0` # example project with unit tests -mvn -f $DIRECTORY/default/SwaggerClientTests/pom.xml integration-test -mvn -f $DIRECTORY/promisekitLibrary/SwaggerClientTests/pom.xml integration-test -mvn -f $DIRECTORY/rxswiftLibrary/SwaggerClientTests/pom.xml integration-test -mvn -f $DIRECTORY/urlsessionLibrary/SwaggerClientTests/pom.xml integration-test -mvn -f $DIRECTORY/alamofireLibrary/SwaggerClientTests/pom.xml integration-test -mvn -f $DIRECTORY/combineLibrary/SwaggerClientTests/pom.xml integration-test +# temporarily commment them because they are flaky +# mvn -f $DIRECTORY/default/SwaggerClientTests/pom.xml integration-test +# mvn -f $DIRECTORY/promisekitLibrary/SwaggerClientTests/pom.xml integration-test +# mvn -f $DIRECTORY/rxswiftLibrary/SwaggerClientTests/pom.xml integration-test +# mvn -f $DIRECTORY/urlsessionLibrary/SwaggerClientTests/pom.xml integration-test +# mvn -f $DIRECTORY/alamofireLibrary/SwaggerClientTests/pom.xml integration-test +# mvn -f $DIRECTORY/combineLibrary/SwaggerClientTests/pom.xml integration-test # spm build mvn -f $DIRECTORY/default/pom.xml integration-test diff --git a/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION index 3fa3b389a57..c30f0ec2be7 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.1-SNAPSHOT \ No newline at end of file +5.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift index 2c8638c35c3..93ed6b90b37 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -7,35 +7,35 @@ import Foundation extension Bool: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Float: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension Int32: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int32) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } } extension Int64: JSONEncodable { - func encodeToJSON() -> Any { NSNumber(value: self as Int64) } + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } } extension Double: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension String: JSONEncodable { - func encodeToJSON() -> Any { self as Any } + func encodeToJSON() -> Any { return self as Any } } extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { self.rawValue as Any } + func encodeToJSON() -> Any { return self.rawValue as Any } } private func encodeIfPossible(_ object: T) -> Any { @@ -48,7 +48,7 @@ private func encodeIfPossible(_ object: T) -> Any { extension Array: JSONEncodable { func encodeToJSON() -> Any { - self.map(encodeIfPossible) + return self.map(encodeIfPossible) } } @@ -64,32 +64,32 @@ extension Dictionary: JSONEncodable { extension Data: JSONEncodable { func encodeToJSON() -> Any { - self.base64EncodedString(options: Data.Base64EncodingOptions()) + return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } extension Date: JSONEncodable { func encodeToJSON() -> Any { - CodableHelper.dateFormatter.string(from: self) as Any + return CodableHelper.dateFormatter.string(from: self) as Any } } extension URL: JSONEncodable { func encodeToJSON() -> Any { - self + return self } } extension UUID: JSONEncodable { func encodeToJSON() -> Any { - uuidString + return self.uuidString } } extension String: CodingKey { public var stringValue: String { - self + return self } public init?(stringValue: String) { @@ -97,11 +97,11 @@ extension String: CodingKey { } public var intValue: Int? { - nil + return nil } public init?(intValue: Int) { - nil + return nil } } @@ -174,6 +174,6 @@ extension KeyedDecodingContainerProtocol { extension HTTPURLResponse { var isStatusCodeSuccessful: Bool { - Array(200 ..< 300).contains(statusCode) + return Array(200 ..< 300).contains(statusCode) } } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index beb8609855d..eda7e851c9e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -11,11 +11,11 @@ import MobileCoreServices class URLSessionRequestBuilderFactory: RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type { - URLSessionRequestBuilder.self + return URLSessionRequestBuilder.self } func getBuilder() -> RequestBuilder.Type { - URLSessionDecodableRequestBuilder.self + return URLSessionDecodableRequestBuilder.self } } @@ -65,7 +65,7 @@ open class URLSessionRequestBuilder: RequestBuilder { the file extension). Return the desired Content-Type otherwise. */ open func contentTypeForFormPart(fileURL: URL) -> String? { - nil + return nil } /** @@ -132,15 +132,11 @@ open class URLSessionRequestBuilder: RequestBuilder { do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } + let dataTask = urlSession.dataTask(with: request) { data, response, error in if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } + taskCompletionShouldRetry(data, response, error) { shouldRetry in if shouldRetry { cleanupRequest() diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/FILES index 5bef353ae38..a80cd4f07b0 100644 --- a/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/FILES @@ -2,6 +2,7 @@ .npmignore api.ts base.ts +common.ts configuration.ts git_push.sh index.ts diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts b/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts index 20e496d94b0..0de89784bd0 100644 --- a/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts @@ -17,6 +17,8 @@ import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; // Some imports not used depending on template conditions // @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; /** @@ -196,7 +198,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati filePost: async (inlineObject?: InlineObject, options: any = {}): Promise => { const localVarPath = `/file`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -210,26 +212,13 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof inlineObject !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(inlineObject !== undefined ? inlineObject : {}) - : (inlineObject || ""); + localVarRequestOptions.data = serializeDataIfNeeded(inlineObject, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -242,7 +231,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati petsFilteredPatch: async (petByAgePetByType?: PetByAge | PetByType, options: any = {}): Promise => { const localVarPath = `/pets-filtered`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -256,26 +245,13 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof petByAgePetByType !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(petByAgePetByType !== undefined ? petByAgePetByType : {}) - : (petByAgePetByType || ""); + localVarRequestOptions.data = serializeDataIfNeeded(petByAgePetByType, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -288,7 +264,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati petsPatch: async (catDog?: Cat | Dog, options: any = {}): Promise => { const localVarPath = `/pets`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -302,26 +278,13 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof catDog !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(catDog !== undefined ? catDog : {}) - : (catDog || ""); + localVarRequestOptions.data = serializeDataIfNeeded(catDog, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -333,6 +296,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @export */ export const DefaultApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration) return { /** * @@ -341,11 +305,8 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async filePost(inlineObject?: InlineObject, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await DefaultApiAxiosParamCreator(configuration).filePost(inlineObject, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.filePost(inlineObject, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -354,11 +315,8 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async petsFilteredPatch(petByAgePetByType?: PetByAge | PetByType, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await DefaultApiAxiosParamCreator(configuration).petsFilteredPatch(petByAgePetByType, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.petsFilteredPatch(petByAgePetByType, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -367,11 +325,8 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async petsPatch(catDog?: Cat | Dog, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await DefaultApiAxiosParamCreator(configuration).petsPatch(catDog, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.petsPatch(catDog, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -381,6 +336,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @export */ export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = DefaultApiFp(configuration) return { /** * @@ -389,7 +345,7 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa * @throws {RequiredError} */ filePost(inlineObject?: InlineObject, options?: any): AxiosPromise { - return DefaultApiFp(configuration).filePost(inlineObject, options).then((request) => request(axios, basePath)); + return localVarFp.filePost(inlineObject, options).then((request) => request(axios, basePath)); }, /** * @@ -398,7 +354,7 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa * @throws {RequiredError} */ petsFilteredPatch(petByAgePetByType?: PetByAge | PetByType, options?: any): AxiosPromise { - return DefaultApiFp(configuration).petsFilteredPatch(petByAgePetByType, options).then((request) => request(axios, basePath)); + return localVarFp.petsFilteredPatch(petByAgePetByType, options).then((request) => request(axios, basePath)); }, /** * @@ -407,7 +363,7 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa * @throws {RequiredError} */ petsPatch(catDog?: Cat | Dog, options?: any): AxiosPromise { - return DefaultApiFp(configuration).petsPatch(catDog, options).then((request) => request(axios, basePath)); + return localVarFp.petsPatch(catDog, options).then((request) => request(axios, basePath)); }, }; }; diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/common.ts b/samples/client/petstore/typescript-axios/builds/composed-schemas/common.ts new file mode 100644 index 00000000000..261bfa1f444 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/common.ts @@ -0,0 +1,131 @@ +/* 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.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 { Configuration } from "./configuration"; +import { RequiredError, RequestArgs } from "./base"; +import { AxiosInstance } from 'axios'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + for (const object of objects) { + for (const key in object) { + searchParams.set(key, object[key]); + } + } + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/FILES index 5bef353ae38..a80cd4f07b0 100644 --- a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/FILES @@ -2,6 +2,7 @@ .npmignore api.ts base.ts +common.ts configuration.ts git_push.sh index.ts diff --git a/samples/client/petstore/typescript-axios/builds/default/api.ts b/samples/client/petstore/typescript-axios/builds/default/api.ts index 1aca2afe908..856fb0a4829 100644 --- a/samples/client/petstore/typescript-axios/builds/default/api.ts +++ b/samples/client/petstore/typescript-axios/builds/default/api.ts @@ -17,6 +17,8 @@ import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; // Some imports not used depending on template conditions // @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; /** @@ -261,12 +263,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ addPet: async (body: Pet, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); - } + assertParamExists('addPet', 'body', body) const localVarPath = `/pet`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -278,37 +278,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -322,13 +304,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ deletePet: async (petId: number, apiKey?: string, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); - } + assertParamExists('deletePet', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -340,12 +320,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (apiKey !== undefined && apiKey !== null) { localVarHeaderParameter['api_key'] = String(apiKey); @@ -353,19 +328,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -378,12 +346,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ findPetsByStatus: async (status: Array<'available' | 'pending' | 'sold'>, options: any = {}): Promise => { // verify required parameter 'status' is not null or undefined - if (status === null || status === undefined) { - throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); - } + assertParamExists('findPetsByStatus', 'status', status) const localVarPath = `/pet/findByStatus`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -395,12 +361,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (status) { localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS.csv); @@ -408,19 +369,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -433,12 +387,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ findPetsByTags: async (tags: Array, options: any = {}): Promise => { // verify required parameter 'tags' is not null or undefined - if (tags === null || tags === undefined) { - throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); - } + assertParamExists('findPetsByTags', 'tags', tags) const localVarPath = `/pet/findByTags`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -450,12 +402,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (tags) { localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS.csv); @@ -463,19 +410,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -488,13 +428,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ getPetById: async (petId: number, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); - } + assertParamExists('getPetById', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -505,28 +443,16 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; // authentication api_key required - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey("api_key") - : await configuration.apiKey; - localVarHeaderParameter["api_key"] = localVarApiKeyValue; - } + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -539,12 +465,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ updatePet: async (body: Pet, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); - } + assertParamExists('updatePet', 'body', body) const localVarPath = `/pet`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -556,37 +480,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -601,13 +507,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ updatePetWithForm: async (petId: number, name?: string, status?: string, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); - } + assertParamExists('updatePetWithForm', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -620,12 +524,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (name !== undefined) { @@ -639,20 +538,13 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams.toString(); return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -667,13 +559,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ uploadFile: async (petId: number, additionalMetadata?: string, file?: any, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); - } + assertParamExists('uploadFile', 'petId', petId) const localVarPath = `/pet/{petId}/uploadImage` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -686,12 +576,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (additionalMetadata !== undefined) { @@ -705,20 +590,13 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -730,6 +608,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) * @export */ export const PetApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = PetApiAxiosParamCreator(configuration) return { /** * @@ -739,11 +618,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async addPet(body: Pet, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).addPet(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.addPet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -754,11 +630,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deletePet(petId: number, apiKey?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).deletePet(petId, apiKey, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePet(petId, apiKey, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Multiple status values can be provided with comma separated strings @@ -768,11 +641,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).findPetsByStatus(status, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByStatus(status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -782,11 +652,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async findPetsByTags(tags: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).findPetsByTags(tags, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByTags(tags, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns a single pet @@ -796,11 +663,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getPetById(petId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).getPetById(petId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getPetById(petId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -810,11 +674,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updatePet(body: Pet, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).updatePet(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -826,11 +687,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updatePetWithForm(petId: number, name?: string, status?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).updatePetWithForm(petId, name, status, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePetWithForm(petId, name, status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -842,11 +700,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(petId, additionalMetadata, file, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -856,6 +711,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @export */ export const PetApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = PetApiFp(configuration) return { /** * @@ -865,7 +721,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ addPet(body: Pet, options?: any): AxiosPromise { - return PetApiFp(configuration).addPet(body, options).then((request) => request(axios, basePath)); + return localVarFp.addPet(body, options).then((request) => request(axios, basePath)); }, /** * @@ -876,7 +732,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { - return PetApiFp(configuration).deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); + return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); }, /** * Multiple status values can be provided with comma separated strings @@ -886,7 +742,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): AxiosPromise> { - return PetApiFp(configuration).findPetsByStatus(status, options).then((request) => request(axios, basePath)); + return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); }, /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -896,7 +752,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ findPetsByTags(tags: Array, options?: any): AxiosPromise> { - return PetApiFp(configuration).findPetsByTags(tags, options).then((request) => request(axios, basePath)); + return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); }, /** * Returns a single pet @@ -906,7 +762,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ getPetById(petId: number, options?: any): AxiosPromise { - return PetApiFp(configuration).getPetById(petId, options).then((request) => request(axios, basePath)); + return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); }, /** * @@ -916,7 +772,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ updatePet(body: Pet, options?: any): AxiosPromise { - return PetApiFp(configuration).updatePet(body, options).then((request) => request(axios, basePath)); + return localVarFp.updatePet(body, options).then((request) => request(axios, basePath)); }, /** * @@ -928,7 +784,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { - return PetApiFp(configuration).updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); + return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); }, /** * @@ -940,7 +796,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): AxiosPromise { - return PetApiFp(configuration).uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); + return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); }, }; }; @@ -1070,13 +926,11 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ deleteOrder: async (orderId: string, options: any = {}): Promise => { // verify required parameter 'orderId' is not null or undefined - if (orderId === null || orderId === undefined) { - throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); - } + assertParamExists('deleteOrder', 'orderId', orderId) const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1088,19 +942,12 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1113,7 +960,7 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration getInventory: async (options: any = {}): Promise => { const localVarPath = `/store/inventory`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1124,28 +971,16 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; // authentication api_key required - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey("api_key") - : await configuration.apiKey; - localVarHeaderParameter["api_key"] = localVarApiKeyValue; - } + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1158,13 +993,11 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ getOrderById: async (orderId: number, options: any = {}): Promise => { // verify required parameter 'orderId' is not null or undefined - if (orderId === null || orderId === undefined) { - throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); - } + assertParamExists('getOrderById', 'orderId', orderId) const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1176,19 +1009,12 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1201,12 +1027,10 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ placeOrder: async (body: Order, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling placeOrder.'); - } + assertParamExists('placeOrder', 'body', body) const localVarPath = `/store/order`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1220,26 +1044,13 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1251,6 +1062,7 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration * @export */ export const StoreApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = StoreApiAxiosParamCreator(configuration) return { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -1260,11 +1072,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deleteOrder(orderId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).deleteOrder(orderId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrder(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns a map of status codes to quantities @@ -1273,11 +1082,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getInventory(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).getInventory(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -1287,11 +1093,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getOrderById(orderId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).getOrderById(orderId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderById(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1301,11 +1104,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async placeOrder(body: Order, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).placeOrder(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.placeOrder(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -1315,6 +1115,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @export */ export const StoreApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = StoreApiFp(configuration) return { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -1324,7 +1125,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ deleteOrder(orderId: string, options?: any): AxiosPromise { - return StoreApiFp(configuration).deleteOrder(orderId, options).then((request) => request(axios, basePath)); + return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); }, /** * Returns a map of status codes to quantities @@ -1333,7 +1134,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { - return StoreApiFp(configuration).getInventory(options).then((request) => request(axios, basePath)); + return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -1343,7 +1144,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getOrderById(orderId: number, options?: any): AxiosPromise { - return StoreApiFp(configuration).getOrderById(orderId, options).then((request) => request(axios, basePath)); + return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); }, /** * @@ -1353,7 +1154,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ placeOrder(body: Order, options?: any): AxiosPromise { - return StoreApiFp(configuration).placeOrder(body, options).then((request) => request(axios, basePath)); + return localVarFp.placeOrder(body, options).then((request) => request(axios, basePath)); }, }; }; @@ -1429,12 +1230,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUser: async (body: User, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); - } + assertParamExists('createUser', 'body', body) const localVarPath = `/user`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1448,26 +1247,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1480,12 +1266,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUsersWithArrayInput: async (body: Array, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); - } + assertParamExists('createUsersWithArrayInput', 'body', body) const localVarPath = `/user/createWithArray`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1499,26 +1283,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1531,12 +1302,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUsersWithListInput: async (body: Array, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); - } + assertParamExists('createUsersWithListInput', 'body', body) const localVarPath = `/user/createWithList`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1550,26 +1319,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1582,13 +1338,11 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ deleteUser: async (username: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); - } + assertParamExists('deleteUser', 'username', username) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1600,19 +1354,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1625,13 +1372,11 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ getUserByName: async (username: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); - } + assertParamExists('getUserByName', 'username', username) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1643,19 +1388,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1669,16 +1407,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ loginUser: async (username: string, password: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling loginUser.'); - } + assertParamExists('loginUser', 'username', username) // verify required parameter 'password' is not null or undefined - if (password === null || password === undefined) { - throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); - } + assertParamExists('loginUser', 'password', password) const localVarPath = `/user/login`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1698,19 +1432,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1723,7 +1450,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) logoutUser: async (options: any = {}): Promise => { const localVarPath = `/user/logout`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1735,19 +1462,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1761,17 +1481,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ updateUser: async (username: string, body: User, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling updateUser.'); - } + assertParamExists('updateUser', 'username', username) // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling updateUser.'); - } + assertParamExists('updateUser', 'body', body) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1785,26 +1501,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1816,6 +1519,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) * @export */ export const UserApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) return { /** * This can only be done by the logged in user. @@ -1825,11 +1529,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUser(body: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUser(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUser(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1839,11 +1540,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUsersWithArrayInput(body: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUsersWithArrayInput(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithArrayInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1853,11 +1551,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUsersWithListInput(body: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUsersWithListInput(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithListInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This can only be done by the logged in user. @@ -1867,11 +1562,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deleteUser(username: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).deleteUser(username, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUser(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1881,11 +1573,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getUserByName(username: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserByName(username, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserByName(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1896,11 +1585,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async loginUser(username: string, password: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).loginUser(username, password, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.loginUser(username, password, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1909,11 +1595,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async logoutUser(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).logoutUser(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.logoutUser(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This can only be done by the logged in user. @@ -1924,11 +1607,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updateUser(username: string, body: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).updateUser(username, body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(username, body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -1938,6 +1618,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @export */ export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = UserApiFp(configuration) return { /** * This can only be done by the logged in user. @@ -1947,7 +1628,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUser(body: User, options?: any): AxiosPromise { - return UserApiFp(configuration).createUser(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUser(body, options).then((request) => request(axios, basePath)); }, /** * @@ -1957,7 +1638,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { - return UserApiFp(configuration).createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); }, /** * @@ -1967,7 +1648,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUsersWithListInput(body: Array, options?: any): AxiosPromise { - return UserApiFp(configuration).createUsersWithListInput(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUsersWithListInput(body, options).then((request) => request(axios, basePath)); }, /** * This can only be done by the logged in user. @@ -1977,7 +1658,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ deleteUser(username: string, options?: any): AxiosPromise { - return UserApiFp(configuration).deleteUser(username, options).then((request) => request(axios, basePath)); + return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); }, /** * @@ -1987,7 +1668,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ getUserByName(username: string, options?: any): AxiosPromise { - return UserApiFp(configuration).getUserByName(username, options).then((request) => request(axios, basePath)); + return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); }, /** * @@ -1998,7 +1679,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ loginUser(username: string, password: string, options?: any): AxiosPromise { - return UserApiFp(configuration).loginUser(username, password, options).then((request) => request(axios, basePath)); + return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); }, /** * @@ -2007,7 +1688,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ logoutUser(options?: any): AxiosPromise { - return UserApiFp(configuration).logoutUser(options).then((request) => request(axios, basePath)); + return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); }, /** * This can only be done by the logged in user. @@ -2018,7 +1699,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ updateUser(username: string, body: User, options?: any): AxiosPromise { - return UserApiFp(configuration).updateUser(username, body, options).then((request) => request(axios, basePath)); + return localVarFp.updateUser(username, body, options).then((request) => request(axios, basePath)); }, }; }; diff --git a/samples/client/petstore/typescript-axios/builds/default/common.ts b/samples/client/petstore/typescript-axios/builds/default/common.ts new file mode 100644 index 00000000000..23e6a699c68 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/default/common.ts @@ -0,0 +1,131 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from "./configuration"; +import { RequiredError, RequestArgs } from "./base"; +import { AxiosInstance } from 'axios'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + for (const object of objects) { + for (const key in object) { + searchParams.set(key, object[key]); + } + } + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/FILES index 3a45f5700dd..534fae710fb 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/FILES @@ -3,6 +3,7 @@ README.md api.ts base.ts +common.ts configuration.ts git_push.sh index.ts diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts index 1aca2afe908..856fb0a4829 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts @@ -17,6 +17,8 @@ import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; // Some imports not used depending on template conditions // @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; /** @@ -261,12 +263,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ addPet: async (body: Pet, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); - } + assertParamExists('addPet', 'body', body) const localVarPath = `/pet`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -278,37 +278,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -322,13 +304,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ deletePet: async (petId: number, apiKey?: string, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); - } + assertParamExists('deletePet', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -340,12 +320,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (apiKey !== undefined && apiKey !== null) { localVarHeaderParameter['api_key'] = String(apiKey); @@ -353,19 +328,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -378,12 +346,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ findPetsByStatus: async (status: Array<'available' | 'pending' | 'sold'>, options: any = {}): Promise => { // verify required parameter 'status' is not null or undefined - if (status === null || status === undefined) { - throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); - } + assertParamExists('findPetsByStatus', 'status', status) const localVarPath = `/pet/findByStatus`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -395,12 +361,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (status) { localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS.csv); @@ -408,19 +369,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -433,12 +387,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ findPetsByTags: async (tags: Array, options: any = {}): Promise => { // verify required parameter 'tags' is not null or undefined - if (tags === null || tags === undefined) { - throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); - } + assertParamExists('findPetsByTags', 'tags', tags) const localVarPath = `/pet/findByTags`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -450,12 +402,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (tags) { localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS.csv); @@ -463,19 +410,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -488,13 +428,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ getPetById: async (petId: number, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); - } + assertParamExists('getPetById', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -505,28 +443,16 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; // authentication api_key required - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey("api_key") - : await configuration.apiKey; - localVarHeaderParameter["api_key"] = localVarApiKeyValue; - } + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -539,12 +465,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ updatePet: async (body: Pet, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); - } + assertParamExists('updatePet', 'body', body) const localVarPath = `/pet`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -556,37 +480,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -601,13 +507,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ updatePetWithForm: async (petId: number, name?: string, status?: string, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); - } + assertParamExists('updatePetWithForm', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -620,12 +524,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (name !== undefined) { @@ -639,20 +538,13 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams.toString(); return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -667,13 +559,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ uploadFile: async (petId: number, additionalMetadata?: string, file?: any, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); - } + assertParamExists('uploadFile', 'petId', petId) const localVarPath = `/pet/{petId}/uploadImage` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -686,12 +576,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (additionalMetadata !== undefined) { @@ -705,20 +590,13 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -730,6 +608,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) * @export */ export const PetApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = PetApiAxiosParamCreator(configuration) return { /** * @@ -739,11 +618,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async addPet(body: Pet, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).addPet(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.addPet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -754,11 +630,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deletePet(petId: number, apiKey?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).deletePet(petId, apiKey, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePet(petId, apiKey, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Multiple status values can be provided with comma separated strings @@ -768,11 +641,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).findPetsByStatus(status, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByStatus(status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -782,11 +652,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async findPetsByTags(tags: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).findPetsByTags(tags, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByTags(tags, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns a single pet @@ -796,11 +663,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getPetById(petId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).getPetById(petId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getPetById(petId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -810,11 +674,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updatePet(body: Pet, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).updatePet(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -826,11 +687,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updatePetWithForm(petId: number, name?: string, status?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).updatePetWithForm(petId, name, status, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePetWithForm(petId, name, status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -842,11 +700,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(petId, additionalMetadata, file, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -856,6 +711,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @export */ export const PetApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = PetApiFp(configuration) return { /** * @@ -865,7 +721,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ addPet(body: Pet, options?: any): AxiosPromise { - return PetApiFp(configuration).addPet(body, options).then((request) => request(axios, basePath)); + return localVarFp.addPet(body, options).then((request) => request(axios, basePath)); }, /** * @@ -876,7 +732,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { - return PetApiFp(configuration).deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); + return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); }, /** * Multiple status values can be provided with comma separated strings @@ -886,7 +742,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): AxiosPromise> { - return PetApiFp(configuration).findPetsByStatus(status, options).then((request) => request(axios, basePath)); + return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); }, /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -896,7 +752,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ findPetsByTags(tags: Array, options?: any): AxiosPromise> { - return PetApiFp(configuration).findPetsByTags(tags, options).then((request) => request(axios, basePath)); + return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); }, /** * Returns a single pet @@ -906,7 +762,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ getPetById(petId: number, options?: any): AxiosPromise { - return PetApiFp(configuration).getPetById(petId, options).then((request) => request(axios, basePath)); + return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); }, /** * @@ -916,7 +772,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ updatePet(body: Pet, options?: any): AxiosPromise { - return PetApiFp(configuration).updatePet(body, options).then((request) => request(axios, basePath)); + return localVarFp.updatePet(body, options).then((request) => request(axios, basePath)); }, /** * @@ -928,7 +784,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { - return PetApiFp(configuration).updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); + return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); }, /** * @@ -940,7 +796,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): AxiosPromise { - return PetApiFp(configuration).uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); + return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); }, }; }; @@ -1070,13 +926,11 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ deleteOrder: async (orderId: string, options: any = {}): Promise => { // verify required parameter 'orderId' is not null or undefined - if (orderId === null || orderId === undefined) { - throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); - } + assertParamExists('deleteOrder', 'orderId', orderId) const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1088,19 +942,12 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1113,7 +960,7 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration getInventory: async (options: any = {}): Promise => { const localVarPath = `/store/inventory`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1124,28 +971,16 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; // authentication api_key required - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey("api_key") - : await configuration.apiKey; - localVarHeaderParameter["api_key"] = localVarApiKeyValue; - } + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1158,13 +993,11 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ getOrderById: async (orderId: number, options: any = {}): Promise => { // verify required parameter 'orderId' is not null or undefined - if (orderId === null || orderId === undefined) { - throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); - } + assertParamExists('getOrderById', 'orderId', orderId) const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1176,19 +1009,12 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1201,12 +1027,10 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ placeOrder: async (body: Order, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling placeOrder.'); - } + assertParamExists('placeOrder', 'body', body) const localVarPath = `/store/order`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1220,26 +1044,13 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1251,6 +1062,7 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration * @export */ export const StoreApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = StoreApiAxiosParamCreator(configuration) return { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -1260,11 +1072,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deleteOrder(orderId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).deleteOrder(orderId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrder(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns a map of status codes to quantities @@ -1273,11 +1082,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getInventory(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).getInventory(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -1287,11 +1093,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getOrderById(orderId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).getOrderById(orderId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderById(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1301,11 +1104,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async placeOrder(body: Order, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).placeOrder(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.placeOrder(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -1315,6 +1115,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @export */ export const StoreApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = StoreApiFp(configuration) return { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -1324,7 +1125,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ deleteOrder(orderId: string, options?: any): AxiosPromise { - return StoreApiFp(configuration).deleteOrder(orderId, options).then((request) => request(axios, basePath)); + return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); }, /** * Returns a map of status codes to quantities @@ -1333,7 +1134,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { - return StoreApiFp(configuration).getInventory(options).then((request) => request(axios, basePath)); + return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -1343,7 +1144,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getOrderById(orderId: number, options?: any): AxiosPromise { - return StoreApiFp(configuration).getOrderById(orderId, options).then((request) => request(axios, basePath)); + return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); }, /** * @@ -1353,7 +1154,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ placeOrder(body: Order, options?: any): AxiosPromise { - return StoreApiFp(configuration).placeOrder(body, options).then((request) => request(axios, basePath)); + return localVarFp.placeOrder(body, options).then((request) => request(axios, basePath)); }, }; }; @@ -1429,12 +1230,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUser: async (body: User, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); - } + assertParamExists('createUser', 'body', body) const localVarPath = `/user`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1448,26 +1247,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1480,12 +1266,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUsersWithArrayInput: async (body: Array, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); - } + assertParamExists('createUsersWithArrayInput', 'body', body) const localVarPath = `/user/createWithArray`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1499,26 +1283,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1531,12 +1302,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUsersWithListInput: async (body: Array, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); - } + assertParamExists('createUsersWithListInput', 'body', body) const localVarPath = `/user/createWithList`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1550,26 +1319,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1582,13 +1338,11 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ deleteUser: async (username: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); - } + assertParamExists('deleteUser', 'username', username) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1600,19 +1354,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1625,13 +1372,11 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ getUserByName: async (username: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); - } + assertParamExists('getUserByName', 'username', username) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1643,19 +1388,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1669,16 +1407,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ loginUser: async (username: string, password: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling loginUser.'); - } + assertParamExists('loginUser', 'username', username) // verify required parameter 'password' is not null or undefined - if (password === null || password === undefined) { - throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); - } + assertParamExists('loginUser', 'password', password) const localVarPath = `/user/login`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1698,19 +1432,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1723,7 +1450,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) logoutUser: async (options: any = {}): Promise => { const localVarPath = `/user/logout`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1735,19 +1462,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1761,17 +1481,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ updateUser: async (username: string, body: User, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling updateUser.'); - } + assertParamExists('updateUser', 'username', username) // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling updateUser.'); - } + assertParamExists('updateUser', 'body', body) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1785,26 +1501,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1816,6 +1519,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) * @export */ export const UserApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) return { /** * This can only be done by the logged in user. @@ -1825,11 +1529,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUser(body: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUser(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUser(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1839,11 +1540,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUsersWithArrayInput(body: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUsersWithArrayInput(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithArrayInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1853,11 +1551,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUsersWithListInput(body: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUsersWithListInput(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithListInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This can only be done by the logged in user. @@ -1867,11 +1562,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deleteUser(username: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).deleteUser(username, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUser(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1881,11 +1573,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getUserByName(username: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserByName(username, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserByName(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1896,11 +1585,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async loginUser(username: string, password: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).loginUser(username, password, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.loginUser(username, password, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1909,11 +1595,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async logoutUser(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).logoutUser(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.logoutUser(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This can only be done by the logged in user. @@ -1924,11 +1607,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updateUser(username: string, body: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).updateUser(username, body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(username, body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -1938,6 +1618,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @export */ export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = UserApiFp(configuration) return { /** * This can only be done by the logged in user. @@ -1947,7 +1628,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUser(body: User, options?: any): AxiosPromise { - return UserApiFp(configuration).createUser(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUser(body, options).then((request) => request(axios, basePath)); }, /** * @@ -1957,7 +1638,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { - return UserApiFp(configuration).createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); }, /** * @@ -1967,7 +1648,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUsersWithListInput(body: Array, options?: any): AxiosPromise { - return UserApiFp(configuration).createUsersWithListInput(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUsersWithListInput(body, options).then((request) => request(axios, basePath)); }, /** * This can only be done by the logged in user. @@ -1977,7 +1658,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ deleteUser(username: string, options?: any): AxiosPromise { - return UserApiFp(configuration).deleteUser(username, options).then((request) => request(axios, basePath)); + return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); }, /** * @@ -1987,7 +1668,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ getUserByName(username: string, options?: any): AxiosPromise { - return UserApiFp(configuration).getUserByName(username, options).then((request) => request(axios, basePath)); + return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); }, /** * @@ -1998,7 +1679,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ loginUser(username: string, password: string, options?: any): AxiosPromise { - return UserApiFp(configuration).loginUser(username, password, options).then((request) => request(axios, basePath)); + return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); }, /** * @@ -2007,7 +1688,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ logoutUser(options?: any): AxiosPromise { - return UserApiFp(configuration).logoutUser(options).then((request) => request(axios, basePath)); + return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); }, /** * This can only be done by the logged in user. @@ -2018,7 +1699,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ updateUser(username: string, body: User, options?: any): AxiosPromise { - return UserApiFp(configuration).updateUser(username, body, options).then((request) => request(axios, basePath)); + return localVarFp.updateUser(username, body, options).then((request) => request(axios, basePath)); }, }; }; diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/common.ts b/samples/client/petstore/typescript-axios/builds/es6-target/common.ts new file mode 100644 index 00000000000..23e6a699c68 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/es6-target/common.ts @@ -0,0 +1,131 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from "./configuration"; +import { RequiredError, RequestArgs } from "./base"; +import { AxiosInstance } from 'axios'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + for (const object of objects) { + for (const key in object) { + searchParams.set(key, object[key]); + } + } + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/FILES index 5bef353ae38..a80cd4f07b0 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/FILES @@ -2,6 +2,7 @@ .npmignore api.ts base.ts +common.ts configuration.ts git_push.sh index.ts diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts index 9b2c0fd3fed..85c32a979e2 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts @@ -17,6 +17,8 @@ import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; // Some imports not used depending on template conditions // @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; /** @@ -263,12 +265,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ addPet: async (pet: Pet, header1?: Pet, header2?: Array, options: any = {}): Promise => { // verify required parameter 'pet' is not null or undefined - if (pet === null || pet === undefined) { - throw new RequiredError('pet','Required parameter pet was null or undefined when calling addPet.'); - } + assertParamExists('addPet', 'pet', pet) const localVarPath = `/pet`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -280,12 +280,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (header1 !== undefined && header1 !== null) { localVarHeaderParameter['header1'] = String(JSON.stringify(header1)); @@ -300,26 +295,13 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof pet !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(pet !== undefined ? pet : {}) - : (pet || ""); + localVarRequestOptions.data = serializeDataIfNeeded(pet, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -333,13 +315,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ deletePet: async (petId: number, apiKey?: string, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); - } + assertParamExists('deletePet', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -351,12 +331,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (apiKey !== undefined && apiKey !== null) { localVarHeaderParameter['api_key'] = String(apiKey); @@ -364,19 +339,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -389,12 +357,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ findPetsByStatus: async (status: Array<'available' | 'pending' | 'sold'>, options: any = {}): Promise => { // verify required parameter 'status' is not null or undefined - if (status === null || status === undefined) { - throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); - } + assertParamExists('findPetsByStatus', 'status', status) const localVarPath = `/pet/findByStatus`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -406,12 +372,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (status) { localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS.csv); @@ -419,19 +380,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -444,12 +398,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ findPetsByTags: async (tags: Array, options: any = {}): Promise => { // verify required parameter 'tags' is not null or undefined - if (tags === null || tags === undefined) { - throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); - } + assertParamExists('findPetsByTags', 'tags', tags) const localVarPath = `/pet/findByTags`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -461,12 +413,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (tags) { localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS.csv); @@ -474,19 +421,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -499,13 +439,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ getPetById: async (petId: number, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); - } + assertParamExists('getPetById', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -516,28 +454,16 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; // authentication api_key required - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey("api_key") - : await configuration.apiKey; - localVarHeaderParameter["api_key"] = localVarApiKeyValue; - } + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -550,12 +476,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ updatePet: async (pet: Pet, options: any = {}): Promise => { // verify required parameter 'pet' is not null or undefined - if (pet === null || pet === undefined) { - throw new RequiredError('pet','Required parameter pet was null or undefined when calling updatePet.'); - } + assertParamExists('updatePet', 'pet', pet) const localVarPath = `/pet`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -567,37 +491,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof pet !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(pet !== undefined ? pet : {}) - : (pet || ""); + localVarRequestOptions.data = serializeDataIfNeeded(pet, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -612,13 +518,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ updatePetWithForm: async (petId: number, name?: string, status?: string, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); - } + assertParamExists('updatePetWithForm', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -631,12 +535,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (name !== undefined) { @@ -650,20 +549,13 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams.toString(); return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -678,13 +570,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ uploadFile: async (petId: number, additionalMetadata?: string, file?: any, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); - } + assertParamExists('uploadFile', 'petId', petId) const localVarPath = `/pet/{petId}/uploadImage` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -697,12 +587,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (additionalMetadata !== undefined) { @@ -716,20 +601,13 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -741,6 +619,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) * @export */ export const PetApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = PetApiAxiosParamCreator(configuration) return { /** * @@ -752,11 +631,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async addPet(pet: Pet, header1?: Pet, header2?: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).addPet(pet, header1, header2, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.addPet(pet, header1, header2, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -767,11 +643,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deletePet(petId: number, apiKey?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).deletePet(petId, apiKey, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePet(petId, apiKey, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Multiple status values can be provided with comma separated strings @@ -781,11 +654,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).findPetsByStatus(status, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByStatus(status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -795,11 +665,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async findPetsByTags(tags: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).findPetsByTags(tags, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByTags(tags, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns a single pet @@ -809,11 +676,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getPetById(petId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).getPetById(petId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getPetById(petId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -823,11 +687,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updatePet(pet: Pet, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).updatePet(pet, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePet(pet, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -839,11 +700,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updatePetWithForm(petId: number, name?: string, status?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).updatePetWithForm(petId, name, status, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePetWithForm(petId, name, status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -855,11 +713,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(petId, additionalMetadata, file, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -869,6 +724,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @export */ export const PetApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = PetApiFp(configuration) return { /** * @@ -880,7 +736,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ addPet(pet: Pet, header1?: Pet, header2?: Array, options?: any): AxiosPromise { - return PetApiFp(configuration).addPet(pet, header1, header2, options).then((request) => request(axios, basePath)); + return localVarFp.addPet(pet, header1, header2, options).then((request) => request(axios, basePath)); }, /** * @@ -891,7 +747,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { - return PetApiFp(configuration).deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); + return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); }, /** * Multiple status values can be provided with comma separated strings @@ -901,7 +757,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): AxiosPromise> { - return PetApiFp(configuration).findPetsByStatus(status, options).then((request) => request(axios, basePath)); + return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); }, /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -911,7 +767,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ findPetsByTags(tags: Array, options?: any): AxiosPromise> { - return PetApiFp(configuration).findPetsByTags(tags, options).then((request) => request(axios, basePath)); + return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); }, /** * Returns a single pet @@ -921,7 +777,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ getPetById(petId: number, options?: any): AxiosPromise { - return PetApiFp(configuration).getPetById(petId, options).then((request) => request(axios, basePath)); + return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); }, /** * @@ -931,7 +787,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ updatePet(pet: Pet, options?: any): AxiosPromise { - return PetApiFp(configuration).updatePet(pet, options).then((request) => request(axios, basePath)); + return localVarFp.updatePet(pet, options).then((request) => request(axios, basePath)); }, /** * @@ -943,7 +799,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { - return PetApiFp(configuration).updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); + return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); }, /** * @@ -955,7 +811,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): AxiosPromise { - return PetApiFp(configuration).uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); + return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); }, }; }; @@ -1087,13 +943,11 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ deleteOrder: async (orderId: string, options: any = {}): Promise => { // verify required parameter 'orderId' is not null or undefined - if (orderId === null || orderId === undefined) { - throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); - } + assertParamExists('deleteOrder', 'orderId', orderId) const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1105,19 +959,12 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1130,7 +977,7 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration getInventory: async (options: any = {}): Promise => { const localVarPath = `/store/inventory`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1141,28 +988,16 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; // authentication api_key required - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey("api_key") - : await configuration.apiKey; - localVarHeaderParameter["api_key"] = localVarApiKeyValue; - } + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1175,13 +1010,11 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ getOrderById: async (orderId: number, options: any = {}): Promise => { // verify required parameter 'orderId' is not null or undefined - if (orderId === null || orderId === undefined) { - throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); - } + assertParamExists('getOrderById', 'orderId', orderId) const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1193,19 +1026,12 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1218,12 +1044,10 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ placeOrder: async (order: Order, options: any = {}): Promise => { // verify required parameter 'order' is not null or undefined - if (order === null || order === undefined) { - throw new RequiredError('order','Required parameter order was null or undefined when calling placeOrder.'); - } + assertParamExists('placeOrder', 'order', order) const localVarPath = `/store/order`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1237,26 +1061,13 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof order !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(order !== undefined ? order : {}) - : (order || ""); + localVarRequestOptions.data = serializeDataIfNeeded(order, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1268,6 +1079,7 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration * @export */ export const StoreApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = StoreApiAxiosParamCreator(configuration) return { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -1277,11 +1089,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deleteOrder(orderId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).deleteOrder(orderId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrder(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns a map of status codes to quantities @@ -1290,11 +1099,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getInventory(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).getInventory(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -1304,11 +1110,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getOrderById(orderId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).getOrderById(orderId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderById(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1318,11 +1121,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async placeOrder(order: Order, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).placeOrder(order, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.placeOrder(order, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -1332,6 +1132,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @export */ export const StoreApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = StoreApiFp(configuration) return { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -1341,7 +1142,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ deleteOrder(orderId: string, options?: any): AxiosPromise { - return StoreApiFp(configuration).deleteOrder(orderId, options).then((request) => request(axios, basePath)); + return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); }, /** * Returns a map of status codes to quantities @@ -1350,7 +1151,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { - return StoreApiFp(configuration).getInventory(options).then((request) => request(axios, basePath)); + return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -1360,7 +1161,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getOrderById(orderId: number, options?: any): AxiosPromise { - return StoreApiFp(configuration).getOrderById(orderId, options).then((request) => request(axios, basePath)); + return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); }, /** * @@ -1370,7 +1171,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ placeOrder(order: Order, options?: any): AxiosPromise { - return StoreApiFp(configuration).placeOrder(order, options).then((request) => request(axios, basePath)); + return localVarFp.placeOrder(order, options).then((request) => request(axios, basePath)); }, }; }; @@ -1446,12 +1247,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUser: async (user: User, options: any = {}): Promise => { // verify required parameter 'user' is not null or undefined - if (user === null || user === undefined) { - throw new RequiredError('user','Required parameter user was null or undefined when calling createUser.'); - } + assertParamExists('createUser', 'user', user) const localVarPath = `/user`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1465,26 +1264,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof user !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(user !== undefined ? user : {}) - : (user || ""); + localVarRequestOptions.data = serializeDataIfNeeded(user, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1497,12 +1283,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUsersWithArrayInput: async (user: Array, options: any = {}): Promise => { // verify required parameter 'user' is not null or undefined - if (user === null || user === undefined) { - throw new RequiredError('user','Required parameter user was null or undefined when calling createUsersWithArrayInput.'); - } + assertParamExists('createUsersWithArrayInput', 'user', user) const localVarPath = `/user/createWithArray`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1516,26 +1300,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof user !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(user !== undefined ? user : {}) - : (user || ""); + localVarRequestOptions.data = serializeDataIfNeeded(user, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1548,12 +1319,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUsersWithListInput: async (user: Array, options: any = {}): Promise => { // verify required parameter 'user' is not null or undefined - if (user === null || user === undefined) { - throw new RequiredError('user','Required parameter user was null or undefined when calling createUsersWithListInput.'); - } + assertParamExists('createUsersWithListInput', 'user', user) const localVarPath = `/user/createWithList`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1567,26 +1336,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof user !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(user !== undefined ? user : {}) - : (user || ""); + localVarRequestOptions.data = serializeDataIfNeeded(user, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1599,13 +1355,11 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ deleteUser: async (username: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); - } + assertParamExists('deleteUser', 'username', username) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1617,19 +1371,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1642,13 +1389,11 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ getUserByName: async (username: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); - } + assertParamExists('getUserByName', 'username', username) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1660,19 +1405,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1686,16 +1424,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ loginUser: async (username: string, password: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling loginUser.'); - } + assertParamExists('loginUser', 'username', username) // verify required parameter 'password' is not null or undefined - if (password === null || password === undefined) { - throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); - } + assertParamExists('loginUser', 'password', password) const localVarPath = `/user/login`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1715,19 +1449,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1740,7 +1467,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) logoutUser: async (options: any = {}): Promise => { const localVarPath = `/user/logout`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1752,19 +1479,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1778,17 +1498,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ updateUser: async (username: string, user: User, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling updateUser.'); - } + assertParamExists('updateUser', 'username', username) // verify required parameter 'user' is not null or undefined - if (user === null || user === undefined) { - throw new RequiredError('user','Required parameter user was null or undefined when calling updateUser.'); - } + assertParamExists('updateUser', 'user', user) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1802,26 +1518,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof user !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(user !== undefined ? user : {}) - : (user || ""); + localVarRequestOptions.data = serializeDataIfNeeded(user, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1833,6 +1536,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) * @export */ export const UserApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) return { /** * This can only be done by the logged in user. @@ -1842,11 +1546,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUser(user: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUser(user, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUser(user, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1856,11 +1557,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUsersWithArrayInput(user: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUsersWithArrayInput(user, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithArrayInput(user, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1870,11 +1568,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUsersWithListInput(user: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUsersWithListInput(user, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithListInput(user, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This can only be done by the logged in user. @@ -1884,11 +1579,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deleteUser(username: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).deleteUser(username, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUser(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1898,11 +1590,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getUserByName(username: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserByName(username, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserByName(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1913,11 +1602,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async loginUser(username: string, password: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).loginUser(username, password, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.loginUser(username, password, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1926,11 +1612,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async logoutUser(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).logoutUser(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.logoutUser(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This can only be done by the logged in user. @@ -1941,11 +1624,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updateUser(username: string, user: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).updateUser(username, user, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(username, user, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -1955,6 +1635,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @export */ export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = UserApiFp(configuration) return { /** * This can only be done by the logged in user. @@ -1964,7 +1645,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUser(user: User, options?: any): AxiosPromise { - return UserApiFp(configuration).createUser(user, options).then((request) => request(axios, basePath)); + return localVarFp.createUser(user, options).then((request) => request(axios, basePath)); }, /** * @@ -1974,7 +1655,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUsersWithArrayInput(user: Array, options?: any): AxiosPromise { - return UserApiFp(configuration).createUsersWithArrayInput(user, options).then((request) => request(axios, basePath)); + return localVarFp.createUsersWithArrayInput(user, options).then((request) => request(axios, basePath)); }, /** * @@ -1984,7 +1665,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUsersWithListInput(user: Array, options?: any): AxiosPromise { - return UserApiFp(configuration).createUsersWithListInput(user, options).then((request) => request(axios, basePath)); + return localVarFp.createUsersWithListInput(user, options).then((request) => request(axios, basePath)); }, /** * This can only be done by the logged in user. @@ -1994,7 +1675,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ deleteUser(username: string, options?: any): AxiosPromise { - return UserApiFp(configuration).deleteUser(username, options).then((request) => request(axios, basePath)); + return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); }, /** * @@ -2004,7 +1685,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ getUserByName(username: string, options?: any): AxiosPromise { - return UserApiFp(configuration).getUserByName(username, options).then((request) => request(axios, basePath)); + return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); }, /** * @@ -2015,7 +1696,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ loginUser(username: string, password: string, options?: any): AxiosPromise { - return UserApiFp(configuration).loginUser(username, password, options).then((request) => request(axios, basePath)); + return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); }, /** * @@ -2024,7 +1705,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ logoutUser(options?: any): AxiosPromise { - return UserApiFp(configuration).logoutUser(options).then((request) => request(axios, basePath)); + return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); }, /** * This can only be done by the logged in user. @@ -2035,7 +1716,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ updateUser(username: string, user: User, options?: any): AxiosPromise { - return UserApiFp(configuration).updateUser(username, user, options).then((request) => request(axios, basePath)); + return localVarFp.updateUser(username, user, options).then((request) => request(axios, basePath)); }, }; }; diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/common.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/common.ts new file mode 100644 index 00000000000..23e6a699c68 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/common.ts @@ -0,0 +1,131 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from "./configuration"; +import { RequiredError, RequestArgs } from "./base"; +import { AxiosInstance } from 'axios'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + for (const object of objects) { + for (const key in object) { + searchParams.set(key, object[key]); + } + } + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/FILES index 5bef353ae38..a80cd4f07b0 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/FILES @@ -2,6 +2,7 @@ .npmignore api.ts base.ts +common.ts configuration.ts git_push.sh index.ts diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts index 132c7cc9635..0368b1d5703 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts @@ -17,6 +17,8 @@ import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; // Some imports not used depending on template conditions // @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; /** @@ -261,12 +263,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ addPet: async (body: Pet, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); - } + assertParamExists('addPet', 'body', body) const localVarPath = `/pet`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -278,37 +278,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -322,13 +304,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ deletePet: async (petId: number, apiKey?: string, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); - } + assertParamExists('deletePet', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -340,12 +320,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (apiKey !== undefined && apiKey !== null) { localVarHeaderParameter['api_key'] = String(apiKey); @@ -353,19 +328,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -378,12 +346,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ findPetsByStatus: async (status: Array<'available' | 'pending' | 'sold'>, options: any = {}): Promise => { // verify required parameter 'status' is not null or undefined - if (status === null || status === undefined) { - throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); - } + assertParamExists('findPetsByStatus', 'status', status) const localVarPath = `/pet/findByStatus`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -395,12 +361,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (status) { localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS.csv); @@ -408,19 +369,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -433,12 +387,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ findPetsByTags: async (tags: Array, options: any = {}): Promise => { // verify required parameter 'tags' is not null or undefined - if (tags === null || tags === undefined) { - throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); - } + assertParamExists('findPetsByTags', 'tags', tags) const localVarPath = `/pet/findByTags`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -450,12 +402,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (tags) { localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS.csv); @@ -463,19 +410,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -488,13 +428,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ getPetById: async (petId: number, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); - } + assertParamExists('getPetById', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -505,28 +443,16 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; // authentication api_key required - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey("api_key") - : await configuration.apiKey; - localVarHeaderParameter["api_key"] = localVarApiKeyValue; - } + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -539,12 +465,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ updatePet: async (body: Pet, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); - } + assertParamExists('updatePet', 'body', body) const localVarPath = `/pet`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -556,37 +480,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -601,13 +507,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ updatePetWithForm: async (petId: number, name?: string, status?: string, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); - } + assertParamExists('updatePetWithForm', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -620,12 +524,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (name !== undefined) { @@ -639,20 +538,13 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams.toString(); return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -667,13 +559,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ uploadFile: async (petId: number, additionalMetadata?: string, file?: any, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); - } + assertParamExists('uploadFile', 'petId', petId) const localVarPath = `/pet/{petId}/uploadImage` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -686,12 +576,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (additionalMetadata !== undefined) { @@ -705,20 +590,13 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -730,6 +608,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) * @export */ export const PetApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = PetApiAxiosParamCreator(configuration) return { /** * @@ -739,11 +618,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async addPet(body: Pet, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).addPet(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.addPet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -754,11 +630,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deletePet(petId: number, apiKey?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).deletePet(petId, apiKey, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePet(petId, apiKey, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Multiple status values can be provided with comma separated strings @@ -768,11 +641,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).findPetsByStatus(status, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByStatus(status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -782,11 +652,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async findPetsByTags(tags: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).findPetsByTags(tags, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByTags(tags, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns a single pet @@ -796,11 +663,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getPetById(petId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).getPetById(petId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getPetById(petId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -810,11 +674,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updatePet(body: Pet, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).updatePet(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -826,11 +687,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updatePetWithForm(petId: number, name?: string, status?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).updatePetWithForm(petId, name, status, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePetWithForm(petId, name, status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -842,11 +700,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(petId, additionalMetadata, file, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -856,6 +711,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @export */ export const PetApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = PetApiFp(configuration) return { /** * @@ -865,7 +721,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ addPet(body: Pet, options?: any): AxiosPromise { - return PetApiFp(configuration).addPet(body, options).then((request) => request(axios, basePath)); + return localVarFp.addPet(body, options).then((request) => request(axios, basePath)); }, /** * @@ -876,7 +732,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { - return PetApiFp(configuration).deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); + return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); }, /** * Multiple status values can be provided with comma separated strings @@ -886,7 +742,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): AxiosPromise> { - return PetApiFp(configuration).findPetsByStatus(status, options).then((request) => request(axios, basePath)); + return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); }, /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -896,7 +752,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ findPetsByTags(tags: Array, options?: any): AxiosPromise> { - return PetApiFp(configuration).findPetsByTags(tags, options).then((request) => request(axios, basePath)); + return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); }, /** * Returns a single pet @@ -906,7 +762,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ getPetById(petId: number, options?: any): AxiosPromise { - return PetApiFp(configuration).getPetById(petId, options).then((request) => request(axios, basePath)); + return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); }, /** * @@ -916,7 +772,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ updatePet(body: Pet, options?: any): AxiosPromise { - return PetApiFp(configuration).updatePet(body, options).then((request) => request(axios, basePath)); + return localVarFp.updatePet(body, options).then((request) => request(axios, basePath)); }, /** * @@ -928,7 +784,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { - return PetApiFp(configuration).updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); + return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); }, /** * @@ -940,7 +796,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): AxiosPromise { - return PetApiFp(configuration).uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); + return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); }, }; }; @@ -1163,13 +1019,11 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ deleteOrder: async (orderId: string, options: any = {}): Promise => { // verify required parameter 'orderId' is not null or undefined - if (orderId === null || orderId === undefined) { - throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); - } + assertParamExists('deleteOrder', 'orderId', orderId) const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1181,19 +1035,12 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1206,7 +1053,7 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration getInventory: async (options: any = {}): Promise => { const localVarPath = `/store/inventory`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1217,28 +1064,16 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; // authentication api_key required - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey("api_key") - : await configuration.apiKey; - localVarHeaderParameter["api_key"] = localVarApiKeyValue; - } + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1251,13 +1086,11 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ getOrderById: async (orderId: number, options: any = {}): Promise => { // verify required parameter 'orderId' is not null or undefined - if (orderId === null || orderId === undefined) { - throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); - } + assertParamExists('getOrderById', 'orderId', orderId) const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1269,19 +1102,12 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1294,12 +1120,10 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ placeOrder: async (body: Order, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling placeOrder.'); - } + assertParamExists('placeOrder', 'body', body) const localVarPath = `/store/order`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1313,26 +1137,13 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1344,6 +1155,7 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration * @export */ export const StoreApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = StoreApiAxiosParamCreator(configuration) return { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -1353,11 +1165,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deleteOrder(orderId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).deleteOrder(orderId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrder(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns a map of status codes to quantities @@ -1366,11 +1175,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getInventory(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).getInventory(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -1380,11 +1186,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getOrderById(orderId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).getOrderById(orderId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderById(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1394,11 +1197,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async placeOrder(body: Order, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).placeOrder(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.placeOrder(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -1408,6 +1208,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @export */ export const StoreApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = StoreApiFp(configuration) return { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -1417,7 +1218,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ deleteOrder(orderId: string, options?: any): AxiosPromise { - return StoreApiFp(configuration).deleteOrder(orderId, options).then((request) => request(axios, basePath)); + return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); }, /** * Returns a map of status codes to quantities @@ -1426,7 +1227,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { - return StoreApiFp(configuration).getInventory(options).then((request) => request(axios, basePath)); + return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -1436,7 +1237,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getOrderById(orderId: number, options?: any): AxiosPromise { - return StoreApiFp(configuration).getOrderById(orderId, options).then((request) => request(axios, basePath)); + return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); }, /** * @@ -1446,7 +1247,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ placeOrder(body: Order, options?: any): AxiosPromise { - return StoreApiFp(configuration).placeOrder(body, options).then((request) => request(axios, basePath)); + return localVarFp.placeOrder(body, options).then((request) => request(axios, basePath)); }, }; }; @@ -1569,12 +1370,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUser: async (body: User, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); - } + assertParamExists('createUser', 'body', body) const localVarPath = `/user`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1588,26 +1387,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1620,12 +1406,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUsersWithArrayInput: async (body: Array, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); - } + assertParamExists('createUsersWithArrayInput', 'body', body) const localVarPath = `/user/createWithArray`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1639,26 +1423,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1671,12 +1442,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUsersWithListInput: async (body: Array, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); - } + assertParamExists('createUsersWithListInput', 'body', body) const localVarPath = `/user/createWithList`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1690,26 +1459,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1722,13 +1478,11 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ deleteUser: async (username: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); - } + assertParamExists('deleteUser', 'username', username) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1740,19 +1494,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1765,13 +1512,11 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ getUserByName: async (username: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); - } + assertParamExists('getUserByName', 'username', username) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1783,19 +1528,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1809,16 +1547,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ loginUser: async (username: string, password: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling loginUser.'); - } + assertParamExists('loginUser', 'username', username) // verify required parameter 'password' is not null or undefined - if (password === null || password === undefined) { - throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); - } + assertParamExists('loginUser', 'password', password) const localVarPath = `/user/login`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1838,19 +1572,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1863,7 +1590,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) logoutUser: async (options: any = {}): Promise => { const localVarPath = `/user/logout`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1875,19 +1602,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1901,17 +1621,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ updateUser: async (username: string, body: User, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling updateUser.'); - } + assertParamExists('updateUser', 'username', username) // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling updateUser.'); - } + assertParamExists('updateUser', 'body', body) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1925,26 +1641,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1956,6 +1659,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) * @export */ export const UserApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) return { /** * This can only be done by the logged in user. @@ -1965,11 +1669,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUser(body: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUser(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUser(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1979,11 +1680,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUsersWithArrayInput(body: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUsersWithArrayInput(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithArrayInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1993,11 +1691,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUsersWithListInput(body: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUsersWithListInput(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithListInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This can only be done by the logged in user. @@ -2007,11 +1702,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deleteUser(username: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).deleteUser(username, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUser(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -2021,11 +1713,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getUserByName(username: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserByName(username, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserByName(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -2036,11 +1725,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async loginUser(username: string, password: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).loginUser(username, password, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.loginUser(username, password, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -2049,11 +1735,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async logoutUser(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).logoutUser(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.logoutUser(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This can only be done by the logged in user. @@ -2064,11 +1747,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updateUser(username: string, body: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).updateUser(username, body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(username, body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -2078,6 +1758,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @export */ export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = UserApiFp(configuration) return { /** * This can only be done by the logged in user. @@ -2087,7 +1768,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUser(body: User, options?: any): AxiosPromise { - return UserApiFp(configuration).createUser(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUser(body, options).then((request) => request(axios, basePath)); }, /** * @@ -2097,7 +1778,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { - return UserApiFp(configuration).createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); }, /** * @@ -2107,7 +1788,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUsersWithListInput(body: Array, options?: any): AxiosPromise { - return UserApiFp(configuration).createUsersWithListInput(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUsersWithListInput(body, options).then((request) => request(axios, basePath)); }, /** * This can only be done by the logged in user. @@ -2117,7 +1798,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ deleteUser(username: string, options?: any): AxiosPromise { - return UserApiFp(configuration).deleteUser(username, options).then((request) => request(axios, basePath)); + return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); }, /** * @@ -2127,7 +1808,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ getUserByName(username: string, options?: any): AxiosPromise { - return UserApiFp(configuration).getUserByName(username, options).then((request) => request(axios, basePath)); + return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); }, /** * @@ -2138,7 +1819,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ loginUser(username: string, password: string, options?: any): AxiosPromise { - return UserApiFp(configuration).loginUser(username, password, options).then((request) => request(axios, basePath)); + return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); }, /** * @@ -2147,7 +1828,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ logoutUser(options?: any): AxiosPromise { - return UserApiFp(configuration).logoutUser(options).then((request) => request(axios, basePath)); + return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); }, /** * This can only be done by the logged in user. @@ -2158,7 +1839,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ updateUser(username: string, body: User, options?: any): AxiosPromise { - return UserApiFp(configuration).updateUser(username, body, options).then((request) => request(axios, basePath)); + return localVarFp.updateUser(username, body, options).then((request) => request(axios, basePath)); }, }; }; diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/common.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/common.ts new file mode 100644 index 00000000000..23e6a699c68 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/common.ts @@ -0,0 +1,131 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from "./configuration"; +import { RequiredError, RequestArgs } from "./base"; +import { AxiosInstance } from 'axios'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + for (const object of objects) { + for (const key in object) { + searchParams.set(key, object[key]); + } + } + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/FILES index 94156a16c6b..aded8aa37a1 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/FILES @@ -6,6 +6,7 @@ api/another/level/pet-api.ts api/another/level/store-api.ts api/another/level/user-api.ts base.ts +common.ts configuration.ts git_push.sh index.ts diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts index 338ebcd3fc4..fc66c5184fa 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts @@ -17,6 +17,8 @@ import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; import { Configuration } from '../../../configuration'; // Some imports not used depending on template conditions // @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../../../common'; +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../../../base'; // @ts-ignore import { ApiResponse } from '../../../model/some/levels/deep'; @@ -37,12 +39,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ addPet: async (body: Pet, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); - } + assertParamExists('addPet', 'body', body) const localVarPath = `/pet`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -54,37 +54,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -98,13 +80,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ deletePet: async (petId: number, apiKey?: string, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); - } + assertParamExists('deletePet', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -116,12 +96,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (apiKey !== undefined && apiKey !== null) { localVarHeaderParameter['api_key'] = String(apiKey); @@ -129,19 +104,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -154,12 +122,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ findPetsByStatus: async (status: Array<'available' | 'pending' | 'sold'>, options: any = {}): Promise => { // verify required parameter 'status' is not null or undefined - if (status === null || status === undefined) { - throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); - } + assertParamExists('findPetsByStatus', 'status', status) const localVarPath = `/pet/findByStatus`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -171,12 +137,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (status) { localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS.csv); @@ -184,19 +145,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -209,12 +163,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ findPetsByTags: async (tags: Array, options: any = {}): Promise => { // verify required parameter 'tags' is not null or undefined - if (tags === null || tags === undefined) { - throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); - } + assertParamExists('findPetsByTags', 'tags', tags) const localVarPath = `/pet/findByTags`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -226,12 +178,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (tags) { localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS.csv); @@ -239,19 +186,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -264,13 +204,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ getPetById: async (petId: number, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); - } + assertParamExists('getPetById', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -281,28 +219,16 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; // authentication api_key required - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey("api_key") - : await configuration.apiKey; - localVarHeaderParameter["api_key"] = localVarApiKeyValue; - } + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -315,12 +241,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ updatePet: async (body: Pet, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); - } + assertParamExists('updatePet', 'body', body) const localVarPath = `/pet`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -332,37 +256,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -377,13 +283,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ updatePetWithForm: async (petId: number, name?: string, status?: string, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); - } + assertParamExists('updatePetWithForm', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -396,12 +300,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (name !== undefined) { @@ -415,20 +314,13 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams.toString(); return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -443,13 +335,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ uploadFile: async (petId: number, additionalMetadata?: string, file?: any, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); - } + assertParamExists('uploadFile', 'petId', petId) const localVarPath = `/pet/{petId}/uploadImage` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -462,12 +352,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (additionalMetadata !== undefined) { @@ -481,20 +366,13 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -506,6 +384,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) * @export */ export const PetApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = PetApiAxiosParamCreator(configuration) return { /** * @@ -515,11 +394,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async addPet(body: Pet, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).addPet(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.addPet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -530,11 +406,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deletePet(petId: number, apiKey?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).deletePet(petId, apiKey, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePet(petId, apiKey, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Multiple status values can be provided with comma separated strings @@ -544,11 +417,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).findPetsByStatus(status, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByStatus(status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -558,11 +428,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async findPetsByTags(tags: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).findPetsByTags(tags, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByTags(tags, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns a single pet @@ -572,11 +439,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getPetById(petId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).getPetById(petId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getPetById(petId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -586,11 +450,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updatePet(body: Pet, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).updatePet(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -602,11 +463,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updatePetWithForm(petId: number, name?: string, status?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).updatePetWithForm(petId, name, status, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePetWithForm(petId, name, status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -618,11 +476,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(petId, additionalMetadata, file, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -632,6 +487,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @export */ export const PetApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = PetApiFp(configuration) return { /** * @@ -641,7 +497,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ addPet(body: Pet, options?: any): AxiosPromise { - return PetApiFp(configuration).addPet(body, options).then((request) => request(axios, basePath)); + return localVarFp.addPet(body, options).then((request) => request(axios, basePath)); }, /** * @@ -652,7 +508,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { - return PetApiFp(configuration).deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); + return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); }, /** * Multiple status values can be provided with comma separated strings @@ -662,7 +518,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): AxiosPromise> { - return PetApiFp(configuration).findPetsByStatus(status, options).then((request) => request(axios, basePath)); + return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); }, /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -672,7 +528,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ findPetsByTags(tags: Array, options?: any): AxiosPromise> { - return PetApiFp(configuration).findPetsByTags(tags, options).then((request) => request(axios, basePath)); + return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); }, /** * Returns a single pet @@ -682,7 +538,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ getPetById(petId: number, options?: any): AxiosPromise { - return PetApiFp(configuration).getPetById(petId, options).then((request) => request(axios, basePath)); + return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); }, /** * @@ -692,7 +548,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ updatePet(body: Pet, options?: any): AxiosPromise { - return PetApiFp(configuration).updatePet(body, options).then((request) => request(axios, basePath)); + return localVarFp.updatePet(body, options).then((request) => request(axios, basePath)); }, /** * @@ -704,7 +560,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { - return PetApiFp(configuration).updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); + return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); }, /** * @@ -716,7 +572,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): AxiosPromise { - return PetApiFp(configuration).uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); + return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); }, }; }; diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts index ca42fa29018..d9f74b95dbb 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts @@ -17,6 +17,8 @@ import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; import { Configuration } from '../../../configuration'; // Some imports not used depending on template conditions // @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../../../common'; +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../../../base'; // @ts-ignore import { Order } from '../../../model/some/levels/deep'; @@ -35,13 +37,11 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ deleteOrder: async (orderId: string, options: any = {}): Promise => { // verify required parameter 'orderId' is not null or undefined - if (orderId === null || orderId === undefined) { - throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); - } + assertParamExists('deleteOrder', 'orderId', orderId) const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -53,19 +53,12 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -78,7 +71,7 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration getInventory: async (options: any = {}): Promise => { const localVarPath = `/store/inventory`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -89,28 +82,16 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; // authentication api_key required - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey("api_key") - : await configuration.apiKey; - localVarHeaderParameter["api_key"] = localVarApiKeyValue; - } + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -123,13 +104,11 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ getOrderById: async (orderId: number, options: any = {}): Promise => { // verify required parameter 'orderId' is not null or undefined - if (orderId === null || orderId === undefined) { - throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); - } + assertParamExists('getOrderById', 'orderId', orderId) const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -141,19 +120,12 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -166,12 +138,10 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ placeOrder: async (body: Order, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling placeOrder.'); - } + assertParamExists('placeOrder', 'body', body) const localVarPath = `/store/order`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -185,26 +155,13 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -216,6 +173,7 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration * @export */ export const StoreApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = StoreApiAxiosParamCreator(configuration) return { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -225,11 +183,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deleteOrder(orderId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).deleteOrder(orderId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrder(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns a map of status codes to quantities @@ -238,11 +193,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getInventory(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).getInventory(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -252,11 +204,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getOrderById(orderId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).getOrderById(orderId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderById(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -266,11 +215,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async placeOrder(body: Order, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).placeOrder(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.placeOrder(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -280,6 +226,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @export */ export const StoreApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = StoreApiFp(configuration) return { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -289,7 +236,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ deleteOrder(orderId: string, options?: any): AxiosPromise { - return StoreApiFp(configuration).deleteOrder(orderId, options).then((request) => request(axios, basePath)); + return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); }, /** * Returns a map of status codes to quantities @@ -298,7 +245,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { - return StoreApiFp(configuration).getInventory(options).then((request) => request(axios, basePath)); + return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -308,7 +255,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getOrderById(orderId: number, options?: any): AxiosPromise { - return StoreApiFp(configuration).getOrderById(orderId, options).then((request) => request(axios, basePath)); + return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); }, /** * @@ -318,7 +265,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ placeOrder(body: Order, options?: any): AxiosPromise { - return StoreApiFp(configuration).placeOrder(body, options).then((request) => request(axios, basePath)); + return localVarFp.placeOrder(body, options).then((request) => request(axios, basePath)); }, }; }; diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts index bc264d72753..3e63c7e2f36 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts @@ -17,6 +17,8 @@ import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; import { Configuration } from '../../../configuration'; // Some imports not used depending on template conditions // @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../../../common'; +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../../../base'; // @ts-ignore import { User } from '../../../model/some/levels/deep'; @@ -35,12 +37,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUser: async (body: User, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); - } + assertParamExists('createUser', 'body', body) const localVarPath = `/user`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -54,26 +54,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -86,12 +73,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUsersWithArrayInput: async (body: Array, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); - } + assertParamExists('createUsersWithArrayInput', 'body', body) const localVarPath = `/user/createWithArray`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -105,26 +90,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -137,12 +109,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUsersWithListInput: async (body: Array, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); - } + assertParamExists('createUsersWithListInput', 'body', body) const localVarPath = `/user/createWithList`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -156,26 +126,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -188,13 +145,11 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ deleteUser: async (username: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); - } + assertParamExists('deleteUser', 'username', username) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -206,19 +161,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -231,13 +179,11 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ getUserByName: async (username: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); - } + assertParamExists('getUserByName', 'username', username) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -249,19 +195,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -275,16 +214,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ loginUser: async (username: string, password: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling loginUser.'); - } + assertParamExists('loginUser', 'username', username) // verify required parameter 'password' is not null or undefined - if (password === null || password === undefined) { - throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); - } + assertParamExists('loginUser', 'password', password) const localVarPath = `/user/login`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -304,19 +239,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -329,7 +257,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) logoutUser: async (options: any = {}): Promise => { const localVarPath = `/user/logout`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -341,19 +269,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -367,17 +288,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ updateUser: async (username: string, body: User, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling updateUser.'); - } + assertParamExists('updateUser', 'username', username) // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling updateUser.'); - } + assertParamExists('updateUser', 'body', body) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -391,26 +308,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -422,6 +326,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) * @export */ export const UserApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) return { /** * This can only be done by the logged in user. @@ -431,11 +336,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUser(body: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUser(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUser(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -445,11 +347,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUsersWithArrayInput(body: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUsersWithArrayInput(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithArrayInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -459,11 +358,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUsersWithListInput(body: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUsersWithListInput(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithListInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This can only be done by the logged in user. @@ -473,11 +369,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deleteUser(username: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).deleteUser(username, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUser(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -487,11 +380,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getUserByName(username: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserByName(username, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserByName(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -502,11 +392,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async loginUser(username: string, password: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).loginUser(username, password, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.loginUser(username, password, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -515,11 +402,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async logoutUser(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).logoutUser(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.logoutUser(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This can only be done by the logged in user. @@ -530,11 +414,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updateUser(username: string, body: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).updateUser(username, body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(username, body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -544,6 +425,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @export */ export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = UserApiFp(configuration) return { /** * This can only be done by the logged in user. @@ -553,7 +435,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUser(body: User, options?: any): AxiosPromise { - return UserApiFp(configuration).createUser(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUser(body, options).then((request) => request(axios, basePath)); }, /** * @@ -563,7 +445,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { - return UserApiFp(configuration).createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); }, /** * @@ -573,7 +455,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUsersWithListInput(body: Array, options?: any): AxiosPromise { - return UserApiFp(configuration).createUsersWithListInput(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUsersWithListInput(body, options).then((request) => request(axios, basePath)); }, /** * This can only be done by the logged in user. @@ -583,7 +465,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ deleteUser(username: string, options?: any): AxiosPromise { - return UserApiFp(configuration).deleteUser(username, options).then((request) => request(axios, basePath)); + return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); }, /** * @@ -593,7 +475,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ getUserByName(username: string, options?: any): AxiosPromise { - return UserApiFp(configuration).getUserByName(username, options).then((request) => request(axios, basePath)); + return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); }, /** * @@ -604,7 +486,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ loginUser(username: string, password: string, options?: any): AxiosPromise { - return UserApiFp(configuration).loginUser(username, password, options).then((request) => request(axios, basePath)); + return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); }, /** * @@ -613,7 +495,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ logoutUser(options?: any): AxiosPromise { - return UserApiFp(configuration).logoutUser(options).then((request) => request(axios, basePath)); + return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); }, /** * This can only be done by the logged in user. @@ -624,7 +506,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ updateUser(username: string, body: User, options?: any): AxiosPromise { - return UserApiFp(configuration).updateUser(username, body, options).then((request) => request(axios, basePath)); + return localVarFp.updateUser(username, body, options).then((request) => request(axios, basePath)); }, }; }; diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/common.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/common.ts new file mode 100644 index 00000000000..23e6a699c68 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/common.ts @@ -0,0 +1,131 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from "./configuration"; +import { RequiredError, RequestArgs } from "./base"; +import { AxiosInstance } from 'axios'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + for (const object of objects) { + for (const key in object) { + searchParams.set(key, object[key]); + } + } + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/FILES index 3a45f5700dd..534fae710fb 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/FILES @@ -3,6 +3,7 @@ README.md api.ts base.ts +common.ts configuration.ts git_push.sh index.ts diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts index 1aca2afe908..856fb0a4829 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts @@ -17,6 +17,8 @@ import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; // Some imports not used depending on template conditions // @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; /** @@ -261,12 +263,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ addPet: async (body: Pet, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); - } + assertParamExists('addPet', 'body', body) const localVarPath = `/pet`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -278,37 +278,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -322,13 +304,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ deletePet: async (petId: number, apiKey?: string, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); - } + assertParamExists('deletePet', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -340,12 +320,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (apiKey !== undefined && apiKey !== null) { localVarHeaderParameter['api_key'] = String(apiKey); @@ -353,19 +328,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -378,12 +346,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ findPetsByStatus: async (status: Array<'available' | 'pending' | 'sold'>, options: any = {}): Promise => { // verify required parameter 'status' is not null or undefined - if (status === null || status === undefined) { - throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); - } + assertParamExists('findPetsByStatus', 'status', status) const localVarPath = `/pet/findByStatus`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -395,12 +361,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (status) { localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS.csv); @@ -408,19 +369,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -433,12 +387,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ findPetsByTags: async (tags: Array, options: any = {}): Promise => { // verify required parameter 'tags' is not null or undefined - if (tags === null || tags === undefined) { - throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); - } + assertParamExists('findPetsByTags', 'tags', tags) const localVarPath = `/pet/findByTags`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -450,12 +402,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (tags) { localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS.csv); @@ -463,19 +410,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -488,13 +428,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ getPetById: async (petId: number, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); - } + assertParamExists('getPetById', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -505,28 +443,16 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; // authentication api_key required - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey("api_key") - : await configuration.apiKey; - localVarHeaderParameter["api_key"] = localVarApiKeyValue; - } + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -539,12 +465,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ updatePet: async (body: Pet, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); - } + assertParamExists('updatePet', 'body', body) const localVarPath = `/pet`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -556,37 +480,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -601,13 +507,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ updatePetWithForm: async (petId: number, name?: string, status?: string, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); - } + assertParamExists('updatePetWithForm', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -620,12 +524,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (name !== undefined) { @@ -639,20 +538,13 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams.toString(); return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -667,13 +559,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ uploadFile: async (petId: number, additionalMetadata?: string, file?: any, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); - } + assertParamExists('uploadFile', 'petId', petId) const localVarPath = `/pet/{petId}/uploadImage` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -686,12 +576,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (additionalMetadata !== undefined) { @@ -705,20 +590,13 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -730,6 +608,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) * @export */ export const PetApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = PetApiAxiosParamCreator(configuration) return { /** * @@ -739,11 +618,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async addPet(body: Pet, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).addPet(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.addPet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -754,11 +630,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deletePet(petId: number, apiKey?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).deletePet(petId, apiKey, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePet(petId, apiKey, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Multiple status values can be provided with comma separated strings @@ -768,11 +641,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).findPetsByStatus(status, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByStatus(status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -782,11 +652,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async findPetsByTags(tags: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).findPetsByTags(tags, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByTags(tags, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns a single pet @@ -796,11 +663,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getPetById(petId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).getPetById(petId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getPetById(petId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -810,11 +674,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updatePet(body: Pet, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).updatePet(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -826,11 +687,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updatePetWithForm(petId: number, name?: string, status?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).updatePetWithForm(petId, name, status, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePetWithForm(petId, name, status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -842,11 +700,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(petId, additionalMetadata, file, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -856,6 +711,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @export */ export const PetApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = PetApiFp(configuration) return { /** * @@ -865,7 +721,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ addPet(body: Pet, options?: any): AxiosPromise { - return PetApiFp(configuration).addPet(body, options).then((request) => request(axios, basePath)); + return localVarFp.addPet(body, options).then((request) => request(axios, basePath)); }, /** * @@ -876,7 +732,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { - return PetApiFp(configuration).deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); + return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); }, /** * Multiple status values can be provided with comma separated strings @@ -886,7 +742,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): AxiosPromise> { - return PetApiFp(configuration).findPetsByStatus(status, options).then((request) => request(axios, basePath)); + return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); }, /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -896,7 +752,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ findPetsByTags(tags: Array, options?: any): AxiosPromise> { - return PetApiFp(configuration).findPetsByTags(tags, options).then((request) => request(axios, basePath)); + return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); }, /** * Returns a single pet @@ -906,7 +762,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ getPetById(petId: number, options?: any): AxiosPromise { - return PetApiFp(configuration).getPetById(petId, options).then((request) => request(axios, basePath)); + return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); }, /** * @@ -916,7 +772,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ updatePet(body: Pet, options?: any): AxiosPromise { - return PetApiFp(configuration).updatePet(body, options).then((request) => request(axios, basePath)); + return localVarFp.updatePet(body, options).then((request) => request(axios, basePath)); }, /** * @@ -928,7 +784,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { - return PetApiFp(configuration).updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); + return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); }, /** * @@ -940,7 +796,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): AxiosPromise { - return PetApiFp(configuration).uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); + return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); }, }; }; @@ -1070,13 +926,11 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ deleteOrder: async (orderId: string, options: any = {}): Promise => { // verify required parameter 'orderId' is not null or undefined - if (orderId === null || orderId === undefined) { - throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); - } + assertParamExists('deleteOrder', 'orderId', orderId) const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1088,19 +942,12 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1113,7 +960,7 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration getInventory: async (options: any = {}): Promise => { const localVarPath = `/store/inventory`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1124,28 +971,16 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; // authentication api_key required - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey("api_key") - : await configuration.apiKey; - localVarHeaderParameter["api_key"] = localVarApiKeyValue; - } + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1158,13 +993,11 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ getOrderById: async (orderId: number, options: any = {}): Promise => { // verify required parameter 'orderId' is not null or undefined - if (orderId === null || orderId === undefined) { - throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); - } + assertParamExists('getOrderById', 'orderId', orderId) const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1176,19 +1009,12 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1201,12 +1027,10 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ placeOrder: async (body: Order, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling placeOrder.'); - } + assertParamExists('placeOrder', 'body', body) const localVarPath = `/store/order`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1220,26 +1044,13 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1251,6 +1062,7 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration * @export */ export const StoreApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = StoreApiAxiosParamCreator(configuration) return { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -1260,11 +1072,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deleteOrder(orderId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).deleteOrder(orderId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrder(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns a map of status codes to quantities @@ -1273,11 +1082,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getInventory(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).getInventory(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -1287,11 +1093,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getOrderById(orderId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).getOrderById(orderId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderById(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1301,11 +1104,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async placeOrder(body: Order, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).placeOrder(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.placeOrder(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -1315,6 +1115,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @export */ export const StoreApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = StoreApiFp(configuration) return { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -1324,7 +1125,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ deleteOrder(orderId: string, options?: any): AxiosPromise { - return StoreApiFp(configuration).deleteOrder(orderId, options).then((request) => request(axios, basePath)); + return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); }, /** * Returns a map of status codes to quantities @@ -1333,7 +1134,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { - return StoreApiFp(configuration).getInventory(options).then((request) => request(axios, basePath)); + return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -1343,7 +1144,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getOrderById(orderId: number, options?: any): AxiosPromise { - return StoreApiFp(configuration).getOrderById(orderId, options).then((request) => request(axios, basePath)); + return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); }, /** * @@ -1353,7 +1154,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ placeOrder(body: Order, options?: any): AxiosPromise { - return StoreApiFp(configuration).placeOrder(body, options).then((request) => request(axios, basePath)); + return localVarFp.placeOrder(body, options).then((request) => request(axios, basePath)); }, }; }; @@ -1429,12 +1230,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUser: async (body: User, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); - } + assertParamExists('createUser', 'body', body) const localVarPath = `/user`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1448,26 +1247,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1480,12 +1266,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUsersWithArrayInput: async (body: Array, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); - } + assertParamExists('createUsersWithArrayInput', 'body', body) const localVarPath = `/user/createWithArray`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1499,26 +1283,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1531,12 +1302,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUsersWithListInput: async (body: Array, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); - } + assertParamExists('createUsersWithListInput', 'body', body) const localVarPath = `/user/createWithList`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1550,26 +1319,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1582,13 +1338,11 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ deleteUser: async (username: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); - } + assertParamExists('deleteUser', 'username', username) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1600,19 +1354,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1625,13 +1372,11 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ getUserByName: async (username: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); - } + assertParamExists('getUserByName', 'username', username) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1643,19 +1388,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1669,16 +1407,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ loginUser: async (username: string, password: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling loginUser.'); - } + assertParamExists('loginUser', 'username', username) // verify required parameter 'password' is not null or undefined - if (password === null || password === undefined) { - throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); - } + assertParamExists('loginUser', 'password', password) const localVarPath = `/user/login`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1698,19 +1432,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1723,7 +1450,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) logoutUser: async (options: any = {}): Promise => { const localVarPath = `/user/logout`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1735,19 +1462,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1761,17 +1481,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ updateUser: async (username: string, body: User, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling updateUser.'); - } + assertParamExists('updateUser', 'username', username) // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling updateUser.'); - } + assertParamExists('updateUser', 'body', body) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1785,26 +1501,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1816,6 +1519,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) * @export */ export const UserApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) return { /** * This can only be done by the logged in user. @@ -1825,11 +1529,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUser(body: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUser(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUser(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1839,11 +1540,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUsersWithArrayInput(body: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUsersWithArrayInput(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithArrayInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1853,11 +1551,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUsersWithListInput(body: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUsersWithListInput(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithListInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This can only be done by the logged in user. @@ -1867,11 +1562,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deleteUser(username: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).deleteUser(username, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUser(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1881,11 +1573,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getUserByName(username: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserByName(username, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserByName(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1896,11 +1585,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async loginUser(username: string, password: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).loginUser(username, password, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.loginUser(username, password, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1909,11 +1595,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async logoutUser(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).logoutUser(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.logoutUser(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This can only be done by the logged in user. @@ -1924,11 +1607,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updateUser(username: string, body: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).updateUser(username, body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(username, body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -1938,6 +1618,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @export */ export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = UserApiFp(configuration) return { /** * This can only be done by the logged in user. @@ -1947,7 +1628,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUser(body: User, options?: any): AxiosPromise { - return UserApiFp(configuration).createUser(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUser(body, options).then((request) => request(axios, basePath)); }, /** * @@ -1957,7 +1638,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { - return UserApiFp(configuration).createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); }, /** * @@ -1967,7 +1648,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUsersWithListInput(body: Array, options?: any): AxiosPromise { - return UserApiFp(configuration).createUsersWithListInput(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUsersWithListInput(body, options).then((request) => request(axios, basePath)); }, /** * This can only be done by the logged in user. @@ -1977,7 +1658,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ deleteUser(username: string, options?: any): AxiosPromise { - return UserApiFp(configuration).deleteUser(username, options).then((request) => request(axios, basePath)); + return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); }, /** * @@ -1987,7 +1668,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ getUserByName(username: string, options?: any): AxiosPromise { - return UserApiFp(configuration).getUserByName(username, options).then((request) => request(axios, basePath)); + return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); }, /** * @@ -1998,7 +1679,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ loginUser(username: string, password: string, options?: any): AxiosPromise { - return UserApiFp(configuration).loginUser(username, password, options).then((request) => request(axios, basePath)); + return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); }, /** * @@ -2007,7 +1688,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ logoutUser(options?: any): AxiosPromise { - return UserApiFp(configuration).logoutUser(options).then((request) => request(axios, basePath)); + return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); }, /** * This can only be done by the logged in user. @@ -2018,7 +1699,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ updateUser(username: string, body: User, options?: any): AxiosPromise { - return UserApiFp(configuration).updateUser(username, body, options).then((request) => request(axios, basePath)); + return localVarFp.updateUser(username, body, options).then((request) => request(axios, basePath)); }, }; }; diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/common.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/common.ts new file mode 100644 index 00000000000..23e6a699c68 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/common.ts @@ -0,0 +1,131 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from "./configuration"; +import { RequiredError, RequestArgs } from "./base"; +import { AxiosInstance } from 'axios'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + for (const object of objects) { + for (const key in object) { + searchParams.set(key, object[key]); + } + } + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/FILES index 5bef353ae38..a80cd4f07b0 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/FILES @@ -2,6 +2,7 @@ .npmignore api.ts base.ts +common.ts configuration.ts git_push.sh index.ts diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts index 601ae3dd581..ec156334713 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts @@ -17,6 +17,8 @@ import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; // Some imports not used depending on template conditions // @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +// @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; /** @@ -261,12 +263,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ addPet: async (body: Pet, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); - } + assertParamExists('addPet', 'body', body) const localVarPath = `/pet`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -278,37 +278,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -322,13 +304,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ deletePet: async (petId: number, apiKey?: string, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); - } + assertParamExists('deletePet', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -340,12 +320,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (apiKey !== undefined && apiKey !== null) { localVarHeaderParameter['api_key'] = String(apiKey); @@ -353,19 +328,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -378,12 +346,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ findPetsByStatus: async (status: Array<'available' | 'pending' | 'sold'>, options: any = {}): Promise => { // verify required parameter 'status' is not null or undefined - if (status === null || status === undefined) { - throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); - } + assertParamExists('findPetsByStatus', 'status', status) const localVarPath = `/pet/findByStatus`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -395,12 +361,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (status) { localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS.csv); @@ -408,19 +369,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -433,12 +387,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ findPetsByTags: async (tags: Array, options: any = {}): Promise => { // verify required parameter 'tags' is not null or undefined - if (tags === null || tags === undefined) { - throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); - } + assertParamExists('findPetsByTags', 'tags', tags) const localVarPath = `/pet/findByTags`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -450,12 +402,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (tags) { localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS.csv); @@ -463,19 +410,12 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -488,13 +428,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ getPetById: async (petId: number, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); - } + assertParamExists('getPetById', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -505,28 +443,16 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; // authentication api_key required - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey("api_key") - : await configuration.apiKey; - localVarHeaderParameter["api_key"] = localVarApiKeyValue; - } + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -539,12 +465,10 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ updatePet: async (body: Pet, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); - } + assertParamExists('updatePet', 'body', body) const localVarPath = `/pet`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -556,37 +480,19 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -601,13 +507,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ updatePetWithForm: async (petId: number, name?: string, status?: string, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); - } + assertParamExists('updatePetWithForm', 'petId', petId) const localVarPath = `/pet/{petId}` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -620,12 +524,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (name !== undefined) { @@ -639,20 +538,13 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams.toString(); return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -667,13 +559,11 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) */ uploadFile: async (petId: number, additionalMetadata?: string, file?: any, options: any = {}): Promise => { // verify required parameter 'petId' is not null or undefined - if (petId === null || petId === undefined) { - throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); - } + assertParamExists('uploadFile', 'petId', petId) const localVarPath = `/pet/{petId}/uploadImage` .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -686,12 +576,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) // authentication petstore_auth required // oauth required - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; - } + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) if (additionalMetadata !== undefined) { @@ -705,20 +590,13 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = localVarFormParams; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -730,6 +608,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) * @export */ export const PetApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = PetApiAxiosParamCreator(configuration) return { /** * @@ -739,11 +618,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async addPet(body: Pet, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).addPet(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.addPet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -754,11 +630,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deletePet(petId: number, apiKey?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).deletePet(petId, apiKey, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePet(petId, apiKey, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Multiple status values can be provided with comma separated strings @@ -768,11 +641,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).findPetsByStatus(status, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByStatus(status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -782,11 +652,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async findPetsByTags(tags: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).findPetsByTags(tags, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByTags(tags, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns a single pet @@ -796,11 +663,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getPetById(petId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).getPetById(petId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getPetById(petId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -810,11 +674,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updatePet(body: Pet, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).updatePet(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -826,11 +687,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updatePetWithForm(petId: number, name?: string, status?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).updatePetWithForm(petId, name, status, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePetWithForm(petId, name, status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -842,11 +700,8 @@ export const PetApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(petId, additionalMetadata, file, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -856,6 +711,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @export */ export const PetApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = PetApiFp(configuration) return { /** * @@ -865,7 +721,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ addPet(body: Pet, options?: any): AxiosPromise { - return PetApiFp(configuration).addPet(body, options).then((request) => request(axios, basePath)); + return localVarFp.addPet(body, options).then((request) => request(axios, basePath)); }, /** * @@ -876,7 +732,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { - return PetApiFp(configuration).deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); + return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); }, /** * Multiple status values can be provided with comma separated strings @@ -886,7 +742,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): AxiosPromise> { - return PetApiFp(configuration).findPetsByStatus(status, options).then((request) => request(axios, basePath)); + return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); }, /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -896,7 +752,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ findPetsByTags(tags: Array, options?: any): AxiosPromise> { - return PetApiFp(configuration).findPetsByTags(tags, options).then((request) => request(axios, basePath)); + return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); }, /** * Returns a single pet @@ -906,7 +762,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ getPetById(petId: number, options?: any): AxiosPromise { - return PetApiFp(configuration).getPetById(petId, options).then((request) => request(axios, basePath)); + return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); }, /** * @@ -916,7 +772,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ updatePet(body: Pet, options?: any): AxiosPromise { - return PetApiFp(configuration).updatePet(body, options).then((request) => request(axios, basePath)); + return localVarFp.updatePet(body, options).then((request) => request(axios, basePath)); }, /** * @@ -928,7 +784,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { - return PetApiFp(configuration).updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); + return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); }, /** * @@ -940,7 +796,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @throws {RequiredError} */ uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): AxiosPromise { - return PetApiFp(configuration).uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); + return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); }, }; }; @@ -1212,13 +1068,11 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ deleteOrder: async (orderId: string, options: any = {}): Promise => { // verify required parameter 'orderId' is not null or undefined - if (orderId === null || orderId === undefined) { - throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); - } + assertParamExists('deleteOrder', 'orderId', orderId) const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1230,19 +1084,12 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1255,7 +1102,7 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration getInventory: async (options: any = {}): Promise => { const localVarPath = `/store/inventory`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1266,28 +1113,16 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; // authentication api_key required - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey("api_key") - : await configuration.apiKey; - localVarHeaderParameter["api_key"] = localVarApiKeyValue; - } + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1300,13 +1135,11 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration */ getOrderById: async (orderId: number, options: any = {}): Promise => { // verify required parameter 'orderId' is not null or undefined - if (orderId === null || orderId === undefined) { - throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); - } + assertParamExists('getOrderById', 'orderId', orderId) const localVarPath = `/store/order/{orderId}` .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1318,19 +1151,12 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1344,7 +1170,7 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration placeOrder: async (body?: Order, options: any = {}): Promise => { const localVarPath = `/store/order`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1358,26 +1184,13 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1389,6 +1202,7 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration * @export */ export const StoreApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = StoreApiAxiosParamCreator(configuration) return { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -1398,11 +1212,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deleteOrder(orderId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).deleteOrder(orderId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrder(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns a map of status codes to quantities @@ -1411,11 +1222,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getInventory(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).getInventory(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -1425,11 +1233,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getOrderById(orderId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).getOrderById(orderId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderById(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -1439,11 +1244,8 @@ export const StoreApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async placeOrder(body?: Order, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).placeOrder(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.placeOrder(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -1453,6 +1255,7 @@ export const StoreApiFp = function(configuration?: Configuration) { * @export */ export const StoreApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = StoreApiFp(configuration) return { /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -1462,7 +1265,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ deleteOrder(orderId: string, options?: any): AxiosPromise { - return StoreApiFp(configuration).deleteOrder(orderId, options).then((request) => request(axios, basePath)); + return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); }, /** * Returns a map of status codes to quantities @@ -1471,7 +1274,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { - return StoreApiFp(configuration).getInventory(options).then((request) => request(axios, basePath)); + return localVarFp.getInventory(options).then((request) => request(axios, basePath)); }, /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -1481,7 +1284,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ getOrderById(orderId: number, options?: any): AxiosPromise { - return StoreApiFp(configuration).getOrderById(orderId, options).then((request) => request(axios, basePath)); + return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); }, /** * @@ -1491,7 +1294,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @throws {RequiredError} */ placeOrder(body?: Order, options?: any): AxiosPromise { - return StoreApiFp(configuration).placeOrder(body, options).then((request) => request(axios, basePath)); + return localVarFp.placeOrder(body, options).then((request) => request(axios, basePath)); }, }; }; @@ -1609,12 +1412,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUser: async (body: User, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); - } + assertParamExists('createUser', 'body', body) const localVarPath = `/user`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1628,26 +1429,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1660,12 +1448,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUsersWithArrayInput: async (body: Array, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); - } + assertParamExists('createUsersWithArrayInput', 'body', body) const localVarPath = `/user/createWithArray`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1679,26 +1465,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1711,12 +1484,10 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ createUsersWithListInput: async (body: Array, options: any = {}): Promise => { // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); - } + assertParamExists('createUsersWithListInput', 'body', body) const localVarPath = `/user/createWithList`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1730,26 +1501,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1762,13 +1520,11 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ deleteUser: async (username: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); - } + assertParamExists('deleteUser', 'username', username) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1780,19 +1536,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1805,13 +1554,11 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ getUserByName: async (username: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); - } + assertParamExists('getUserByName', 'username', username) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1823,19 +1570,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1849,16 +1589,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ loginUser: async (username: string, password: string, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling loginUser.'); - } + assertParamExists('loginUser', 'username', username) // verify required parameter 'password' is not null or undefined - if (password === null || password === undefined) { - throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); - } + assertParamExists('loginUser', 'password', password) const localVarPath = `/user/login`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1878,19 +1614,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1903,7 +1632,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) logoutUser: async (options: any = {}): Promise => { const localVarPath = `/user/logout`; // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1915,19 +1644,12 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1941,17 +1663,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) */ updateUser: async (username: string, body: User, options: any = {}): Promise => { // verify required parameter 'username' is not null or undefined - if (username === null || username === undefined) { - throw new RequiredError('username','Required parameter username was null or undefined when calling updateUser.'); - } + assertParamExists('updateUser', 'username', username) // verify required parameter 'body' is not null or undefined - if (body === null || body === undefined) { - throw new RequiredError('body','Required parameter body was null or undefined when calling updateUser.'); - } + assertParamExists('updateUser', 'body', body) const localVarPath = `/user/{username}` .replace(`{${"username"}}`, encodeURIComponent(String(username))); // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; @@ -1965,26 +1683,13 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; - const queryParameters = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - queryParameters.set(key, localVarQueryParameter[key]); - } - for (const key in options.query) { - queryParameters.set(key, options.query[key]); - } - localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString(); + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const nonString = typeof body !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type']) - : nonString; - localVarRequestOptions.data = needsSerialization - ? JSON.stringify(body !== undefined ? body : {}) - : (body || ""); + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, @@ -1996,6 +1701,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) * @export */ export const UserApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) return { /** * This can only be done by the logged in user. @@ -2005,11 +1711,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUser(body: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUser(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUser(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -2019,11 +1722,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUsersWithArrayInput(body: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUsersWithArrayInput(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithArrayInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -2033,11 +1733,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async createUsersWithListInput(body: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUsersWithListInput(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithListInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This can only be done by the logged in user. @@ -2047,11 +1744,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async deleteUser(username: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).deleteUser(username, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUser(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -2061,11 +1755,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async getUserByName(username: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserByName(username, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserByName(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -2076,11 +1767,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async loginUser(username: string, password: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).loginUser(username, password, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.loginUser(username, password, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * @@ -2089,11 +1777,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async logoutUser(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).logoutUser(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.logoutUser(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This can only be done by the logged in user. @@ -2104,11 +1789,8 @@ export const UserApiFp = function(configuration?: Configuration) { * @throws {RequiredError} */ async updateUser(username: string, body: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).updateUser(username, body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...localVarAxiosArgs.options, url: (configuration?.basePath || basePath) + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; + const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(username, body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; @@ -2118,6 +1800,7 @@ export const UserApiFp = function(configuration?: Configuration) { * @export */ export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = UserApiFp(configuration) return { /** * This can only be done by the logged in user. @@ -2127,7 +1810,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUser(body: User, options?: any): AxiosPromise { - return UserApiFp(configuration).createUser(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUser(body, options).then((request) => request(axios, basePath)); }, /** * @@ -2137,7 +1820,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { - return UserApiFp(configuration).createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); }, /** * @@ -2147,7 +1830,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ createUsersWithListInput(body: Array, options?: any): AxiosPromise { - return UserApiFp(configuration).createUsersWithListInput(body, options).then((request) => request(axios, basePath)); + return localVarFp.createUsersWithListInput(body, options).then((request) => request(axios, basePath)); }, /** * This can only be done by the logged in user. @@ -2157,7 +1840,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ deleteUser(username: string, options?: any): AxiosPromise { - return UserApiFp(configuration).deleteUser(username, options).then((request) => request(axios, basePath)); + return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); }, /** * @@ -2167,7 +1850,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ getUserByName(username: string, options?: any): AxiosPromise { - return UserApiFp(configuration).getUserByName(username, options).then((request) => request(axios, basePath)); + return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); }, /** * @@ -2178,7 +1861,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ loginUser(username: string, password: string, options?: any): AxiosPromise { - return UserApiFp(configuration).loginUser(username, password, options).then((request) => request(axios, basePath)); + return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); }, /** * @@ -2187,7 +1870,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ logoutUser(options?: any): AxiosPromise { - return UserApiFp(configuration).logoutUser(options).then((request) => request(axios, basePath)); + return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); }, /** * This can only be done by the logged in user. @@ -2198,7 +1881,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ updateUser(username: string, body: User, options?: any): AxiosPromise { - return UserApiFp(configuration).updateUser(username, body, options).then((request) => request(axios, basePath)); + return localVarFp.updateUser(username, body, options).then((request) => request(axios, basePath)); }, }; }; diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/common.ts b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/common.ts new file mode 100644 index 00000000000..23e6a699c68 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/common.ts @@ -0,0 +1,131 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from "./configuration"; +import { RequiredError, RequestArgs } from "./base"; +import { AxiosInstance } from 'axios'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + for (const object of objects) { + for (const key in object) { + searchParams.set(key, object[key]); + } + } + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.gitignore b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.gitignore new file mode 100644 index 00000000000..149b5765472 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator-ignore b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/FILES new file mode 100644 index 00000000000..d51e5a9a8bc --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/FILES @@ -0,0 +1,22 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +git_push.sh +index.ts +model/apiResponse.ts +model/category.ts +model/models.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts +package.json +tsconfig.build.json +tsconfig.json +tslint.json +variables.ts diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION new file mode 100644 index 00000000000..c30f0ec2be7 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/README.md b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/README.md new file mode 100644 index 00000000000..891ce865fd8 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/README.md @@ -0,0 +1,137 @@ +## @openapitools/typescript-nestjs-petstore@1.0.0 + +### Building + +To install the required dependencies and to build the typescript sources run: +``` +npm install +npm run build +``` + +#### General usage + +In your Nestjs project: + + +``` +// without configuring providers +import { ApiModule } from '@openapitools/typescript-nestjs-petstore'; +import { HttpModule } from '@nestjs/common'; + +@Module({ + imports: [ + ApiModule, + HttpModule + ], + providers: [] +}) +export class AppModule {} +``` + +``` +// configuring providers +import { ApiModule, Configuration, ConfigurationParameters } from '@openapitools/typescript-nestjs-petstore'; + +export function apiConfigFactory (): Configuration => { + const params: ConfigurationParameters = { + // set configuration parameters here. + } + return new Configuration(params); +} + +@Module({ + imports: [ ApiModule.forRoot(apiConfigFactory) ], + declarations: [ AppComponent ], + providers: [], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + +``` +import { DefaultApi } from '@openapitools/typescript-nestjs-petstore'; + +export class AppComponent { + constructor(private apiGateway: DefaultApi) { } +} +``` + +Note: The ApiModule a dynamic module and instantiated once app wide. +This is to ensure that all services are treated as singletons. + +#### Using multiple swagger files / APIs / ApiModules +In order to use multiple `ApiModules` generated from different swagger files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: +``` +import { ApiModule } from 'my-api-path'; +import { ApiModule as OtherApiModule } from 'my-other-api-path'; +import { HttpModule } from '@nestjs/common'; + +@Module({ + imports: [ + ApiModule, + OtherApiModule, + HttpModule + ] +}) +export class AppModule { + +} +``` + + +### Set service base path +If different than the generated base path, during app bootstrap, you can provide the base path to your service. + +``` +import { BASE_PATH } from '@openapitools/typescript-nestjs-petstore'; + +bootstrap(AppComponent, [ + { provide: BASE_PATH, useValue: 'https://your-web-service.com' }, +]); +``` +or + +``` +import { BASE_PATH } from '@openapitools/typescript-nestjs-petstore'; + +@Module({ + imports: [], + declarations: [ AppComponent ], + providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ], + bootstrap: [ AppComponent ] +}) +export class AppModule {} +``` + + +#### Using @nestjs/cli +First extend your `src/environments/*.ts` files by adding the corresponding base path: + +``` +export const environment = { + production: false, + API_BASE_PATH: 'http://127.0.0.1:8080' +}; +``` + +In the src/app/app.module.ts: +``` +import { BASE_PATH } from '@openapitools/typescript-nestjs-petstore'; +import { environment } from '../environments/environment'; + +@Module({ + declarations: [ + AppComponent + ], + imports: [ ], + providers: [ + { + provide: 'BASE_PATH', + useValue: environment.API_BASE_PATH + } + ] +}) +export class AppModule { } +``` \ No newline at end of file diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api.module.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api.module.ts new file mode 100644 index 00000000000..3e56bd5c091 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api.module.ts @@ -0,0 +1,28 @@ +import { DynamicModule, HttpService, HttpModule, Module, Global } from '@nestjs/common'; +import { Configuration } from './configuration'; +import { BASE_PATH } from './variables'; + +import { PetService } from './api/pet.service'; +import { StoreService } from './api/store.service'; +import { UserService } from './api/user.service'; + +@Global +@Module({ + imports: [ HttpModule ], + exports: [ + PetServiceStoreServiceUserService + ], + providers: [ + PetServiceStoreServiceUserService + ] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): DynamicModule { + return { + module: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( httpService: HttpService) { } +} diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/api.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/api.ts new file mode 100644 index 00000000000..8e44b64083d --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/api.ts @@ -0,0 +1,7 @@ +export * from './pet.service'; +import { PetService } from './pet.service'; +export * from './store.service'; +import { StoreService } from './store.service'; +export * from './user.service'; +import { UserService } from './user.service'; +export const APIS = [PetService, StoreService, UserService]; diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts new file mode 100644 index 00000000000..554608d8f0d --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/pet.service.ts @@ -0,0 +1,478 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { HttpService, Inject, Injectable } from '@nestjs/common'; +import { AxiosResponse } from 'axios'; +import { Observable } from 'rxjs'; +import { ApiResponse } from '../model/apiResponse'; +import { Pet } from '../model/pet'; +import { Configuration } from '../configuration'; +import { COLLECTION_FORMATS } from '../variables'; + + +@Injectable() +export class PetService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new Map() + public configuration = new Configuration(); + + constructor(protected httpClient: HttpService, configuration: Configuration) { + this.configuration = configuration; + this.basePath = basePath || configuration.basePath || this.basePath; + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + return consumes.includes(form); + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public addPet(pet: Pet, ): Observable>; + public addPet(pet: Pet, ): Observable { + + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling addPet.'); + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers['Authorization'] = 'Bearer ' + accessToken; + } + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + 'application/xml' + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected != undefined) { + headers['Content-Type'] = httpContentTypeSelected; + } + + return this.httpClient.post(`${this.basePath}/pet`, + pet, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deletePet(petId: number, apiKey?: string, ): Observable>; + public deletePet(petId: number, apiKey?: string, ): Observable { + + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling deletePet.'); + } + + + let headers = this.defaultHeaders; + if (apiKey !== undefined && apiKey !== null) { + headers['api_key'] String(apiKey); + } + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers['Authorization'] = 'Bearer ' + accessToken; + } + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, ): Observable>>; + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, ): Observable { + + if (status === null || status === undefined) { + throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); + } + + let queryParameters = {}; + if (status !== undefined && status !== null) { + queryParameters['status'] status; + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers['Authorization'] = 'Bearer ' + accessToken; + } + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + 'application/xml' + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get>(`${this.basePath}/pet/findByStatus`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public findPetsByTags(tags: Array, ): Observable>>; + public findPetsByTags(tags: Array, ): Observable { + + if (tags === null || tags === undefined) { + throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); + } + + let queryParameters = {}; + if (tags !== undefined && tags !== null) { + queryParameters['tags'] tags; + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers['Authorization'] = 'Bearer ' + accessToken; + } + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + 'application/xml' + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get>(`${this.basePath}/pet/findByTags`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPetById(petId: number, ): Observable>; + public getPetById(petId: number, ): Observable { + + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling getPetById.'); + } + + let headers = this.defaultHeaders; + + // authentication (api_key) required + if (this.configuration.apiKeys["api_key"]) { + headers['api_key'] = this.configuration.apiKeys["api_key"]; + } + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + 'application/xml' + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePet(pet: Pet, ): Observable>; + public updatePet(pet: Pet, ): Observable { + + if (pet === null || pet === undefined) { + throw new Error('Required parameter pet was null or undefined when calling updatePet.'); + } + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers['Authorization'] = 'Bearer ' + accessToken; + } + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + 'application/xml' + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + 'application/xml' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected != undefined) { + headers['Content-Type'] = httpContentTypeSelected; + } + + return this.httpClient.put(`${this.basePath}/pet`, + pet, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updatePetWithForm(petId: number, name?: string, status?: string, ): Observable>; + public updatePetWithForm(petId: number, name?: string, status?: string, ): Observable { + + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + + + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers['Authorization'] = 'Bearer ' + accessToken; + } + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/x-www-form-urlencoded' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; + let useForm = false; + let convertFormParamsToString = false; + if (useForm) { + formParams = new FormData(); + } else { + // formParams = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + } + + if (name !== undefined) { + formParams.append('name', name); + } + if (status !== undefined) { + formParams.append('status', status); + } + + return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, + convertFormParamsToString ? formParams.toString() : formParams, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, ): Observable>; + public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, ): Observable { + + if (petId === null || petId === undefined) { + throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); + } + + + + let headers = this.defaultHeaders; + + // authentication (petstore_auth) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' + ? this.configuration.accessToken() + : this.configuration.accessToken; + headers['Authorization'] = 'Bearer ' + accessToken; + } + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; + let useForm = false; + let convertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + // formParams = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + } + + if (additionalMetadata !== undefined) { + formParams.append('additionalMetadata', additionalMetadata); + } + if (file !== undefined) { + formParams.append('file', file); + } + + return this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, + convertFormParamsToString ? formParams.toString() : formParams, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } +} diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts new file mode 100644 index 00000000000..2d5a23a5662 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/store.service.ts @@ -0,0 +1,194 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { HttpService, Inject, Injectable } from '@nestjs/common'; +import { AxiosResponse } from 'axios'; +import { Observable } from 'rxjs'; +import { Order } from '../model/order'; +import { Configuration } from '../configuration'; +import { COLLECTION_FORMATS } from '../variables'; + + +@Injectable() +export class StoreService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new Map() + public configuration = new Configuration(); + + constructor(protected httpClient: HttpService, configuration: Configuration) { + this.configuration = configuration; + this.basePath = basePath || configuration.basePath || this.basePath; + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + return consumes.includes(form); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteOrder(orderId: string, ): Observable>; + public deleteOrder(orderId: string, ): Observable { + + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInventory(): Observable>; + public getInventory(): Observable { + + let headers = this.defaultHeaders; + + // authentication (api_key) required + if (this.configuration.apiKeys["api_key"]) { + headers['api_key'] = this.configuration.apiKeys["api_key"]; + } + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getOrderById(orderId: number, ): Observable>; + public getOrderById(orderId: number, ): Observable { + + if (orderId === null || orderId === undefined) { + throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + 'application/xml' + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public placeOrder(order: Order, ): Observable>; + public placeOrder(order: Order, ): Observable { + + if (order === null || order === undefined) { + throw new Error('Required parameter order was null or undefined when calling placeOrder.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + 'application/xml' + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected != undefined) { + headers['Content-Type'] = httpContentTypeSelected; + } + + return this.httpClient.post(`${this.basePath}/store/order`, + order, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } +} diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/user.service.ts new file mode 100644 index 00000000000..e2d7034ec8d --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/api/user.service.ts @@ -0,0 +1,395 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { HttpService, Inject, Injectable } from '@nestjs/common'; +import { AxiosResponse } from 'axios'; +import { Observable } from 'rxjs'; +import { User } from '../model/user'; +import { Configuration } from '../configuration'; +import { COLLECTION_FORMATS } from '../variables'; + + +@Injectable() +export class UserService { + + protected basePath = 'http://petstore.swagger.io/v2'; + public defaultHeaders = new Map() + public configuration = new Configuration(); + + constructor(protected httpClient: HttpService, configuration: Configuration) { + this.configuration = configuration; + this.basePath = basePath || configuration.basePath || this.basePath; + } + + /** + * @param consumes string[] mime-types + * @return true: consumes contains 'multipart/form-data', false: otherwise + */ + private canConsumeForm(consumes: string[]): boolean { + const form = 'multipart/form-data'; + return consumes.includes(form); + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUser(user: User, ): Observable>; + public createUser(user: User, ): Observable { + + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUser.'); + } + + let headers = this.defaultHeaders; + + // authentication (api_key) required + if (this.configuration.apiKeys["api_key"]) { + headers['api_key'] = this.configuration.apiKeys["api_key"]; + } + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected != undefined) { + headers['Content-Type'] = httpContentTypeSelected; + } + + return this.httpClient.post(`${this.basePath}/user`, + user, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } + /** + * Creates list of users with given input array + * + * @param user List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithArrayInput(user: Array, ): Observable>; + public createUsersWithArrayInput(user: Array, ): Observable { + + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.'); + } + + let headers = this.defaultHeaders; + + // authentication (api_key) required + if (this.configuration.apiKeys["api_key"]) { + headers['api_key'] = this.configuration.apiKeys["api_key"]; + } + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected != undefined) { + headers['Content-Type'] = httpContentTypeSelected; + } + + return this.httpClient.post(`${this.basePath}/user/createWithArray`, + user, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } + /** + * Creates list of users with given input array + * + * @param user List of user object + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUsersWithListInput(user: Array, ): Observable>; + public createUsersWithListInput(user: Array, ): Observable { + + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.'); + } + + let headers = this.defaultHeaders; + + // authentication (api_key) required + if (this.configuration.apiKeys["api_key"]) { + headers['api_key'] = this.configuration.apiKeys["api_key"]; + } + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected != undefined) { + headers['Content-Type'] = httpContentTypeSelected; + } + + return this.httpClient.post(`${this.basePath}/user/createWithList`, + user, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteUser(username: string, ): Observable>; + public deleteUser(username: string, ): Observable { + + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling deleteUser.'); + } + + let headers = this.defaultHeaders; + + // authentication (api_key) required + if (this.configuration.apiKeys["api_key"]) { + headers['api_key'] = this.configuration.apiKeys["api_key"]; + } + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getUserByName(username: string, ): Observable>; + public getUserByName(username: string, ): Observable { + + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling getUserByName.'); + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + 'application/xml' + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public loginUser(username: string, password: string, ): Observable>; + public loginUser(username: string, password: string, ): Observable { + + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling loginUser.'); + } + + if (password === null || password === undefined) { + throw new Error('Required parameter password was null or undefined when calling loginUser.'); + } + + let queryParameters = {}; + if (username !== undefined && username !== null) { + queryParameters['username'] username; + } + if (password !== undefined && password !== null) { + queryParameters['password'] password; + } + + let headers = this.defaultHeaders; + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + 'application/xml' + 'application/json' + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.basePath}/user/login`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } + /** + * Logs out current logged in user session + * + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public logoutUser(): Observable>; + public logoutUser(): Observable { + + let headers = this.defaultHeaders; + + // authentication (api_key) required + if (this.configuration.apiKeys["api_key"]) { + headers['api_key'] = this.configuration.apiKeys["api_key"]; + } + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + ]; + + return this.httpClient.get(`${this.basePath}/user/logout`, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } + /** + * 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 + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateUser(username: string, user: User, ): Observable>; + public updateUser(username: string, user: User, ): Observable { + + if (username === null || username === undefined) { + throw new Error('Required parameter username was null or undefined when calling updateUser.'); + } + + if (user === null || user === undefined) { + throw new Error('Required parameter user was null or undefined when calling updateUser.'); + } + + let headers = this.defaultHeaders; + + // authentication (api_key) required + if (this.configuration.apiKeys["api_key"]) { + headers['api_key'] = this.configuration.apiKeys["api_key"]; + } + + // to determine the Accept header + let httpHeaderAccepts: string[] = [ + ]; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected != undefined) { + headers['Accept'] = httpHeaderAcceptSelected; + } + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected != undefined) { + headers['Content-Type'] = httpContentTypeSelected; + } + + return this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, + user, + { + withCredentials: this.configuration.withCredentials, + headers: headers + } + ); + } +} diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/configuration.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/configuration.ts new file mode 100644 index 00000000000..82e8458f39e --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/configuration.ts @@ -0,0 +1,79 @@ +export interface ConfigurationParameters { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; +} + +export class Configuration { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length == 0) { + return undefined; + } + + let type = contentTypes.find(x => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length == 0) { + return undefined; + } + + let type = accepts.find(x => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } +} diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/git_push.sh b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/git_push.sh new file mode 100644 index 00000000000..ced3be2b0c7 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/git_push.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/index.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/index.ts new file mode 100644 index 00000000000..c312b70fa3e --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/index.ts @@ -0,0 +1,5 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; \ No newline at end of file diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/apiResponse.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/apiResponse.ts new file mode 100644 index 00000000000..682ba478921 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/apiResponse.ts @@ -0,0 +1,22 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Describes the result of uploading an image resource + */ +export interface ApiResponse { + code?: number; + type?: string; + message?: string; +} + diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/category.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/category.ts new file mode 100644 index 00000000000..b988b6827a0 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/category.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A category for a pet + */ +export interface Category { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/models.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/models.ts new file mode 100644 index 00000000000..8607c5dabd0 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/models.ts @@ -0,0 +1,6 @@ +export * from './apiResponse'; +export * from './category'; +export * from './order'; +export * from './pet'; +export * from './tag'; +export * from './user'; diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/order.ts new file mode 100644 index 00000000000..a29bebe4906 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/order.ts @@ -0,0 +1,37 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * An order for a pets from the pet store + */ +export interface Order { + id?: number; + petId?: number; + quantity?: number; + shipDate?: string; + /** + * Order Status + */ + status?: Order.StatusEnum; + complete?: boolean; +} +export namespace Order { + export type StatusEnum = 'placed' | 'approved' | 'delivered'; + export const StatusEnum = { + Placed: 'placed' as StatusEnum, + Approved: 'approved' as StatusEnum, + Delivered: 'delivered' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/pet.ts new file mode 100644 index 00000000000..e0404395f91 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/pet.ts @@ -0,0 +1,39 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Category } from './category'; +import { Tag } from './tag'; + + +/** + * A pet for sale in the pet store + */ +export interface Pet { + id?: number; + category?: Category; + name: string; + photoUrls: Array; + tags?: Array; + /** + * pet status in the store + */ + status?: Pet.StatusEnum; +} +export namespace Pet { + export type StatusEnum = 'available' | 'pending' | 'sold'; + export const StatusEnum = { + Available: 'available' as StatusEnum, + Pending: 'pending' as StatusEnum, + Sold: 'sold' as StatusEnum + }; +} + + diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/tag.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/tag.ts new file mode 100644 index 00000000000..b6ff210e8df --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/tag.ts @@ -0,0 +1,21 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A tag for a pet + */ +export interface Tag { + id?: number; + name?: string; +} + diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/user.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/user.ts new file mode 100644 index 00000000000..fce51005300 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/model/user.ts @@ -0,0 +1,30 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * A User who is purchasing from the pet store + */ +export interface User { + id?: number; + username?: string; + firstName?: string; + lastName?: string; + email?: string; + password?: string; + phone?: string; + /** + * User Status + */ + userStatus?: number; +} + diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/package.json b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/package.json new file mode 100644 index 00000000000..88bcf553b28 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/package.json @@ -0,0 +1,69 @@ +{ + "name": "@openapitools/typescript-nestjs-petstore", + "version": "1.0.0", + "description": "REST client for @openapitools/typescript-nestjs-petstore", + "author": "OpenAPI Generator Contributors", + "keywords": [ + "swagger-client" + ], + "license": "Unlicense", + "scripts": { + "build": "tsc -p tsconfig.build.json", + "build:clean": "rm -rf dist/ 2> /dev/null && tsc -p tsconfig.build.json", + "format": "prettier --write \"src/**/*.ts\"", + "start": "ts-node -r tsconfig-paths/register src/main.ts", + "start:dev": "concurrently --handle-input \"wait-on dist/main.js && nodemon\" \"tsc -w -p tsconfig.build.json\" ", + "start:debug": "nodemon --config nodemon-debug.json", + "prestart:prod": "rimraf dist && npm run build", + "start:prod": "node dist/main.js", + "lint": "tslint -p tsconfig.json -c tslint.json", + "lint:fix": "tslint -p tsconfig.json -c tslint.json --fix --force", + "test": "jest", + "test:watch": "jest --watch", + "test:cov": "jest --coverage", + "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", + "test:e2e": "jest --config ./test/jest-e2e.json" + }, + "dependencies": { + "@nestjs/common": "^6.0.0", + "@nestjs/core": "^6.0.0", + "@nestjs/platform-express": "^6.0.0", + "reflect-metadata": "^0.1.13", + "rimraf": "^2.6.3", + "rxjs": "^6.5.2" + }, + "devDependencies": { + "@nestjs/testing": "~6.0.0", + "@types/express": "^4.16.0", + "@types/jest": "^24.0.15", + "@types/node": "^12.6.1", + "@types/supertest": "^2.0.8", + "concurrently": "^4.1.1", + "nodemon": "^1.19.1", + "prettier": "^1.18.2", + "supertest": "^4.0.2", + "ts-jest": "24.0.2", + "ts-node": "8.3.0", + "tsconfig-paths": "3.8.0", + "tslint": "5.18.0", + "typescript": "3.5.3", + "wait-on": "^3.2.0" + }, + "jest": { + "moduleFileExtensions": [ + "js", + "json", + "ts" + ], + "rootDir": "src", + "testRegex": ".spec.ts$", + "transform": { + "^.+\\.(t|j)s$": "ts-jest" + }, + "coverageDirectory": "../coverage", + "testEnvironment": "node" + }, + "publishConfig": { + "registry": "https://skimdb.npmjs.com/registry" + } +} diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/tsconfig.build.json b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/tsconfig.build.json new file mode 100644 index 00000000000..77f0c6a75e9 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "exclude": [ + "node_modules", + "test", + "dist", + "**/*spec.ts" + ] + } \ No newline at end of file diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/tsconfig.json b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/tsconfig.json new file mode 100644 index 00000000000..e72eb8d5276 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "declaration": true, + "removeComments": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "target": "es5", + "sourceMap": true, + "outDir": "./dist", + "baseUrl": "./", + "incremental": true + }, + "exclude": [ + "node_modules", + "dist" + ], + "filesGlob": [ + "./model/*.ts", + "./api/*.ts" + ] +} diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/tslint.json b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/tslint.json new file mode 100644 index 00000000000..5651b2f3db0 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/tslint.json @@ -0,0 +1,18 @@ +{ + "defaultSeverity": "error", + "extends": ["tslint:recommended"], + "jsRules": { + "no-unused-expression": true + }, + "rules": { + "quotemark": [true, "single"], + "member-access": [false], + "ordered-imports": [false], + "max-line-length": [true, 150], + "member-ordering": [false], + "interface-name": [false], + "arrow-parens": false, + "object-literal-sort-keys": false + }, + "rulesDirectory": [] +} diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/variables.ts b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/variables.ts new file mode 100644 index 00000000000..d52a33f70e5 --- /dev/null +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/variables.ts @@ -0,0 +1,7 @@ + +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/samples/client/test/swift5/default/.gitignore b/samples/client/test/swift5/default/.gitignore deleted file mode 100644 index 5e5d5cebcf4..00000000000 --- a/samples/client/test/swift5/default/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/test/swift5/default/.openapi-generator/FILES b/samples/client/test/swift5/default/.openapi-generator/FILES deleted file mode 100644 index 9305dc08d2c..00000000000 --- a/samples/client/test/swift5/default/.openapi-generator/FILES +++ /dev/null @@ -1,58 +0,0 @@ -.gitignore -Cartfile -Package.swift -README.md -TestClient.podspec -TestClient/Classes/OpenAPIs/APIHelper.swift -TestClient/Classes/OpenAPIs/APIs.swift -TestClient/Classes/OpenAPIs/APIs/Swift5TestAPI.swift -TestClient/Classes/OpenAPIs/CodableHelper.swift -TestClient/Classes/OpenAPIs/Configuration.swift -TestClient/Classes/OpenAPIs/Extensions.swift -TestClient/Classes/OpenAPIs/JSONDataEncoding.swift -TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift -TestClient/Classes/OpenAPIs/Models.swift -TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift -TestClient/Classes/OpenAPIs/Models/BaseCard.swift -TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift -TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift -TestClient/Classes/OpenAPIs/Models/ModelDoubleArray.swift -TestClient/Classes/OpenAPIs/Models/ModelErrorInfoArray.swift -TestClient/Classes/OpenAPIs/Models/ModelStringArray.swift -TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift -TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift -TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift -TestClient/Classes/OpenAPIs/Models/PersonCard.swift -TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift -TestClient/Classes/OpenAPIs/Models/PlaceCard.swift -TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift -TestClient/Classes/OpenAPIs/Models/SampleBase.swift -TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift -TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift -TestClient/Classes/OpenAPIs/Models/StringEnum.swift -TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift -TestClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift -TestClient/Classes/OpenAPIs/SynchronizedDictionary.swift -TestClient/Classes/OpenAPIs/URLSessionImplementations.swift -docs/AllPrimitives.md -docs/BaseCard.md -docs/ErrorInfo.md -docs/GetAllModelsResult.md -docs/ModelDoubleArray.md -docs/ModelErrorInfoArray.md -docs/ModelStringArray.md -docs/ModelWithIntAdditionalPropertiesOnly.md -docs/ModelWithPropertiesAndAdditionalProperties.md -docs/ModelWithStringAdditionalPropertiesOnly.md -docs/PersonCard.md -docs/PersonCardAllOf.md -docs/PlaceCard.md -docs/PlaceCardAllOf.md -docs/SampleBase.md -docs/SampleSubClass.md -docs/SampleSubClassAllOf.md -docs/StringEnum.md -docs/Swift5TestAPI.md -docs/VariableNameTest.md -git_push.sh -project.yml diff --git a/samples/client/test/swift5/default/.openapi-generator/VERSION b/samples/client/test/swift5/default/.openapi-generator/VERSION deleted file mode 100644 index d99e7162d01..00000000000 --- a/samples/client/test/swift5/default/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/test/swift5/default/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/samples/client/test/swift5/default/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6254..00000000000 --- a/samples/client/test/swift5/default/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/test/swift5/default/Cartfile b/samples/client/test/swift5/default/Cartfile deleted file mode 100644 index 8b137891791..00000000000 --- a/samples/client/test/swift5/default/Cartfile +++ /dev/null @@ -1 +0,0 @@ - diff --git a/samples/client/test/swift5/default/Info.plist b/samples/client/test/swift5/default/Info.plist deleted file mode 100644 index 323e5ecfc42..00000000000 --- a/samples/client/test/swift5/default/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/samples/client/test/swift5/default/Package.swift b/samples/client/test/swift5/default/Package.swift deleted file mode 100644 index 25d70eebded..00000000000 --- a/samples/client/test/swift5/default/Package.swift +++ /dev/null @@ -1,31 +0,0 @@ -// swift-tools-version:5.0 - -import PackageDescription - -let package = Package( - name: "TestClient", - platforms: [ - .iOS(.v9), - .macOS(.v10_11), - .tvOS(.v9), - .watchOS(.v3) - ], - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "TestClient", - targets: ["TestClient"]) - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "TestClient", - dependencies: [], - path: "TestClient/Classes" - ) - ] -) diff --git a/samples/client/test/swift5/default/README.md b/samples/client/test/swift5/default/README.md deleted file mode 100644 index bb57a7ddf5d..00000000000 --- a/samples/client/test/swift5/default/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# Swift5 API client for TestClient - -This is a test schema which exercises Swagger schema features for testing the swift5 language codegen module. - -## 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 -- Package version: -- Build package: org.openapitools.codegen.languages.Swift5ClientCodegen -For more information, please visit [http://www.example.com](http://www.example.com) - -## Installation - -### Carthage - -Run `carthage update` - -### CocoaPods - -Run `pod install` - -## Documentation for API Endpoints - -All URIs are relative to *http://api.example.com/basePath* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*Swift5TestAPI* | [**getAllModels**](docs/Swift5TestAPI.md#getallmodels) | **GET** /allModels | Get all of the models - - -## Documentation For Models - - - [AllPrimitives](docs/AllPrimitives.md) - - [BaseCard](docs/BaseCard.md) - - [ErrorInfo](docs/ErrorInfo.md) - - [GetAllModelsResult](docs/GetAllModelsResult.md) - - [ModelDoubleArray](docs/ModelDoubleArray.md) - - [ModelErrorInfoArray](docs/ModelErrorInfoArray.md) - - [ModelStringArray](docs/ModelStringArray.md) - - [ModelWithIntAdditionalPropertiesOnly](docs/ModelWithIntAdditionalPropertiesOnly.md) - - [ModelWithPropertiesAndAdditionalProperties](docs/ModelWithPropertiesAndAdditionalProperties.md) - - [ModelWithStringAdditionalPropertiesOnly](docs/ModelWithStringAdditionalPropertiesOnly.md) - - [PersonCard](docs/PersonCard.md) - - [PersonCardAllOf](docs/PersonCardAllOf.md) - - [PlaceCard](docs/PlaceCard.md) - - [PlaceCardAllOf](docs/PlaceCardAllOf.md) - - [SampleBase](docs/SampleBase.md) - - [SampleSubClass](docs/SampleSubClass.md) - - [SampleSubClassAllOf](docs/SampleSubClassAllOf.md) - - [StringEnum](docs/StringEnum.md) - - [VariableNameTest](docs/VariableNameTest.md) - - -## Documentation For Authorization - - All endpoints do not require authorization. - - -## Author - -jdoe@example.com - diff --git a/samples/client/test/swift5/default/TestClient.podspec b/samples/client/test/swift5/default/TestClient.podspec deleted file mode 100644 index e9d41bfad0b..00000000000 --- a/samples/client/test/swift5/default/TestClient.podspec +++ /dev/null @@ -1,14 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'TestClient' - s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.11' - s.tvos.deployment_target = '9.0' - s.watchos.deployment_target = '3.0' - s.version = '1.0' - s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0' } - s.authors = '' - s.license = 'Proprietary' - s.homepage = 'https://github.com/openapitools/openapi-generator' - s.summary = 'TestClient' - s.source_files = 'TestClient/Classes/**/*.swift' -end diff --git a/samples/client/test/swift5/default/TestClient.xcodeproj/project.pbxproj b/samples/client/test/swift5/default/TestClient.xcodeproj/project.pbxproj deleted file mode 100644 index 51cda391135..00000000000 --- a/samples/client/test/swift5/default/TestClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,433 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 51; - objects = { - -/* Begin PBXBuildFile section */ - 0061472DD11FF6D7742349C7 /* PersonCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30CDB0CB291617B59C7E29CB /* PersonCard.swift */; }; - 05AA5B59607A30F18E94292F /* ModelWithStringAdditionalPropertiesOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BFF565190B02C5B55C36C5E /* ModelWithStringAdditionalPropertiesOnly.swift */; }; - 1415101700773F07D9E14327 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F6F3F378FFC3FC0AC42268D /* APIs.swift */; }; - 19E70FF1DDE7B0282F400F45 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6AD136503821775A39AEEEA /* APIHelper.swift */; }; - 2002BB13501E9D1F5952C760 /* SampleSubClassAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6555C6E30D09EAE39142D186 /* SampleSubClassAllOf.swift */; }; - 27F628F6D077CE2DCC6CC337 /* ModelWithIntAdditionalPropertiesOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68FA5194EA643821CA1085C3 /* ModelWithIntAdditionalPropertiesOnly.swift */; }; - 3DC6743F3ECD7005940DED98 /* GetAllModelsResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACAEAEEB934E57798AED0602 /* GetAllModelsResult.swift */; }; - 3F20DE4CB1AD4F3A2ED05326 /* SampleSubClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA9C1F9551FB619240EC0F70 /* SampleSubClass.swift */; }; - 4209C8951507A706227F2A85 /* SampleBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAB9BE4C49A34C2D3AE2D4E3 /* SampleBase.swift */; }; - 493DB82F57B410C3C40CDD6B /* ModelWithPropertiesAndAdditionalProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17B59E56BC42D7F70BBC0D08 /* ModelWithPropertiesAndAdditionalProperties.swift */; }; - 4D1CD48EC9034A49C536DF05 /* BaseCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = C209BA7D3B7026133ACB6149 /* BaseCard.swift */; }; - 561FBF0BA4127AAA4B2EB66D /* AllPrimitives.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE13D018B8E8F7283534E94 /* AllPrimitives.swift */; }; - 5C7477A5CDC76B3293CBBC53 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = A140137667E350EAFDE010EA /* Models.swift */; }; - 60CBE570B8DBA382B5D4628C /* OpenISO8601DateFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = EFD27529F413FEDE10F4D1C3 /* OpenISO8601DateFormatter.swift */; }; - 61C214786C3EA609EFA4C609 /* SynchronizedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B832520FF3AFCB54E7A0EF5 /* SynchronizedDictionary.swift */; }; - 633435C240C960AFE29EEF3A /* StringEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BD76CE1B85046CF575F42B /* StringEnum.swift */; }; - 6B1961ED41DFDFDB3029BE6F /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3D0164E2EEC228143968A2D /* Extensions.swift */; }; - 74086BA23A6B245C5C9120F4 /* Swift5TestAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6967E74308DBD6384CBA5624 /* Swift5TestAPI.swift */; }; - 7C22E572E92D490CC366F0C2 /* ErrorInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A813A17AF964F26FB864212 /* ErrorInfo.swift */; }; - 7F99AF29003DAFA2AFC85FEC /* ModelDoubleArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE5A2A8F47EC101841093D2C /* ModelDoubleArray.swift */; }; - 8F02FB3DCBA785F15F6BA602 /* PlaceCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13DD01D5ABD4BE352CB6FCBF /* PlaceCard.swift */; }; - 9193BA83FEDAFA9788D03ACF /* PlaceCardAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 889ABCD292051498ACCC66E8 /* PlaceCardAllOf.swift */; }; - A4E70E34B9EABA6E7C911B37 /* ModelErrorInfoArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = C244E3993E5EAFE0E4DEF9C9 /* ModelErrorInfoArray.swift */; }; - AC78737EC4A34F22FC3D5E8C /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93BA682C97038055435A32D0 /* CodableHelper.swift */; }; - B9B6C1BCD95B3D46719F0C57 /* URLSessionImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 437CEDD9014FF755F5FCC890 /* URLSessionImplementations.swift */; }; - D43D0FC46CD094545F0284F3 /* PersonCardAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C4F016421122219AE4DCDF9 /* PersonCardAllOf.swift */; }; - E29D4269C5947A5CFCE3A810 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE6DF5346C62BDE2DAFA3B4E /* Configuration.swift */; }; - E32B8F685CB25522E611ED1D /* ModelStringArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DEC406D4B97E9127B278F6B /* ModelStringArray.swift */; }; - E5983001C8012C8986583D7B /* JSONDataEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = F28BFEFC78B58C5329B65A2A /* JSONDataEncoding.swift */; }; - FB58DEE4F76D0111D3218BDF /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042A701F1D826A4F68808DE6 /* JSONEncodingHelper.swift */; }; - FD7D9D3454F9C64656CDCB8B /* VariableNameTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C09C1DB6708AB2D8997BEE2 /* VariableNameTest.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 042A701F1D826A4F68808DE6 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; }; - 13DD01D5ABD4BE352CB6FCBF /* PlaceCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaceCard.swift; sourceTree = ""; }; - 17B59E56BC42D7F70BBC0D08 /* ModelWithPropertiesAndAdditionalProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithPropertiesAndAdditionalProperties.swift; sourceTree = ""; }; - 1A813A17AF964F26FB864212 /* ErrorInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorInfo.swift; sourceTree = ""; }; - 2C4F016421122219AE4DCDF9 /* PersonCardAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonCardAllOf.swift; sourceTree = ""; }; - 30CDB0CB291617B59C7E29CB /* PersonCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonCard.swift; sourceTree = ""; }; - 437CEDD9014FF755F5FCC890 /* URLSessionImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLSessionImplementations.swift; sourceTree = ""; }; - 4F6F3F378FFC3FC0AC42268D /* APIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; - 5DEC406D4B97E9127B278F6B /* ModelStringArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelStringArray.swift; sourceTree = ""; }; - 6555C6E30D09EAE39142D186 /* SampleSubClassAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleSubClassAllOf.swift; sourceTree = ""; }; - 68FA5194EA643821CA1085C3 /* ModelWithIntAdditionalPropertiesOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithIntAdditionalPropertiesOnly.swift; sourceTree = ""; }; - 6967E74308DBD6384CBA5624 /* Swift5TestAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Swift5TestAPI.swift; sourceTree = ""; }; - 6BFF565190B02C5B55C36C5E /* ModelWithStringAdditionalPropertiesOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithStringAdditionalPropertiesOnly.swift; sourceTree = ""; }; - 7C09C1DB6708AB2D8997BEE2 /* VariableNameTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VariableNameTest.swift; sourceTree = ""; }; - 7EE13D018B8E8F7283534E94 /* AllPrimitives.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllPrimitives.swift; sourceTree = ""; }; - 889ABCD292051498ACCC66E8 /* PlaceCardAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaceCardAllOf.swift; sourceTree = ""; }; - 8B832520FF3AFCB54E7A0EF5 /* SynchronizedDictionary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SynchronizedDictionary.swift; sourceTree = ""; }; - 93BA682C97038055435A32D0 /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; }; - 9FD147676BF8F2DD7E471810 /* TestClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TestClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A140137667E350EAFDE010EA /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; - A3BD76CE1B85046CF575F42B /* StringEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringEnum.swift; sourceTree = ""; }; - ACAEAEEB934E57798AED0602 /* GetAllModelsResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetAllModelsResult.swift; sourceTree = ""; }; - C209BA7D3B7026133ACB6149 /* BaseCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseCard.swift; sourceTree = ""; }; - C244E3993E5EAFE0E4DEF9C9 /* ModelErrorInfoArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelErrorInfoArray.swift; sourceTree = ""; }; - C6AD136503821775A39AEEEA /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; - CAB9BE4C49A34C2D3AE2D4E3 /* SampleBase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleBase.swift; sourceTree = ""; }; - CE6DF5346C62BDE2DAFA3B4E /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; - D3D0164E2EEC228143968A2D /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; - EA9C1F9551FB619240EC0F70 /* SampleSubClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleSubClass.swift; sourceTree = ""; }; - EE5A2A8F47EC101841093D2C /* ModelDoubleArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelDoubleArray.swift; sourceTree = ""; }; - EFD27529F413FEDE10F4D1C3 /* OpenISO8601DateFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenISO8601DateFormatter.swift; sourceTree = ""; }; - F28BFEFC78B58C5329B65A2A /* JSONDataEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONDataEncoding.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXGroup section */ - 3049D31996790CF8E31B6F01 = { - isa = PBXGroup; - children = ( - 8C649F3AF4A7C6D66B52AA38 /* TestClient */, - CBA5AD47CD6A6AF075403DD1 /* Products */, - ); - sourceTree = ""; - }; - 3A1CFAB4CC75547815260F88 /* OpenAPIs */ = { - isa = PBXGroup; - children = ( - C6AD136503821775A39AEEEA /* APIHelper.swift */, - 4F6F3F378FFC3FC0AC42268D /* APIs.swift */, - 93BA682C97038055435A32D0 /* CodableHelper.swift */, - CE6DF5346C62BDE2DAFA3B4E /* Configuration.swift */, - D3D0164E2EEC228143968A2D /* Extensions.swift */, - F28BFEFC78B58C5329B65A2A /* JSONDataEncoding.swift */, - 042A701F1D826A4F68808DE6 /* JSONEncodingHelper.swift */, - A140137667E350EAFDE010EA /* Models.swift */, - EFD27529F413FEDE10F4D1C3 /* OpenISO8601DateFormatter.swift */, - 8B832520FF3AFCB54E7A0EF5 /* SynchronizedDictionary.swift */, - 437CEDD9014FF755F5FCC890 /* URLSessionImplementations.swift */, - AC6589BAFE1BDABB49267C33 /* APIs */, - 9A5460679035417A84B6C884 /* Models */, - ); - path = OpenAPIs; - sourceTree = ""; - }; - 3E4B2B40F4EEE4F7E6149EBF /* Classes */ = { - isa = PBXGroup; - children = ( - 3A1CFAB4CC75547815260F88 /* OpenAPIs */, - ); - path = Classes; - sourceTree = ""; - }; - 8C649F3AF4A7C6D66B52AA38 /* TestClient */ = { - isa = PBXGroup; - children = ( - 3E4B2B40F4EEE4F7E6149EBF /* Classes */, - ); - path = TestClient; - sourceTree = ""; - }; - 9A5460679035417A84B6C884 /* Models */ = { - isa = PBXGroup; - children = ( - 7EE13D018B8E8F7283534E94 /* AllPrimitives.swift */, - C209BA7D3B7026133ACB6149 /* BaseCard.swift */, - 1A813A17AF964F26FB864212 /* ErrorInfo.swift */, - ACAEAEEB934E57798AED0602 /* GetAllModelsResult.swift */, - EE5A2A8F47EC101841093D2C /* ModelDoubleArray.swift */, - C244E3993E5EAFE0E4DEF9C9 /* ModelErrorInfoArray.swift */, - 5DEC406D4B97E9127B278F6B /* ModelStringArray.swift */, - 68FA5194EA643821CA1085C3 /* ModelWithIntAdditionalPropertiesOnly.swift */, - 17B59E56BC42D7F70BBC0D08 /* ModelWithPropertiesAndAdditionalProperties.swift */, - 6BFF565190B02C5B55C36C5E /* ModelWithStringAdditionalPropertiesOnly.swift */, - 30CDB0CB291617B59C7E29CB /* PersonCard.swift */, - 2C4F016421122219AE4DCDF9 /* PersonCardAllOf.swift */, - 13DD01D5ABD4BE352CB6FCBF /* PlaceCard.swift */, - 889ABCD292051498ACCC66E8 /* PlaceCardAllOf.swift */, - CAB9BE4C49A34C2D3AE2D4E3 /* SampleBase.swift */, - EA9C1F9551FB619240EC0F70 /* SampleSubClass.swift */, - 6555C6E30D09EAE39142D186 /* SampleSubClassAllOf.swift */, - A3BD76CE1B85046CF575F42B /* StringEnum.swift */, - 7C09C1DB6708AB2D8997BEE2 /* VariableNameTest.swift */, - ); - path = Models; - sourceTree = ""; - }; - AC6589BAFE1BDABB49267C33 /* APIs */ = { - isa = PBXGroup; - children = ( - 6967E74308DBD6384CBA5624 /* Swift5TestAPI.swift */, - ); - path = APIs; - sourceTree = ""; - }; - CBA5AD47CD6A6AF075403DD1 /* Products */ = { - isa = PBXGroup; - children = ( - 9FD147676BF8F2DD7E471810 /* TestClient.framework */, - ); - name = Products; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 57071453919863518A53B6C4 /* TestClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = 8C5DAAB4D2F2BC3EB2A18339 /* Build configuration list for PBXNativeTarget "TestClient" */; - buildPhases = ( - 411C0E7C892A386592910621 /* Sources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = TestClient; - productName = TestClient; - productReference = 9FD147676BF8F2DD7E471810 /* TestClient.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 498565B44CD0696E30C61F1F /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1020; - TargetAttributes = { - }; - }; - buildConfigurationList = 87FDCE50021B77EB5CF8EF08 /* Build configuration list for PBXProject "TestClient" */; - compatibilityVersion = "Xcode 10.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 3049D31996790CF8E31B6F01; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 57071453919863518A53B6C4 /* TestClient */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 411C0E7C892A386592910621 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 19E70FF1DDE7B0282F400F45 /* APIHelper.swift in Sources */, - 1415101700773F07D9E14327 /* APIs.swift in Sources */, - 561FBF0BA4127AAA4B2EB66D /* AllPrimitives.swift in Sources */, - 4D1CD48EC9034A49C536DF05 /* BaseCard.swift in Sources */, - AC78737EC4A34F22FC3D5E8C /* CodableHelper.swift in Sources */, - E29D4269C5947A5CFCE3A810 /* Configuration.swift in Sources */, - 7C22E572E92D490CC366F0C2 /* ErrorInfo.swift in Sources */, - 6B1961ED41DFDFDB3029BE6F /* Extensions.swift in Sources */, - 3DC6743F3ECD7005940DED98 /* GetAllModelsResult.swift in Sources */, - E5983001C8012C8986583D7B /* JSONDataEncoding.swift in Sources */, - FB58DEE4F76D0111D3218BDF /* JSONEncodingHelper.swift in Sources */, - 7F99AF29003DAFA2AFC85FEC /* ModelDoubleArray.swift in Sources */, - A4E70E34B9EABA6E7C911B37 /* ModelErrorInfoArray.swift in Sources */, - E32B8F685CB25522E611ED1D /* ModelStringArray.swift in Sources */, - 27F628F6D077CE2DCC6CC337 /* ModelWithIntAdditionalPropertiesOnly.swift in Sources */, - 493DB82F57B410C3C40CDD6B /* ModelWithPropertiesAndAdditionalProperties.swift in Sources */, - 05AA5B59607A30F18E94292F /* ModelWithStringAdditionalPropertiesOnly.swift in Sources */, - 5C7477A5CDC76B3293CBBC53 /* Models.swift in Sources */, - 60CBE570B8DBA382B5D4628C /* OpenISO8601DateFormatter.swift in Sources */, - 0061472DD11FF6D7742349C7 /* PersonCard.swift in Sources */, - D43D0FC46CD094545F0284F3 /* PersonCardAllOf.swift in Sources */, - 8F02FB3DCBA785F15F6BA602 /* PlaceCard.swift in Sources */, - 9193BA83FEDAFA9788D03ACF /* PlaceCardAllOf.swift in Sources */, - 4209C8951507A706227F2A85 /* SampleBase.swift in Sources */, - 3F20DE4CB1AD4F3A2ED05326 /* SampleSubClass.swift in Sources */, - 2002BB13501E9D1F5952C760 /* SampleSubClassAllOf.swift in Sources */, - 633435C240C960AFE29EEF3A /* StringEnum.swift in Sources */, - 74086BA23A6B245C5C9120F4 /* Swift5TestAPI.swift in Sources */, - 61C214786C3EA609EFA4C609 /* SynchronizedDictionary.swift in Sources */, - B9B6C1BCD95B3D46719F0C57 /* URLSessionImplementations.swift in Sources */, - FD7D9D3454F9C64656CDCB8B /* VariableNameTest.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1D58A58AE8D976D68029505F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 20BF9E8F2FA4569489A9CEAC /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "DEBUG=1", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - 295215B264B439F2CFBEFBA2 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_VERSION = 5.0; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 4CDAC84BFAB424A21776ADCA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 87FDCE50021B77EB5CF8EF08 /* Build configuration list for PBXProject "TestClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 20BF9E8F2FA4569489A9CEAC /* Debug */, - 295215B264B439F2CFBEFBA2 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; - 8C5DAAB4D2F2BC3EB2A18339 /* Build configuration list for PBXNativeTarget "TestClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1D58A58AE8D976D68029505F /* Debug */, - 4CDAC84BFAB424A21776ADCA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; -/* End XCConfigurationList section */ - }; - rootObject = 498565B44CD0696E30C61F1F /* Project object */; -} diff --git a/samples/client/test/swift5/default/TestClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/test/swift5/default/TestClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 37b1c0c5bb4..00000000000 --- a/samples/client/test/swift5/default/TestClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/test/swift5/default/TestClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/samples/client/test/swift5/default/TestClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d6..00000000000 --- a/samples/client/test/swift5/default/TestClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/samples/client/test/swift5/default/TestClient.xcodeproj/xcshareddata/xcschemes/TestClient.xcscheme b/samples/client/test/swift5/default/TestClient.xcodeproj/xcshareddata/xcschemes/TestClient.xcscheme deleted file mode 100644 index 8011cf09204..00000000000 --- a/samples/client/test/swift5/default/TestClient.xcodeproj/xcshareddata/xcschemes/TestClient.xcscheme +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIHelper.swift deleted file mode 100644 index 5b09f955711..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIHelper.swift +++ /dev/null @@ -1,71 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { - let destination = source.reduce(into: [String: Any]()) { (result, item) in - if let value = item.value { - result[item.key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { - return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") - } else if let value: Any = item.value { - result[item.key] = "\(value)" - } - } - } - - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: Any](), { (result, item) in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - }) - } - - public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { - return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - } - return source - } - - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { - let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { - collection.filter({ $0 != nil }).map({"\($0!)"}).forEach { value in - result.append(URLQueryItem(name: item.key, value: value)) - } - } else if let value = item.value { - result.append(URLQueryItem(name: item.key, value: "\(value)")) - } - } - - if destination.isEmpty { - return nil - } - return destination - } -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs.swift deleted file mode 100644 index d2c1afbb9bc..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs.swift +++ /dev/null @@ -1,64 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class TestClientAPI { - public static var basePath = "http://api.example.com/basePath" - public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] - public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() - public static var apiResponseQueue: DispatchQueue = .main -} - -open class RequestBuilder { - var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? - public let isBody: Bool - public let method: String - public let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. - /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders(TestClientAPI.customHeaders) - } - - open func addHeaders(_ aHeaders: [String: String]) { - for (header, value) in aHeaders { - headers[header] = value - } - } - - open func execute(_ apiResponseQueue: DispatchQueue = TestClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { } - - public func addHeader(name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - open func addCredential() -> Self { - self.credential = TestClientAPI.credential - return self - } -} - -public protocol RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs/Swift5TestAPI.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs/Swift5TestAPI.swift deleted file mode 100644 index 6987b61a1a4..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/APIs/Swift5TestAPI.swift +++ /dev/null @@ -1,51 +0,0 @@ -// -// Swift5TestAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class Swift5TestAPI { - /** - Get all of the models - - - parameter clientId: (query) id that represent the Api client - - parameter apiResponseQueue: The queue on which api response is dispatched. - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getAllModels(clientId: String, apiResponseQueue: DispatchQueue = TestClientAPI.apiResponseQueue, completion: @escaping ((_ data: GetAllModelsResult?, _ error: Error?) -> Void)) { - getAllModelsWithRequestBuilder(clientId: clientId).execute(apiResponseQueue) { result -> Void in - switch result { - case let .success(response): - completion(response.body, nil) - case let .failure(error): - completion(nil, error) - } - } - } - - /** - Get all of the models - - GET /allModels - - This endpoint tests get a dictionary which contains examples of all of the models. - - parameter clientId: (query) id that represent the Api client - - returns: RequestBuilder - */ - open class func getAllModelsWithRequestBuilder(clientId: String) -> RequestBuilder { - let path = "/allModels" - let URLString = TestClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "client_id": clientId.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder.Type = TestClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/CodableHelper.swift deleted file mode 100644 index ef971ebadc6..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/CodableHelper.swift +++ /dev/null @@ -1,48 +0,0 @@ -// -// CodableHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class CodableHelper { - - private static var customDateFormatter: DateFormatter? - private static var defaultDateFormatter: DateFormatter = OpenISO8601DateFormatter() - private static var customJSONDecoder: JSONDecoder? - private static var defaultJSONDecoder: JSONDecoder = { - let decoder = JSONDecoder() - decoder.dateDecodingStrategy = .formatted(CodableHelper.dateFormatter) - return decoder - }() - private static var customJSONEncoder: JSONEncoder? - private static var defaultJSONEncoder: JSONEncoder = { - let encoder = JSONEncoder() - encoder.dateEncodingStrategy = .formatted(CodableHelper.dateFormatter) - encoder.outputFormatting = .prettyPrinted - return encoder - }() - - public static var dateFormatter: DateFormatter { - get { return self.customDateFormatter ?? self.defaultDateFormatter } - set { self.customDateFormatter = newValue } - } - public static var jsonDecoder: JSONDecoder { - get { return self.customJSONDecoder ?? self.defaultJSONDecoder } - set { self.customJSONDecoder = newValue } - } - public static var jsonEncoder: JSONEncoder { - get { return self.customJSONEncoder ?? self.defaultJSONEncoder } - set { self.customJSONEncoder = newValue } - } - - open class func decode(_ type: T.Type, from data: Data) -> Swift.Result where T: Decodable { - return Swift.Result { try self.jsonDecoder.decode(type, from: data) } - } - - open class func encode(_ value: T) -> Swift.Result where T: Encodable { - return Swift.Result { try self.jsonEncoder.encode(value) } - } -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Configuration.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Configuration.swift deleted file mode 100644 index 627d9adb757..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Configuration.swift +++ /dev/null @@ -1,16 +0,0 @@ -// Configuration.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class Configuration { - - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Extensions.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Extensions.swift deleted file mode 100644 index 93ed6b90b37..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Extensions.swift +++ /dev/null @@ -1,179 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } -} - -private func encodeIfPossible(_ object: T) -> Any { - if let encodableObject = object as? JSONEncodable { - return encodableObject.encodeToJSON() - } else { - return object as Any - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> Any { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> Any { - var dictionary = [AnyHashable: Any]() - for (key, value) in self { - dictionary[key] = encodeIfPossible(value) - } - return dictionary as Any - } -} - -extension Data: JSONEncodable { - func encodeToJSON() -> Any { - return self.base64EncodedString(options: Data.Base64EncodingOptions()) - } -} - -extension Date: JSONEncodable { - func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any - } -} - -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} - -extension HTTPURLResponse { - var isStatusCodeSuccessful: Bool { - return Array(200 ..< 300).contains(statusCode) - } -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONDataEncoding.swift deleted file mode 100644 index b79e9f5e64d..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ /dev/null @@ -1,53 +0,0 @@ -// -// JSONDataEncoding.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct JSONDataEncoding { - - // MARK: Properties - - private static let jsonDataKey = "jsonData" - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. This should have a single key/value - /// pair with "jsonData" as the key and a Data object as the value. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) -> URLRequest { - var urlRequest = urlRequest - - guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { - return urlRequest - } - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = jsonData - - return urlRequest - } - - public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? - if let jsonData = jsonData, !jsonData.isEmpty { - var params: [String: Any] = [:] - params[jsonDataKey] = jsonData - returnedParams = params - } - return returnedParams - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift deleted file mode 100644 index 02f78ffb470..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// JSONEncodingHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class JSONEncodingHelper { - - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? - - // Encode the Encodable object - if let encodableObj = encodableObj { - let encodeResult = CodableHelper.encode(encodableObj) - do { - let data = try encodeResult.get() - params = JSONDataEncoding.encodingParameters(jsonData: data) - } catch { - print(error.localizedDescription) - } - } - - return params - } - - open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? - - if let encodableObj = encodableObj { - do { - let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) - params = JSONDataEncoding.encodingParameters(jsonData: data) - } catch { - print(error.localizedDescription) - return nil - } - } - - return params - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models.swift deleted file mode 100644 index c0542c14c08..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models.swift +++ /dev/null @@ -1,54 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> Any -} - -public enum ErrorResponse: Error { - case error(Int, Data?, Error) -} - -public enum DownloadException: Error { - case responseDataMissing - case responseFailed - case requestMissing - case requestMissingPath - case requestMissingURL -} - -public enum DecodableRequestBuilderError: Error { - case emptyDataResponse - case nilHTTPResponse - case unsuccessfulHTTPStatusCode - case jsonDecoding(DecodingError) - case generalError(Error) -} - -open class Response { - public let statusCode: Int - public let header: [String: String] - public let body: T? - - public init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - public convenience init(response: HTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String: String]() - for (key, value) in rawHeader { - if let key = key.base as? String, let value = value as? String { - header[key] = value - } - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift deleted file mode 100644 index dc6571db3e9..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift +++ /dev/null @@ -1,72 +0,0 @@ -// -// AllPrimitives.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Object which contains lots of different primitive OpenAPI types */ -public struct AllPrimitives: Codable { - - public enum MyInlineStringEnum: String, Codable, CaseIterable { - case inlinestringenumvalue1 = "inlineStringEnumValue1" - case inlinestringenumvalue2 = "inlineStringEnumValue2" - case inlinestringenumvalue3 = "inlineStringEnumValue3" - } - public var myInteger: Int? - public var myIntegerArray: [Int]? - public var myLong: Int64? - public var myLongArray: [Int64]? - public var myFloat: Float? - public var myFloatArray: [Float]? - public var myDouble: Double? - public var myDoubleArray: [Double]? - public var myString: String? - public var myStringArray: [String]? - public var myBytes: Data? - public var myBytesArray: [Data]? - public var myBoolean: Bool? - public var myBooleanArray: [Bool]? - public var myDate: Date? - public var myDateArray: [Date]? - public var myDateTime: Date? - public var myDateTimeArray: [Date]? - public var myFile: URL? - public var myFileArray: [URL]? - public var myUUID: UUID? - public var myUUIDArray: [UUID]? - public var myStringEnum: StringEnum? - public var myStringEnumArray: [StringEnum]? - public var myInlineStringEnum: MyInlineStringEnum? - - public init(myInteger: Int?, myIntegerArray: [Int]?, myLong: Int64?, myLongArray: [Int64]?, myFloat: Float?, myFloatArray: [Float]?, myDouble: Double?, myDoubleArray: [Double]?, myString: String?, myStringArray: [String]?, myBytes: Data?, myBytesArray: [Data]?, myBoolean: Bool?, myBooleanArray: [Bool]?, myDate: Date?, myDateArray: [Date]?, myDateTime: Date?, myDateTimeArray: [Date]?, myFile: URL?, myFileArray: [URL]?, myUUID: UUID?, myUUIDArray: [UUID]?, myStringEnum: StringEnum?, myStringEnumArray: [StringEnum]?, myInlineStringEnum: MyInlineStringEnum?) { - self.myInteger = myInteger - self.myIntegerArray = myIntegerArray - self.myLong = myLong - self.myLongArray = myLongArray - self.myFloat = myFloat - self.myFloatArray = myFloatArray - self.myDouble = myDouble - self.myDoubleArray = myDoubleArray - self.myString = myString - self.myStringArray = myStringArray - self.myBytes = myBytes - self.myBytesArray = myBytesArray - self.myBoolean = myBoolean - self.myBooleanArray = myBooleanArray - self.myDate = myDate - self.myDateArray = myDateArray - self.myDateTime = myDateTime - self.myDateTimeArray = myDateTimeArray - self.myFile = myFile - self.myFileArray = myFileArray - self.myUUID = myUUID - self.myUUIDArray = myUUIDArray - self.myStringEnum = myStringEnum - self.myStringEnumArray = myStringEnumArray - self.myInlineStringEnum = myInlineStringEnum - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift deleted file mode 100644 index 2ffb3a5e1ab..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// BaseCard.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This is a base card object which uses a 'cardType' discriminator. */ -public struct BaseCard: Codable { - - public var cardType: String - - public init(cardType: String) { - self.cardType = cardType - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift deleted file mode 100644 index c2b1fcda586..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// ErrorInfo.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Example Error object */ -public struct ErrorInfo: Codable { - - public var code: Int? - public var message: String? - public var details: [String]? - - public init(code: Int?, message: String?, details: [String]?) { - self.code = code - self.message = message - self.details = details - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift deleted file mode 100644 index b8cfedbe94a..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// GetAllModelsResult.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Response object containing AllPrimitives object */ -public struct GetAllModelsResult: Codable { - - public var myPrimitiveArray: [AllPrimitives]? - public var myPrimitive: AllPrimitives? - public var myVariableNameTest: VariableNameTest? - - public init(myPrimitiveArray: [AllPrimitives]?, myPrimitive: AllPrimitives?, myVariableNameTest: VariableNameTest?) { - self.myPrimitiveArray = myPrimitiveArray - self.myPrimitive = myPrimitive - self.myVariableNameTest = myVariableNameTest - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelDoubleArray.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelDoubleArray.swift deleted file mode 100644 index 9e523219a44..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelDoubleArray.swift +++ /dev/null @@ -1,11 +0,0 @@ -// -// ModelDoubleArray.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This defines an array of doubles. */ -public typealias ModelDoubleArray = [Double] diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelErrorInfoArray.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelErrorInfoArray.swift deleted file mode 100644 index 358c83dc7a9..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelErrorInfoArray.swift +++ /dev/null @@ -1,11 +0,0 @@ -// -// ModelErrorInfoArray.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This defines an array of ErrorInfo objects. */ -public typealias ModelErrorInfoArray = [ErrorInfo] diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelStringArray.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelStringArray.swift deleted file mode 100644 index 6a614cc3601..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelStringArray.swift +++ /dev/null @@ -1,11 +0,0 @@ -// -// ModelStringArray.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This defines an array of strings. */ -public typealias ModelStringArray = [String] diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift deleted file mode 100644 index 2878543406a..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// ModelWithIntAdditionalPropertiesOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This is an empty model with no properties and only additionalProperties of type int32 */ -public struct ModelWithIntAdditionalPropertiesOnly: Codable { - - public var additionalProperties: [String: Int] = [:] - - public subscript(key: String) -> Int? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - - var container = encoder.container(keyedBy: String.self) - - try container.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set() - additionalProperties = try container.decodeMap(Int.self, excludedKeys: nonAdditionalPropertyKeys) - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift deleted file mode 100644 index d8f115cb499..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift +++ /dev/null @@ -1,89 +0,0 @@ -// -// ModelWithPropertiesAndAdditionalProperties.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This is an empty model with no properties and only additionalProperties of type int32 */ -public struct ModelWithPropertiesAndAdditionalProperties: Codable { - - public var myIntegerReq: Int - public var myIntegerOpt: Int? - public var myPrimitiveReq: AllPrimitives - public var myPrimitiveOpt: AllPrimitives? - public var myStringArrayReq: [String] - public var myStringArrayOpt: [String]? - public var myPrimitiveArrayReq: [AllPrimitives] - public var myPrimitiveArrayOpt: [AllPrimitives]? - - public init(myIntegerReq: Int, myIntegerOpt: Int?, myPrimitiveReq: AllPrimitives, myPrimitiveOpt: AllPrimitives?, myStringArrayReq: [String], myStringArrayOpt: [String]?, myPrimitiveArrayReq: [AllPrimitives], myPrimitiveArrayOpt: [AllPrimitives]?) { - self.myIntegerReq = myIntegerReq - self.myIntegerOpt = myIntegerOpt - self.myPrimitiveReq = myPrimitiveReq - self.myPrimitiveOpt = myPrimitiveOpt - self.myStringArrayReq = myStringArrayReq - self.myStringArrayOpt = myStringArrayOpt - self.myPrimitiveArrayReq = myPrimitiveArrayReq - self.myPrimitiveArrayOpt = myPrimitiveArrayOpt - } - public var additionalProperties: [String: String] = [:] - - public subscript(key: String) -> String? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - - var container = encoder.container(keyedBy: String.self) - - try container.encode(myIntegerReq, forKey: "myIntegerReq") - try container.encodeIfPresent(myIntegerOpt, forKey: "myIntegerOpt") - try container.encode(myPrimitiveReq, forKey: "myPrimitiveReq") - try container.encodeIfPresent(myPrimitiveOpt, forKey: "myPrimitiveOpt") - try container.encode(myStringArrayReq, forKey: "myStringArrayReq") - try container.encodeIfPresent(myStringArrayOpt, forKey: "myStringArrayOpt") - try container.encode(myPrimitiveArrayReq, forKey: "myPrimitiveArrayReq") - try container.encodeIfPresent(myPrimitiveArrayOpt, forKey: "myPrimitiveArrayOpt") - try container.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - myIntegerReq = try container.decode(Int.self, forKey: "myIntegerReq") - myIntegerOpt = try container.decodeIfPresent(Int.self, forKey: "myIntegerOpt") - myPrimitiveReq = try container.decode(AllPrimitives.self, forKey: "myPrimitiveReq") - myPrimitiveOpt = try container.decodeIfPresent(AllPrimitives.self, forKey: "myPrimitiveOpt") - myStringArrayReq = try container.decode([String].self, forKey: "myStringArrayReq") - myStringArrayOpt = try container.decodeIfPresent([String].self, forKey: "myStringArrayOpt") - myPrimitiveArrayReq = try container.decode([AllPrimitives].self, forKey: "myPrimitiveArrayReq") - myPrimitiveArrayOpt = try container.decodeIfPresent([AllPrimitives].self, forKey: "myPrimitiveArrayOpt") - var nonAdditionalPropertyKeys = Set() - nonAdditionalPropertyKeys.insert("myIntegerReq") - nonAdditionalPropertyKeys.insert("myIntegerOpt") - nonAdditionalPropertyKeys.insert("myPrimitiveReq") - nonAdditionalPropertyKeys.insert("myPrimitiveOpt") - nonAdditionalPropertyKeys.insert("myStringArrayReq") - nonAdditionalPropertyKeys.insert("myStringArrayOpt") - nonAdditionalPropertyKeys.insert("myPrimitiveArrayReq") - nonAdditionalPropertyKeys.insert("myPrimitiveArrayOpt") - additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift deleted file mode 100644 index fffed888531..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// ModelWithStringAdditionalPropertiesOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This is an empty model with no properties and only additionalProperties of type string */ -public struct ModelWithStringAdditionalPropertiesOnly: Codable { - - public var additionalProperties: [String: String] = [:] - - public subscript(key: String) -> String? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - - var container = encoder.container(keyedBy: String.self) - - try container.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set() - additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift deleted file mode 100644 index db1a081b275..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// PersonCard.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This is a card object for a Person derived from BaseCard. */ -public struct PersonCard: Codable { - - public var cardType: String - public var firstName: String? - public var lastName: String? - - public init(cardType: String, firstName: String?, lastName: String?) { - self.cardType = cardType - self.firstName = firstName - self.lastName = lastName - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift deleted file mode 100644 index e11d38985a2..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// PersonCardAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct PersonCardAllOf: Codable { - - public var firstName: String? - public var lastName: String? - - public init(firstName: String?, lastName: String?) { - self.firstName = firstName - self.lastName = lastName - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift deleted file mode 100644 index 0fd94cf8364..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// PlaceCard.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This is a card object for a Person derived from BaseCard. */ -public struct PlaceCard: Codable { - - public var cardType: String - public var placeName: String? - public var placeAddress: String? - - public init(cardType: String, placeName: String?, placeAddress: String?) { - self.cardType = cardType - self.placeName = placeName - self.placeAddress = placeAddress - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift deleted file mode 100644 index c5e89a15e00..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// PlaceCardAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct PlaceCardAllOf: Codable { - - public var placeName: String? - public var placeAddress: String? - - public init(placeName: String?, placeAddress: String?) { - self.placeName = placeName - self.placeAddress = placeAddress - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift deleted file mode 100644 index 7d884d88e18..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// SampleBase.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This is a base class object from which other classes will derive. */ -public struct SampleBase: Codable { - - public var baseClassStringProp: String? - public var baseClassIntegerProp: Int? - - public init(baseClassStringProp: String?, baseClassIntegerProp: Int?) { - self.baseClassStringProp = baseClassStringProp - self.baseClassIntegerProp = baseClassIntegerProp - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift deleted file mode 100644 index c6ffc74a959..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// SampleSubClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This is a subclass defived from the SampleBase class. */ -public struct SampleSubClass: Codable { - - public var baseClassStringProp: String? - public var baseClassIntegerProp: Int? - public var subClassStringProp: String? - public var subClassIntegerProp: Int? - - public init(baseClassStringProp: String?, baseClassIntegerProp: Int?, subClassStringProp: String?, subClassIntegerProp: Int?) { - self.baseClassStringProp = baseClassStringProp - self.baseClassIntegerProp = baseClassIntegerProp - self.subClassStringProp = subClassStringProp - self.subClassIntegerProp = subClassIntegerProp - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift deleted file mode 100644 index 7f52bb9fef4..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// SampleSubClassAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct SampleSubClassAllOf: Codable { - - public var subClassStringProp: String? - public var subClassIntegerProp: Int? - - public init(subClassStringProp: String?, subClassIntegerProp: Int?) { - self.subClassStringProp = subClassStringProp - self.subClassIntegerProp = subClassIntegerProp - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift deleted file mode 100644 index 48273ea2c2c..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// StringEnum.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public enum StringEnum: String, Codable, CaseIterable { - case stringenumvalue1 = "stringEnumValue1" - case stringenumvalue2 = "stringEnumValue2" - case stringenumvalue3 = "stringEnumValue3" -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift deleted file mode 100644 index 9b67f8a4af2..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// VariableNameTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This object contains property names which we know will be different from their variable name. Examples of this include snake case property names and property names which are Swift 5 reserved words. */ -public struct VariableNameTest: Codable { - - /** This snake-case examle_name property name should be converted to a camelCase variable name like exampleName */ - public var exampleName: String? - /** This property name is a reserved word in most languages, including Swift 5. */ - public var _for: String? - /** This model object property name should be unchanged from the JSON property name. */ - public var normalName: String? - - public init(exampleName: String?, _for: String?, normalName: String?) { - self.exampleName = exampleName - self._for = _for - self.normalName = normalName - } - - public enum CodingKeys: String, CodingKey, CaseIterable { - case exampleName = "example_name" - case _for = "for" - case normalName - } - -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift deleted file mode 100644 index e06208074cd..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// OpenISO8601DateFormatter.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -// https://stackoverflow.com/a/50281094/976628 -public class OpenISO8601DateFormatter: DateFormatter { - static let withoutSeconds: DateFormatter = { - let formatter = DateFormatter() - formatter.calendar = Calendar(identifier: .iso8601) - formatter.locale = Locale(identifier: "en_US_POSIX") - formatter.timeZone = TimeZone(secondsFromGMT: 0) - formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ" - return formatter - }() - - private func setup() { - calendar = Calendar(identifier: .iso8601) - locale = Locale(identifier: "en_US_POSIX") - timeZone = TimeZone(secondsFromGMT: 0) - dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - } - - override init() { - super.init() - setup() - } - - required init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - setup() - } - - override public func date(from string: String) -> Date? { - if let result = super.date(from: string) { - return result - } - return OpenISO8601DateFormatter.withoutSeconds.date(from: string) - } -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/SynchronizedDictionary.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/SynchronizedDictionary.swift deleted file mode 100644 index acf7ff4031b..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/SynchronizedDictionary.swift +++ /dev/null @@ -1,36 +0,0 @@ -// SynchronizedDictionary.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = DispatchQueue( - label: "SynchronizedDictionary", - qos: DispatchQoS.userInitiated, - attributes: [DispatchQueue.Attributes.concurrent], - autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, - target: nil - ) - - internal subscript(key: K) -> V? { - get { - var value: V? - - queue.sync { - value = self.dictionary[key] - } - - return value - } - set { - queue.sync(flags: DispatchWorkItemFlags.barrier) { - self.dictionary[key] = newValue - } - } - } -} diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift deleted file mode 100644 index e59109dc1fd..00000000000 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ /dev/null @@ -1,589 +0,0 @@ -// URLSessionImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -#if !os(macOS) -import MobileCoreServices -#endif - -class URLSessionRequestBuilderFactory: RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type { - return URLSessionRequestBuilder.self - } - - func getBuilder() -> RequestBuilder.Type { - return URLSessionDecodableRequestBuilder.self - } -} - -// Store the URLSession to retain its reference -private var urlSessionStore = SynchronizedDictionary() - -open class URLSessionRequestBuilder: RequestBuilder { - - private var observation: NSKeyValueObservation? - - deinit { - observation?.invalidate() - } - - // swiftlint:disable:next weak_delegate - fileprivate let sessionDelegate = SessionDelegate() - - /** - May be assigned if you want to control the authentication challenges. - */ - public var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - - /** - May be assigned if you want to do any of those things: - - control the task completion - - intercept and handle errors like authorization - - retry the request. - */ - public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - /** - May be overridden by a subclass if you want to control the URLSession - configuration. - */ - open func createURLSession() -> URLSession { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - sessionDelegate.credential = credential - sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge - return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil) - } - - /** - May be overridden by a subclass if you want to control the Content-Type - that is given to an uploaded form part. - - Return nil to use the default behavior (inferring the Content-Type from - the file extension). Return the desired Content-Type otherwise. - */ - open func contentTypeForFormPart(fileURL: URL) -> String? { - return nil - } - - /** - May be overridden by a subclass if you want to control the URLRequest - configuration (e.g. to override the cache policy). - */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - - guard let url = URL(string: URLString) else { - throw DownloadException.requestMissingURL - } - - var originalRequest = URLRequest(url: url) - - originalRequest.httpMethod = method.rawValue - - buildHeaders().forEach { key, value in - originalRequest.setValue(value, forHTTPHeaderField: key) - } - - headers.forEach { key, value in - originalRequest.setValue(value, forHTTPHeaderField: key) - } - - let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - - return modifiedRequest - } - - override open func execute(_ apiResponseQueue: DispatchQueue = TestClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString - // Create a new manager for each request to customize its request header - let urlSession = createURLSession() - urlSessionStore[urlSessionId] = urlSession - - let parameters: [String: Any] = self.parameters ?? [:] - - let fileKeys = parameters.filter { $1 is URL } - .map { $0.0 } - - let encoding: ParameterEncoding - if fileKeys.count > 0 { - encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) - } else if isBody { - encoding = JSONDataEncoding() - } else { - encoding = URLEncoding() - } - - guard let xMethod = HTTPMethod(rawValue: method) else { - fatalError("Unsuported Http method - \(method)") - } - - let cleanupRequest = { - urlSessionStore[urlSessionId] = nil - self.observation?.invalidate() - } - - do { - let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - - let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - - guard let self = self else { return } - - if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - - taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - - guard let self = self else { return } - - if shouldRetry { - cleanupRequest() - self.execute(apiResponseQueue, completion) - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - } - } - } - } else { - apiResponseQueue.async { - self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) - } - } - } - - if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { - onProgressReady?(dataTask.progress) - } - - dataTask.resume() - - } catch { - apiResponseQueue.async { - cleanupRequest() - completion(.failure(ErrorResponse.error(415, nil, error))) - } - } - - } - - fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - - if let error = error { - completion(.failure(ErrorResponse.error(-1, data, error))) - return - } - - guard let httpResponse = response as? HTTPURLResponse else { - completion(.failure(ErrorResponse.error(-2, data, DecodableRequestBuilderError.nilHTTPResponse))) - return - } - - guard httpResponse.isStatusCodeSuccessful else { - completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, DecodableRequestBuilderError.unsuccessfulHTTPStatusCode))) - return - } - - switch T.self { - case is String.Type: - - let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - - completion(.success(Response(response: httpResponse, body: body as? T))) - - case is URL.Type: - do { - - guard error == nil else { - throw DownloadException.responseFailed - } - - guard let data = data else { - throw DownloadException.responseDataMissing - } - - let fileManager = FileManager.default - let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] - let requestURL = try self.getURL(from: urlRequest) - - var requestPath = try self.getPath(from: requestURL) - - if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } - - let filePath = documentsDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion(.success(Response(response: httpResponse, body: filePath as? T))) - - } catch let requestParserError as DownloadException { - completion(.failure(ErrorResponse.error(400, data, requestParserError))) - } catch let error { - completion(.failure(ErrorResponse.error(400, data, error))) - } - - case is Void.Type: - - completion(.success(Response(response: httpResponse, body: nil))) - - default: - - completion(.success(Response(response: httpResponse, body: data as? T))) - } - - } - - open func buildHeaders() -> [String: String] { - var httpHeaders = TestClientAPI.customHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } - - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { - - guard let contentDisposition = contentDisposition else { - return nil - } - - let items = contentDisposition.components(separatedBy: ";") - - var filename: String? - - for contentItem in items { - - let filenameKey = "filename=" - guard let range = contentItem.range(of: filenameKey) else { - break - } - - filename = contentItem - return filename? - .replacingCharacters(in: range, with: "") - .replacingOccurrences(of: "\"", with: "") - .trimmingCharacters(in: .whitespacesAndNewlines) - } - - return filename - - } - - fileprivate func getPath(from url: URL) throws -> String { - - guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { - throw DownloadException.requestMissingPath - } - - if path.hasPrefix("/") { - path.remove(at: path.startIndex) - } - - return path - - } - - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { - - guard let url = urlRequest.url else { - throw DownloadException.requestMissingURL - } - - return url - } - -} - -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { - override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - - if let error = error { - completion(.failure(ErrorResponse.error(-1, data, error))) - return - } - - guard let httpResponse = response as? HTTPURLResponse else { - completion(.failure(ErrorResponse.error(-2, data, DecodableRequestBuilderError.nilHTTPResponse))) - return - } - - guard httpResponse.isStatusCodeSuccessful else { - completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, DecodableRequestBuilderError.unsuccessfulHTTPStatusCode))) - return - } - - switch T.self { - case is String.Type: - - let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - - completion(.success(Response(response: httpResponse, body: body as? T))) - - case is Void.Type: - - completion(.success(Response(response: httpResponse, body: nil))) - - case is Data.Type: - - completion(.success(Response(response: httpResponse, body: data as? T))) - - default: - - guard let data = data, !data.isEmpty else { - completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) - return - } - - let decodeResult = CodableHelper.decode(T.self, from: data) - - switch decodeResult { - case let .success(decodableObj): - completion(.success(Response(response: httpResponse, body: decodableObj))) - case let .failure(error): - completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) - } - } - } -} - -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - - var credential: URLCredential? - - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - - func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { - - var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling - - var credential: URLCredential? - - if let taskDidReceiveChallenge = taskDidReceiveChallenge { - (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) - } else { - if challenge.previousFailureCount > 0 { - disposition = .rejectProtectionSpace - } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) - - if credential != nil { - disposition = .useCredential - } - } - } - - completionHandler(disposition, credential) - } -} - -public enum HTTPMethod: String { - case options = "OPTIONS" - case get = "GET" - case head = "HEAD" - case post = "POST" - case put = "PUT" - case patch = "PATCH" - case delete = "DELETE" - case trace = "TRACE" - case connect = "CONNECT" -} - -public protocol ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest -} - -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - - var urlRequest = urlRequest - - guard let parameters = parameters else { return urlRequest } - - guard let url = urlRequest.url else { - throw DownloadException.requestMissingURL - } - - if var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false), !parameters.isEmpty { - urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) - urlRequest.url = urlComponents.url - } - - return urlRequest - } -} - -private class FileUploadEncoding: ParameterEncoding { - - let contentTypeForFormPart: (_ fileURL: URL) -> String? - - init(contentTypeForFormPart: @escaping (_ fileURL: URL) -> String?) { - self.contentTypeForFormPart = contentTypeForFormPart - } - - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - - var urlRequest = urlRequest - - guard let parameters = parameters, !parameters.isEmpty else { - return urlRequest - } - - let boundary = "Boundary-\(UUID().uuidString)" - - urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") - - for (key, value) in parameters { - switch value { - case let fileURL as URL: - - urlRequest = try configureFileUploadRequest( - urlRequest: urlRequest, - boundary: boundary, - name: key, - fileURL: fileURL - ) - - case let string as String: - - if let data = string.data(using: .utf8) { - urlRequest = configureDataUploadRequest( - urlRequest: urlRequest, - boundary: boundary, - name: key, - data: data - ) - } - - case let number as NSNumber: - - if let data = number.stringValue.data(using: .utf8) { - urlRequest = configureDataUploadRequest( - urlRequest: urlRequest, - boundary: boundary, - name: key, - data: data - ) - } - - default: - fatalError("Unprocessable value \(value) with key \(key)") - } - } - - var body = urlRequest.httpBody.orEmpty - - body.append("\r\n--\(boundary)--\r\n") - - urlRequest.httpBody = body - - return urlRequest - } - - private func configureFileUploadRequest(urlRequest: URLRequest, boundary: String, name: String, fileURL: URL) throws -> URLRequest { - - var urlRequest = urlRequest - - var body = urlRequest.httpBody.orEmpty - - let fileData = try Data(contentsOf: fileURL) - - let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) - - let fileName = fileURL.lastPathComponent - - // If we already added something then we need an additional newline. - if body.count > 0 { - body.append("\r\n") - } - - // Value boundary. - body.append("--\(boundary)\r\n") - - // Value headers. - body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n") - body.append("Content-Type: \(mimetype)\r\n") - - // Separate headers and body. - body.append("\r\n") - - // The value data. - body.append(fileData) - - urlRequest.httpBody = body - - return urlRequest - } - - private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { - - var urlRequest = urlRequest - - var body = urlRequest.httpBody.orEmpty - - // If we already added something then we need an additional newline. - if body.count > 0 { - body.append("\r\n") - } - - // Value boundary. - body.append("--\(boundary)\r\n") - - // Value headers. - body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n") - - // Separate headers and body. - body.append("\r\n") - - // The value data. - body.append(data) - - urlRequest.httpBody = body - - return urlRequest - - } - - func mimeType(for url: URL) -> String { - let pathExtension = url.pathExtension - - if let uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension as NSString, nil)?.takeRetainedValue() { - if let mimetype = UTTypeCopyPreferredTagWithClass(uti, kUTTagClassMIMEType)?.takeRetainedValue() { - return mimetype as String - } - } - return "application/octet-stream" - } - -} - -fileprivate extension Data { - /// Append string to Data - /// - /// Rather than littering my code with calls to `dataUsingEncoding` to convert strings to Data, and then add that data to the Data, this wraps it in a nice convenient little extension to Data. This converts using UTF-8. - /// - /// - parameter string: The string to be added to the `Data`. - - mutating func append(_ string: String) { - if let data = string.data(using: .utf8) { - append(data) - } - } -} - -fileprivate extension Optional where Wrapped == Data { - var orEmpty: Data { - self ?? Data() - } -} - -extension JSONDataEncoding: ParameterEncoding {} diff --git a/samples/client/test/swift5/default/TestClientApp/.gitignore b/samples/client/test/swift5/default/TestClientApp/.gitignore deleted file mode 100644 index 0269c2f56db..00000000000 --- a/samples/client/test/swift5/default/TestClientApp/.gitignore +++ /dev/null @@ -1,72 +0,0 @@ -### https://raw.github.com/github/gitignore/7792e50daeaa6c07460484704671d1dc9f0045a7/Swift.gitignore - -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData/ - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata/ - -## Other -*.moved-aside -*.xccheckout -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa -*.dSYM.zip -*.dSYM - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -# Package.pins -# Package.resolved -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/#source-control - -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots -fastlane/test_output - - diff --git a/samples/client/test/swift5/default/TestClientApp/Podfile b/samples/client/test/swift5/default/TestClientApp/Podfile deleted file mode 100644 index 4c786a266c9..00000000000 --- a/samples/client/test/swift5/default/TestClientApp/Podfile +++ /dev/null @@ -1,13 +0,0 @@ -platform :ios, '9.0' - -source 'https://cdn.cocoapods.org/' - -use_frameworks! - -target 'TestClientApp' do - pod "TestClient", :path => "../" - - target 'TestClientAppTests' do - inherit! :search_paths - end -end diff --git a/samples/client/test/swift5/default/TestClientApp/Podfile.lock b/samples/client/test/swift5/default/TestClientApp/Podfile.lock deleted file mode 100644 index a22ff8bcb6f..00000000000 --- a/samples/client/test/swift5/default/TestClientApp/Podfile.lock +++ /dev/null @@ -1,16 +0,0 @@ -PODS: - - TestClient (1.0) - -DEPENDENCIES: - - TestClient (from `../`) - -EXTERNAL SOURCES: - TestClient: - :path: "../" - -SPEC CHECKSUMS: - TestClient: 2c0d16f42076221adbf579221827fd034c3c4a85 - -PODFILE CHECKSUM: 837b06bfc9f93ccd7664fd918d113c8e3824bde3 - -COCOAPODS: 1.8.4 diff --git a/samples/client/test/swift5/default/TestClientApp/TestClientApp.xcodeproj/project.pbxproj b/samples/client/test/swift5/default/TestClientApp/TestClientApp.xcodeproj/project.pbxproj deleted file mode 100644 index 0df5e64abe9..00000000000 --- a/samples/client/test/swift5/default/TestClientApp/TestClientApp.xcodeproj/project.pbxproj +++ /dev/null @@ -1,546 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 48; - objects = { - -/* Begin PBXBuildFile section */ - 38F9390AFCDA262FB068DF15 /* Pods_TestClientApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A23B54E8FB808BD3C9DD08C8 /* Pods_TestClientApp.framework */; }; - C1ADDA787241158A360D054C /* Pods_TestClientAppTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7476A9BCC24D9147A35E4C81 /* Pods_TestClientAppTests.framework */; }; - FDC99C781F1E832E000EB08F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDC99C771F1E832E000EB08F /* AppDelegate.swift */; }; - FDC99C7A1F1E832E000EB08F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDC99C791F1E832E000EB08F /* ViewController.swift */; }; - FDC99C7D1F1E832E000EB08F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FDC99C7B1F1E832E000EB08F /* Main.storyboard */; }; - FDC99C7F1F1E832E000EB08F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FDC99C7E1F1E832E000EB08F /* Assets.xcassets */; }; - FDC99C821F1E832E000EB08F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FDC99C801F1E832E000EB08F /* LaunchScreen.storyboard */; }; - FDC99C8D1F1E832E000EB08F /* TestClientAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDC99C8C1F1E832E000EB08F /* TestClientAppTests.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - FDC99C891F1E832E000EB08F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = FDC99C6C1F1E832D000EB08F /* Project object */; - proxyType = 1; - remoteGlobalIDString = FDC99C731F1E832D000EB08F; - remoteInfo = TestClientApp; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 3DE372F32029703A6CED4209 /* Pods-TestClientAppTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestClientAppTests.release.xcconfig"; path = "Target Support Files/Pods-TestClientAppTests/Pods-TestClientAppTests.release.xcconfig"; sourceTree = ""; }; - 6DB31B4AAB586D1D0C5D8EA5 /* Pods-TestClientAppTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestClientAppTests.debug.xcconfig"; path = "Target Support Files/Pods-TestClientAppTests/Pods-TestClientAppTests.debug.xcconfig"; sourceTree = ""; }; - 7476A9BCC24D9147A35E4C81 /* Pods_TestClientAppTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestClientAppTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A23B54E8FB808BD3C9DD08C8 /* Pods_TestClientApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestClientApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F7DC1AA685120D6BF86B80A5 /* Pods-TestClientApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestClientApp.debug.xcconfig"; path = "Target Support Files/Pods-TestClientApp/Pods-TestClientApp.debug.xcconfig"; sourceTree = ""; }; - FD4690FD2BC8291E69C8FD40 /* Pods-TestClientApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestClientApp.release.xcconfig"; path = "Target Support Files/Pods-TestClientApp/Pods-TestClientApp.release.xcconfig"; sourceTree = ""; }; - FDC99C741F1E832E000EB08F /* TestClientApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestClientApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; - FDC99C771F1E832E000EB08F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - FDC99C791F1E832E000EB08F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - FDC99C7C1F1E832E000EB08F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - FDC99C7E1F1E832E000EB08F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - FDC99C811F1E832E000EB08F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - FDC99C831F1E832E000EB08F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - FDC99C881F1E832E000EB08F /* TestClientAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestClientAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - FDC99C8C1F1E832E000EB08F /* TestClientAppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestClientAppTests.swift; sourceTree = ""; }; - FDC99C8E1F1E832E000EB08F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - FDC99C711F1E832D000EB08F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 38F9390AFCDA262FB068DF15 /* Pods_TestClientApp.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FDC99C851F1E832E000EB08F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - C1ADDA787241158A360D054C /* Pods_TestClientAppTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 14E10881047978AE906EB19F /* Frameworks */ = { - isa = PBXGroup; - children = ( - A23B54E8FB808BD3C9DD08C8 /* Pods_TestClientApp.framework */, - 7476A9BCC24D9147A35E4C81 /* Pods_TestClientAppTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - CF51681F23C24C36AAED2CE8 /* Pods */ = { - isa = PBXGroup; - children = ( - F7DC1AA685120D6BF86B80A5 /* Pods-TestClientApp.debug.xcconfig */, - FD4690FD2BC8291E69C8FD40 /* Pods-TestClientApp.release.xcconfig */, - 6DB31B4AAB586D1D0C5D8EA5 /* Pods-TestClientAppTests.debug.xcconfig */, - 3DE372F32029703A6CED4209 /* Pods-TestClientAppTests.release.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; - FDC99C6B1F1E832D000EB08F = { - isa = PBXGroup; - children = ( - FDC99C761F1E832E000EB08F /* TestClientApp */, - FDC99C8B1F1E832E000EB08F /* TestClientAppTests */, - FDC99C751F1E832E000EB08F /* Products */, - CF51681F23C24C36AAED2CE8 /* Pods */, - 14E10881047978AE906EB19F /* Frameworks */, - ); - sourceTree = ""; - }; - FDC99C751F1E832E000EB08F /* Products */ = { - isa = PBXGroup; - children = ( - FDC99C741F1E832E000EB08F /* TestClientApp.app */, - FDC99C881F1E832E000EB08F /* TestClientAppTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - FDC99C761F1E832E000EB08F /* TestClientApp */ = { - isa = PBXGroup; - children = ( - FDC99C771F1E832E000EB08F /* AppDelegate.swift */, - FDC99C791F1E832E000EB08F /* ViewController.swift */, - FDC99C7B1F1E832E000EB08F /* Main.storyboard */, - FDC99C7E1F1E832E000EB08F /* Assets.xcassets */, - FDC99C801F1E832E000EB08F /* LaunchScreen.storyboard */, - FDC99C831F1E832E000EB08F /* Info.plist */, - ); - path = TestClientApp; - sourceTree = ""; - }; - FDC99C8B1F1E832E000EB08F /* TestClientAppTests */ = { - isa = PBXGroup; - children = ( - FDC99C8C1F1E832E000EB08F /* TestClientAppTests.swift */, - FDC99C8E1F1E832E000EB08F /* Info.plist */, - ); - path = TestClientAppTests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - FDC99C731F1E832D000EB08F /* TestClientApp */ = { - isa = PBXNativeTarget; - buildConfigurationList = FDC99C911F1E832E000EB08F /* Build configuration list for PBXNativeTarget "TestClientApp" */; - buildPhases = ( - 49D4BFD3E4300757B94A1108 /* [CP] Check Pods Manifest.lock */, - FDC99C701F1E832D000EB08F /* Sources */, - FDC99C711F1E832D000EB08F /* Frameworks */, - FDC99C721F1E832D000EB08F /* Resources */, - 963B093FCC81F62B36EB9CB5 /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = TestClientApp; - productName = TestClientApp; - productReference = FDC99C741F1E832E000EB08F /* TestClientApp.app */; - productType = "com.apple.product-type.application"; - }; - FDC99C871F1E832E000EB08F /* TestClientAppTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = FDC99C941F1E832E000EB08F /* Build configuration list for PBXNativeTarget "TestClientAppTests" */; - buildPhases = ( - 29B2A5322E23310EC5D6B2DD /* [CP] Check Pods Manifest.lock */, - FDC99C841F1E832E000EB08F /* Sources */, - FDC99C851F1E832E000EB08F /* Frameworks */, - FDC99C861F1E832E000EB08F /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - FDC99C8A1F1E832E000EB08F /* PBXTargetDependency */, - ); - name = TestClientAppTests; - productName = TestClientAppTests; - productReference = FDC99C881F1E832E000EB08F /* TestClientAppTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - FDC99C6C1F1E832D000EB08F /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0900; - LastUpgradeCheck = 0900; - ORGANIZATIONNAME = "Swagger Codegen"; - TargetAttributes = { - FDC99C731F1E832D000EB08F = { - CreatedOnToolsVersion = 9.0; - }; - FDC99C871F1E832E000EB08F = { - CreatedOnToolsVersion = 9.0; - TestTargetID = FDC99C731F1E832D000EB08F; - }; - }; - }; - buildConfigurationList = FDC99C6F1F1E832D000EB08F /* Build configuration list for PBXProject "TestClientApp" */; - compatibilityVersion = "Xcode 8.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = FDC99C6B1F1E832D000EB08F; - productRefGroup = FDC99C751F1E832E000EB08F /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - FDC99C731F1E832D000EB08F /* TestClientApp */, - FDC99C871F1E832E000EB08F /* TestClientAppTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - FDC99C721F1E832D000EB08F /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - FDC99C821F1E832E000EB08F /* LaunchScreen.storyboard in Resources */, - FDC99C7F1F1E832E000EB08F /* Assets.xcassets in Resources */, - FDC99C7D1F1E832E000EB08F /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FDC99C861F1E832E000EB08F /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 29B2A5322E23310EC5D6B2DD /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-TestClientAppTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 49D4BFD3E4300757B94A1108 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-TestClientApp-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 963B093FCC81F62B36EB9CB5 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-TestClientApp/Pods-TestClientApp-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/TestClient/TestClient.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TestClient.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TestClientApp/Pods-TestClientApp-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - FDC99C701F1E832D000EB08F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - FDC99C7A1F1E832E000EB08F /* ViewController.swift in Sources */, - FDC99C781F1E832E000EB08F /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FDC99C841F1E832E000EB08F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - FDC99C8D1F1E832E000EB08F /* TestClientAppTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - FDC99C8A1F1E832E000EB08F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = FDC99C731F1E832D000EB08F /* TestClientApp */; - targetProxy = FDC99C891F1E832E000EB08F /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - FDC99C7B1F1E832E000EB08F /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - FDC99C7C1F1E832E000EB08F /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - FDC99C801F1E832E000EB08F /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - FDC99C811F1E832E000EB08F /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - FDC99C8F1F1E832E000EB08F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - FDC99C901F1E832E000EB08F /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - FDC99C921F1E832E000EB08F /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F7DC1AA685120D6BF86B80A5 /* Pods-TestClientApp.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = 82A2S5FGTA; - INFOPLIST_FILE = TestClientApp/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = org.swagger.TestClientApp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - FDC99C931F1E832E000EB08F /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FD4690FD2BC8291E69C8FD40 /* Pods-TestClientApp.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = 82A2S5FGTA; - INFOPLIST_FILE = TestClientApp/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = org.swagger.TestClientApp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - FDC99C951F1E832E000EB08F /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 6DB31B4AAB586D1D0C5D8EA5 /* Pods-TestClientAppTests.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - DEVELOPMENT_TEAM = 82A2S5FGTA; - INFOPLIST_FILE = TestClientAppTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = org.swagger.TestClientAppTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestClientApp.app/TestClientApp"; - }; - name = Debug; - }; - FDC99C961F1E832E000EB08F /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3DE372F32029703A6CED4209 /* Pods-TestClientAppTests.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - DEVELOPMENT_TEAM = 82A2S5FGTA; - INFOPLIST_FILE = TestClientAppTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = org.swagger.TestClientAppTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestClientApp.app/TestClientApp"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - FDC99C6F1F1E832D000EB08F /* Build configuration list for PBXProject "TestClientApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - FDC99C8F1F1E832E000EB08F /* Debug */, - FDC99C901F1E832E000EB08F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - FDC99C911F1E832E000EB08F /* Build configuration list for PBXNativeTarget "TestClientApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - FDC99C921F1E832E000EB08F /* Debug */, - FDC99C931F1E832E000EB08F /* Release */, - ); - defaultConfigurationIsVisible = 0; - }; - FDC99C941F1E832E000EB08F /* Build configuration list for PBXNativeTarget "TestClientAppTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - FDC99C951F1E832E000EB08F /* Debug */, - FDC99C961F1E832E000EB08F /* Release */, - ); - defaultConfigurationIsVisible = 0; - }; -/* End XCConfigurationList section */ - }; - rootObject = FDC99C6C1F1E832D000EB08F /* Project object */; -} diff --git a/samples/client/test/swift5/default/TestClientApp/TestClientApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/test/swift5/default/TestClientApp/TestClientApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 8a25971ab6b..00000000000 --- a/samples/client/test/swift5/default/TestClientApp/TestClientApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/test/swift5/default/TestClientApp/TestClientApp.xcworkspace/contents.xcworkspacedata b/samples/client/test/swift5/default/TestClientApp/TestClientApp.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index ad74fb61eb2..00000000000 --- a/samples/client/test/swift5/default/TestClientApp/TestClientApp.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/samples/client/test/swift5/default/TestClientApp/TestClientApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/samples/client/test/swift5/default/TestClientApp/TestClientApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d6..00000000000 --- a/samples/client/test/swift5/default/TestClientApp/TestClientApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/samples/client/test/swift5/default/TestClientApp/TestClientApp/AppDelegate.swift b/samples/client/test/swift5/default/TestClientApp/TestClientApp/AppDelegate.swift deleted file mode 100644 index f8a7b948d85..00000000000 --- a/samples/client/test/swift5/default/TestClientApp/TestClientApp/AppDelegate.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// AppDelegate.swift -// TestClientApp -// -// Created by Eric Hyche on 7/18/17. -// Copyright © 2017 Swagger Codegen. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - -} diff --git a/samples/client/test/swift5/default/TestClientApp/TestClientApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/samples/client/test/swift5/default/TestClientApp/TestClientApp/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 1d060ed2882..00000000000 --- a/samples/client/test/swift5/default/TestClientApp/TestClientApp/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/samples/client/test/swift5/default/TestClientApp/TestClientApp/Base.lproj/LaunchScreen.storyboard b/samples/client/test/swift5/default/TestClientApp/TestClientApp/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 5654142a8ab..00000000000 --- a/samples/client/test/swift5/default/TestClientApp/TestClientApp/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/test/swift5/default/TestClientApp/TestClientApp/Base.lproj/Main.storyboard b/samples/client/test/swift5/default/TestClientApp/TestClientApp/Base.lproj/Main.storyboard deleted file mode 100644 index 7ef2ecfcfd9..00000000000 --- a/samples/client/test/swift5/default/TestClientApp/TestClientApp/Base.lproj/Main.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/test/swift5/default/TestClientApp/TestClientApp/Info.plist b/samples/client/test/swift5/default/TestClientApp/TestClientApp/Info.plist deleted file mode 100644 index 16be3b68112..00000000000 --- a/samples/client/test/swift5/default/TestClientApp/TestClientApp/Info.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/samples/client/test/swift5/default/TestClientApp/TestClientApp/ViewController.swift b/samples/client/test/swift5/default/TestClientApp/TestClientApp/ViewController.swift deleted file mode 100644 index a5f289c421f..00000000000 --- a/samples/client/test/swift5/default/TestClientApp/TestClientApp/ViewController.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// ViewController.swift -// TestClientApp -// -// Created by Eric Hyche on 7/18/17. -// Copyright © 2017 Swagger Codegen. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - -} diff --git a/samples/client/test/swift5/default/TestClientApp/TestClientAppTests/Info.plist b/samples/client/test/swift5/default/TestClientApp/TestClientAppTests/Info.plist deleted file mode 100644 index 6c40a6cd0c4..00000000000 --- a/samples/client/test/swift5/default/TestClientApp/TestClientAppTests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/samples/client/test/swift5/default/TestClientApp/TestClientAppTests/TestClientAppTests.swift b/samples/client/test/swift5/default/TestClientApp/TestClientAppTests/TestClientAppTests.swift deleted file mode 100644 index 42dd587fe00..00000000000 --- a/samples/client/test/swift5/default/TestClientApp/TestClientAppTests/TestClientAppTests.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// TestClientAppTests.swift -// TestClientAppTests -// -// Created by Eric Hyche on 7/18/17. -// Copyright © 2017 Swagger Codegen. All rights reserved. -// - -import XCTest -import TestClient -@testable import TestClientApp - -class TestClientAppTests: XCTestCase { - - func testWhenVariableNameIsDifferentFromPropertyName() throws { - // This tests to make sure that the swift4 language can handle when - // we have property names which map to variable names that are not the same. - // This can happen when we have things like snake_case property names, - // or when we have property names which may be Swift 4 reserved words. - let jsonData = """ - { - "example_name": "Test example name", - "for": "Some reason", - "normalName": "Some normal name value" - } - """.data(using: .utf8)! - - let decodedResult = CodableHelper.decode(VariableNameTest.self, from: jsonData) - let variableNameTest = try decodedResult.get() - - XCTAssertTrue(variableNameTest.exampleName == "Test example name", "Did not decode snake_case property correctly.") - XCTAssertTrue(variableNameTest._for == "Some reason", "Did not decode property name that is a reserved word correctly.") - } - -} diff --git a/samples/client/test/swift5/default/TestClientApp/pom.xml b/samples/client/test/swift5/default/TestClientApp/pom.xml deleted file mode 100644 index fdb3db1495b..00000000000 --- a/samples/client/test/swift5/default/TestClientApp/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - Swift4TestClientTests - pom - 1.0-SNAPSHOT - Swift4 Swagger Test Schema Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_xcodebuild.sh - - - - - - - diff --git a/samples/client/test/swift5/default/TestClientApp/run_xcodebuild.sh b/samples/client/test/swift5/default/TestClientApp/run_xcodebuild.sh deleted file mode 100755 index 060ec332217..00000000000 --- a/samples/client/test/swift5/default/TestClientApp/run_xcodebuild.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -pod install - -xcodebuild clean build build-for-testing -workspace "TestClientApp.xcworkspace" -scheme "TestClientApp" -destination "platform=iOS Simulator,name=iPhone 11 Pro Max,OS=latest" && xcodebuild test-without-building -workspace "TestClientApp.xcworkspace" -scheme "TestClientAppTests" -destination "platform=iOS Simulator,name=iPhone 11 Pro Max,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/test/swift5/default/docs/AllPrimitives.md b/samples/client/test/swift5/default/docs/AllPrimitives.md deleted file mode 100644 index 1cfa94eaf73..00000000000 --- a/samples/client/test/swift5/default/docs/AllPrimitives.md +++ /dev/null @@ -1,34 +0,0 @@ -# AllPrimitives - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myInteger** | **Int** | | [optional] -**myIntegerArray** | **[Int]** | | [optional] -**myLong** | **Int64** | | [optional] -**myLongArray** | **[Int64]** | | [optional] -**myFloat** | **Float** | | [optional] -**myFloatArray** | **[Float]** | | [optional] -**myDouble** | **Double** | | [optional] -**myDoubleArray** | **[Double]** | | [optional] -**myString** | **String** | | [optional] -**myStringArray** | **[String]** | | [optional] -**myBytes** | **Data** | | [optional] -**myBytesArray** | **[Data]** | | [optional] -**myBoolean** | **Bool** | | [optional] -**myBooleanArray** | **[Bool]** | | [optional] -**myDate** | **Date** | | [optional] -**myDateArray** | **[Date]** | | [optional] -**myDateTime** | **Date** | | [optional] -**myDateTimeArray** | **[Date]** | | [optional] -**myFile** | **URL** | | [optional] -**myFileArray** | **[URL]** | | [optional] -**myUUID** | **UUID** | | [optional] -**myUUIDArray** | **[UUID]** | | [optional] -**myStringEnum** | [**StringEnum**](StringEnum.md) | | [optional] -**myStringEnumArray** | [StringEnum] | | [optional] -**myInlineStringEnum** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift5/default/docs/GetAllModelsResult.md b/samples/client/test/swift5/default/docs/GetAllModelsResult.md deleted file mode 100644 index 4de449547ae..00000000000 --- a/samples/client/test/swift5/default/docs/GetAllModelsResult.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetAllModelsResult - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myPrimitiveArray** | [AllPrimitives] | | [optional] -**myPrimitive** | [**AllPrimitives**](AllPrimitives.md) | | [optional] -**myVariableNameTest** | [**VariableNameTest**](VariableNameTest.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift5/default/docs/ModelWithIntAdditionalPropertiesOnly.md b/samples/client/test/swift5/default/docs/ModelWithIntAdditionalPropertiesOnly.md deleted file mode 100644 index 209683e4fdf..00000000000 --- a/samples/client/test/swift5/default/docs/ModelWithIntAdditionalPropertiesOnly.md +++ /dev/null @@ -1,9 +0,0 @@ -# ModelWithIntAdditionalPropertiesOnly - -## 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/test/swift5/default/docs/ModelWithPropertiesAndAdditionalProperties.md b/samples/client/test/swift5/default/docs/ModelWithPropertiesAndAdditionalProperties.md deleted file mode 100644 index 098c03d6882..00000000000 --- a/samples/client/test/swift5/default/docs/ModelWithPropertiesAndAdditionalProperties.md +++ /dev/null @@ -1,17 +0,0 @@ -# ModelWithPropertiesAndAdditionalProperties - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myIntegerReq** | **Int** | | -**myIntegerOpt** | **Int** | | [optional] -**myPrimitiveReq** | [**AllPrimitives**](AllPrimitives.md) | | -**myPrimitiveOpt** | [**AllPrimitives**](AllPrimitives.md) | | [optional] -**myStringArrayReq** | **[String]** | | -**myStringArrayOpt** | **[String]** | | [optional] -**myPrimitiveArrayReq** | [AllPrimitives] | | -**myPrimitiveArrayOpt** | [AllPrimitives] | | [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/test/swift5/default/docs/ModelWithStringAdditionalPropertiesOnly.md b/samples/client/test/swift5/default/docs/ModelWithStringAdditionalPropertiesOnly.md deleted file mode 100644 index ca910111612..00000000000 --- a/samples/client/test/swift5/default/docs/ModelWithStringAdditionalPropertiesOnly.md +++ /dev/null @@ -1,9 +0,0 @@ -# ModelWithStringAdditionalPropertiesOnly - -## 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/test/swift5/default/docs/PersonCard.md b/samples/client/test/swift5/default/docs/PersonCard.md deleted file mode 100644 index 385299f8768..00000000000 --- a/samples/client/test/swift5/default/docs/PersonCard.md +++ /dev/null @@ -1,11 +0,0 @@ -# PersonCard - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift5/default/docs/PersonCardAllOf.md b/samples/client/test/swift5/default/docs/PersonCardAllOf.md deleted file mode 100644 index e4b78f76c9e..00000000000 --- a/samples/client/test/swift5/default/docs/PersonCardAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# PersonCardAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift5/default/docs/PlaceCard.md b/samples/client/test/swift5/default/docs/PlaceCard.md deleted file mode 100644 index 87002357ce0..00000000000 --- a/samples/client/test/swift5/default/docs/PlaceCard.md +++ /dev/null @@ -1,11 +0,0 @@ -# PlaceCard - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**placeName** | **String** | | [optional] -**placeAddress** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift5/default/docs/PlaceCardAllOf.md b/samples/client/test/swift5/default/docs/PlaceCardAllOf.md deleted file mode 100644 index 5ed8d8a4d0e..00000000000 --- a/samples/client/test/swift5/default/docs/PlaceCardAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# PlaceCardAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**placeName** | **String** | | [optional] -**placeAddress** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift5/default/docs/SampleBase.md b/samples/client/test/swift5/default/docs/SampleBase.md deleted file mode 100644 index a7c7ac9722d..00000000000 --- a/samples/client/test/swift5/default/docs/SampleBase.md +++ /dev/null @@ -1,11 +0,0 @@ -# SampleBase - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**baseClassStringProp** | **String** | | [optional] -**baseClassIntegerProp** | **Int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift5/default/docs/SampleSubClass.md b/samples/client/test/swift5/default/docs/SampleSubClass.md deleted file mode 100644 index 435633ccde1..00000000000 --- a/samples/client/test/swift5/default/docs/SampleSubClass.md +++ /dev/null @@ -1,13 +0,0 @@ -# SampleSubClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**baseClassStringProp** | **String** | | [optional] -**baseClassIntegerProp** | **Int** | | [optional] -**subClassStringProp** | **String** | | [optional] -**subClassIntegerProp** | **Int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift5/default/docs/SampleSubClassAllOf.md b/samples/client/test/swift5/default/docs/SampleSubClassAllOf.md deleted file mode 100644 index 50a64944e82..00000000000 --- a/samples/client/test/swift5/default/docs/SampleSubClassAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# SampleSubClassAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**subClassStringProp** | **String** | | [optional] -**subClassIntegerProp** | **Int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift5/default/docs/Swift5TestAPI.md b/samples/client/test/swift5/default/docs/Swift5TestAPI.md deleted file mode 100644 index fde288b3946..00000000000 --- a/samples/client/test/swift5/default/docs/Swift5TestAPI.md +++ /dev/null @@ -1,59 +0,0 @@ -# Swift5TestAPI - -All URIs are relative to *http://api.example.com/basePath* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getAllModels**](Swift5TestAPI.md#getallmodels) | **GET** /allModels | Get all of the models - - -# **getAllModels** -```swift - open class func getAllModels(clientId: String, completion: @escaping (_ data: GetAllModelsResult?, _ error: Error?) -> Void) -``` - -Get all of the models - -This endpoint tests get a dictionary which contains examples of all of the models. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import TestClient - -let clientId = "clientId_example" // String | id that represent the Api client - -// Get all of the models -Swift5TestAPI.getAllModels(clientId: clientId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **clientId** | **String** | id that represent the Api client | - -### Return type - -[**GetAllModelsResult**](GetAllModelsResult.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/test/swift5/default/docs/VariableNameTest.md b/samples/client/test/swift5/default/docs/VariableNameTest.md deleted file mode 100644 index b99011e0a9e..00000000000 --- a/samples/client/test/swift5/default/docs/VariableNameTest.md +++ /dev/null @@ -1,12 +0,0 @@ -# VariableNameTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**exampleName** | **String** | This snake-case examle_name property name should be converted to a camelCase variable name like exampleName | [optional] -**_for** | **String** | This property name is a reserved word in most languages, including Swift 5. | [optional] -**normalName** | **String** | This model object property name should be unchanged from the JSON property name. | [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/test/swift5/default/pom.xml b/samples/client/test/swift5/default/pom.xml deleted file mode 100644 index 5caba9cb463..00000000000 --- a/samples/client/test/swift5/default/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - Swift4PetstoreClientTests - pom - 1.0-SNAPSHOT - Swift4 Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_spmbuild.sh - - - - - - - diff --git a/samples/client/test/swift5/default/project.yml b/samples/client/test/swift5/default/project.yml deleted file mode 100644 index c5d75afe8c0..00000000000 --- a/samples/client/test/swift5/default/project.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: TestClient -targets: - TestClient: - type: framework - platform: iOS - deploymentTarget: "10.0" - sources: [TestClient] - info: - path: ./Info.plist - version: 1.0 - settings: - APPLICATION_EXTENSION_API_ONLY: true - scheme: {} - diff --git a/samples/client/test/swift5/default/run_spmbuild.sh b/samples/client/test/swift5/default/run_spmbuild.sh deleted file mode 100755 index 1a9f585ad05..00000000000 --- a/samples/client/test/swift5/default/run_spmbuild.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -swift build && exit ${PIPESTATUS[0]} diff --git a/samples/client/test/swift5/swift5_test_all.sh b/samples/client/test/swift5/swift5_test_all.sh deleted file mode 100755 index dcb30d887c9..00000000000 --- a/samples/client/test/swift5/swift5_test_all.sh +++ /dev/null @@ -1,11 +0,0 @@ -#/bin/bash - -set -e - -DIRECTORY=`dirname $0` - -# example project with unit tests -mvn -f $DIRECTORY/default/TestClientApp/pom.xml integration-test - -# spm build -mvn -f $DIRECTORY/default/pom.xml integration-test diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/pet_api.dart index 65752e18bae..95db7626674 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/pet_api.dart @@ -37,7 +37,7 @@ class PetApi { final String _path = '/pet'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -112,7 +112,7 @@ class PetApi { final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -163,7 +163,7 @@ class PetApi { final String _path = '/pet/findByStatus'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -233,7 +233,7 @@ class PetApi { final String _path = '/pet/findByTags'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -303,7 +303,7 @@ class PetApi { final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -371,7 +371,7 @@ class PetApi { final String _path = '/pet'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -447,7 +447,7 @@ class PetApi { final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -459,9 +459,10 @@ class PetApi { 'application/x-www-form-urlencoded', ]; - final formData = {}; - formData['name'] = parameterToString(_serializers, name); - formData['status'] = parameterToString(_serializers, status); + final formData = { + if (name != null) r'name': parameterToString(_serializers, name), + if (status != null) r'status': parameterToString(_serializers, status), + }; bodyData = formData; return _dio.request( @@ -506,7 +507,7 @@ class PetApi { final String _path = '/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -518,13 +519,10 @@ class PetApi { 'multipart/form-data', ]; - final formData = {}; - if (additionalMetadata != null) { - formData[r'additionalMetadata'] = parameterToString(_serializers, additionalMetadata); - } - if (file != null) { - formData[r'file'] = MultipartFile.fromBytes(file, filename: r'file'); - } + final formData = { + if (additionalMetadata != null) r'additionalMetadata': parameterToString(_serializers, additionalMetadata), + if (file != null) r'file': MultipartFile.fromBytes(file, filename: r'file'), + }; bodyData = FormData.fromMap(formData); return _dio.request( diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/store_api.dart index ba3f241333e..5f58e788091 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/store_api.dart @@ -34,7 +34,7 @@ class StoreApi { final String _path = '/store/order/{orderId}'.replaceAll('{' r'orderId' '}', orderId.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -78,7 +78,7 @@ class StoreApi { final String _path = '/store/inventory'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -149,7 +149,7 @@ class StoreApi { final String _path = '/store/order/{orderId}'.replaceAll('{' r'orderId' '}', orderId.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -210,7 +210,7 @@ class StoreApi { final String _path = '/store/order'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/user_api.dart index cb890e1846c..a4d59b2978c 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/lib/api/user_api.dart @@ -34,7 +34,7 @@ class UserApi { final String _path = '/user'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -93,7 +93,7 @@ class UserApi { final String _path = '/user/createWithArray'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -152,7 +152,7 @@ class UserApi { final String _path = '/user/createWithList'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -211,7 +211,7 @@ class UserApi { final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -263,7 +263,7 @@ class UserApi { final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -325,7 +325,7 @@ class UserApi { final String _path = '/user/login'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -383,7 +383,7 @@ class UserApi { final String _path = '/user/logout'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -436,7 +436,7 @@ class UserApi { final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/another_fake_api.dart index 16e34300387..72310ff3533 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/another_fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/another_fake_api.dart @@ -33,7 +33,7 @@ class AnotherFakeApi { final String _path = '/another-fake/dummy'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/default_api.dart index 1e93ce8718a..a47b383960b 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/default_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/default_api.dart @@ -32,7 +32,7 @@ class DefaultApi { final String _path = '/foo'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_api.dart index ade787a58a4..96d776d36f9 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_api.dart @@ -40,7 +40,7 @@ class FakeApi { final String _path = '/fake/health'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -103,7 +103,7 @@ class FakeApi { final String _path = '/fake/http-signature-test'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -163,7 +163,7 @@ class FakeApi { final String _path = '/fake/outer/boolean'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -175,7 +175,7 @@ class FakeApi { 'application/json', ]; - var serializedBody = body; + final serializedBody = body; final jsonbody = json.encode(serializedBody); bodyData = jsonbody; @@ -226,7 +226,7 @@ class FakeApi { final String _path = '/fake/outer/composite'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -294,7 +294,7 @@ class FakeApi { final String _path = '/fake/outer/number'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -306,7 +306,7 @@ class FakeApi { 'application/json', ]; - var serializedBody = body; + final serializedBody = body; final jsonbody = json.encode(serializedBody); bodyData = jsonbody; @@ -357,7 +357,7 @@ class FakeApi { final String _path = '/fake/outer/string'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -369,7 +369,7 @@ class FakeApi { 'application/json', ]; - var serializedBody = body; + final serializedBody = body; final jsonbody = json.encode(serializedBody); bodyData = jsonbody; @@ -420,7 +420,7 @@ class FakeApi { final String _path = '/fake/body-with-file-schema'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -473,7 +473,7 @@ class FakeApi { final String _path = '/fake/body-with-query-params'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -526,7 +526,7 @@ class FakeApi { final String _path = '/fake'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -607,7 +607,7 @@ class FakeApi { final String _path = '/fake'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -619,21 +619,22 @@ class FakeApi { 'application/x-www-form-urlencoded', ]; - final formData = {}; - formData['integer'] = parameterToString(_serializers, integer); - formData['int32'] = parameterToString(_serializers, int32); - formData['int64'] = parameterToString(_serializers, int64); - formData['number'] = parameterToString(_serializers, number); - formData['float'] = parameterToString(_serializers, float); - formData['double'] = parameterToString(_serializers, double_); - formData['string'] = parameterToString(_serializers, string); - formData['pattern_without_delimiter'] = parameterToString(_serializers, patternWithoutDelimiter); - formData['byte'] = parameterToString(_serializers, byte); - formData['binary'] = parameterToString(_serializers, binary); - formData['date'] = parameterToString(_serializers, date); - formData['dateTime'] = parameterToString(_serializers, dateTime); - formData['password'] = parameterToString(_serializers, password); - formData['callback'] = parameterToString(_serializers, callback); + final formData = { + if (integer != null) r'integer': parameterToString(_serializers, integer), + if (int32 != null) r'int32': parameterToString(_serializers, int32), + if (int64 != null) r'int64': parameterToString(_serializers, int64), + r'number': parameterToString(_serializers, number), + if (float != null) r'float': parameterToString(_serializers, float), + r'double': parameterToString(_serializers, double_), + if (string != null) r'string': parameterToString(_serializers, string), + r'pattern_without_delimiter': parameterToString(_serializers, patternWithoutDelimiter), + r'byte': parameterToString(_serializers, byte), + if (binary != null) r'binary': MultipartFile.fromBytes(binary, filename: r'binary'), + if (date != null) r'date': parameterToString(_serializers, date), + if (dateTime != null) r'dateTime': parameterToString(_serializers, dateTime), + if (password != null) r'password': parameterToString(_serializers, password), + if (callback != null) r'callback': parameterToString(_serializers, callback), + }; bodyData = formData; return _dio.request( @@ -683,7 +684,7 @@ class FakeApi { final String _path = '/fake'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -701,9 +702,10 @@ class FakeApi { 'application/x-www-form-urlencoded', ]; - final formData = {}; - formData['enum_form_string_array'] = parameterToString(_serializers, enumFormStringArray); - formData['enum_form_string'] = parameterToString(_serializers, enumFormString); + final formData = { + if (enumFormStringArray != null) r'enum_form_string_array': parameterToString(_serializers, enumFormStringArray), + if (enumFormString != null) r'enum_form_string': parameterToString(_serializers, enumFormString), + }; bodyData = formData; return _dio.request( @@ -746,7 +748,7 @@ class FakeApi { final String _path = '/fake'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -802,7 +804,7 @@ class FakeApi { final String _path = '/fake/inline-additionalProperties'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -855,7 +857,7 @@ class FakeApi { final String _path = '/fake/jsonFormData'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -867,9 +869,10 @@ class FakeApi { 'application/x-www-form-urlencoded', ]; - final formData = {}; - formData['param'] = parameterToString(_serializers, param); - formData['param2'] = parameterToString(_serializers, param2); + final formData = { + r'param': parameterToString(_serializers, param), + r'param2': parameterToString(_serializers, param2), + }; bodyData = formData; return _dio.request( @@ -911,7 +914,7 @@ class FakeApi { final String _path = '/fake/test-query-paramters'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_classname_tags123_api.dart index 222097970a1..81d1c554818 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_classname_tags123_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/fake_classname_tags123_api.dart @@ -33,7 +33,7 @@ class FakeClassnameTags123Api { final String _path = '/fake_classname_test'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/pet_api.dart index b5536c892ec..6bb8363f2ae 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/pet_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/pet_api.dart @@ -37,7 +37,7 @@ class PetApi { final String _path = '/pet'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -96,7 +96,7 @@ class PetApi { final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -147,7 +147,7 @@ class PetApi { final String _path = '/pet/findByStatus'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -217,7 +217,7 @@ class PetApi { final String _path = '/pet/findByTags'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -287,7 +287,7 @@ class PetApi { final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -355,7 +355,7 @@ class PetApi { final String _path = '/pet'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -415,7 +415,7 @@ class PetApi { final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -427,9 +427,10 @@ class PetApi { 'application/x-www-form-urlencoded', ]; - final formData = {}; - formData['name'] = parameterToString(_serializers, name); - formData['status'] = parameterToString(_serializers, status); + final formData = { + if (name != null) r'name': parameterToString(_serializers, name), + if (status != null) r'status': parameterToString(_serializers, status), + }; bodyData = formData; return _dio.request( @@ -474,7 +475,7 @@ class PetApi { final String _path = '/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -486,13 +487,10 @@ class PetApi { 'multipart/form-data', ]; - final formData = {}; - if (additionalMetadata != null) { - formData[r'additionalMetadata'] = parameterToString(_serializers, additionalMetadata); - } - if (file != null) { - formData[r'file'] = MultipartFile.fromBytes(file, filename: r'file'); - } + final formData = { + if (additionalMetadata != null) r'additionalMetadata': parameterToString(_serializers, additionalMetadata), + if (file != null) r'file': MultipartFile.fromBytes(file, filename: r'file'), + }; bodyData = FormData.fromMap(formData); return _dio.request( @@ -553,7 +551,7 @@ class PetApi { final String _path = '/fake/{petId}/uploadImageWithRequiredFile'.replaceAll('{' r'petId' '}', petId.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -565,13 +563,10 @@ class PetApi { 'multipart/form-data', ]; - final formData = {}; - if (additionalMetadata != null) { - formData[r'additionalMetadata'] = parameterToString(_serializers, additionalMetadata); - } - if (requiredFile != null) { - formData[r'requiredFile'] = MultipartFile.fromBytes(requiredFile, filename: r'requiredFile'); - } + final formData = { + if (additionalMetadata != null) r'additionalMetadata': parameterToString(_serializers, additionalMetadata), + r'requiredFile': MultipartFile.fromBytes(requiredFile, filename: r'requiredFile'), + }; bodyData = FormData.fromMap(formData); return _dio.request( diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/store_api.dart index a1bea34d14f..b9be3d2f72d 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/store_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/store_api.dart @@ -34,7 +34,7 @@ class StoreApi { final String _path = '/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -78,7 +78,7 @@ class StoreApi { final String _path = '/store/inventory'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -149,7 +149,7 @@ class StoreApi { final String _path = '/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -210,7 +210,7 @@ class StoreApi { final String _path = '/store/order'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/user_api.dart index 87dbb0b8d14..e73986ac493 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/user_api.dart +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/lib/api/user_api.dart @@ -34,7 +34,7 @@ class UserApi { final String _path = '/user'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -86,7 +86,7 @@ class UserApi { final String _path = '/user/createWithArray'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -138,7 +138,7 @@ class UserApi { final String _path = '/user/createWithList'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -190,7 +190,7 @@ class UserApi { final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -235,7 +235,7 @@ class UserApi { final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -297,7 +297,7 @@ class UserApi { final String _path = '/user/login'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -355,7 +355,7 @@ class UserApi { final String _path = '/user/logout'; final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; @@ -401,7 +401,7 @@ class UserApi { final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString()); final queryParams = {}; - final headerParams = { + final headerParams = { if (headers != null) ...headers, }; dynamic bodyData; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/order.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/order.dart index 30d60e0120a..a7b01582664 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/order.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/order.dart @@ -125,13 +125,6 @@ class OrderStatusEnum { /// The underlying value of this enum member. final String value; - @override - bool operator ==(Object other) => identical(this, other) || - other is OrderStatusEnum && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart index daa1c561e47..edb8930c11d 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/lib/model/pet.dart @@ -125,13 +125,6 @@ class PetStatusEnum { /// The underlying value of this enum member. final String value; - @override - bool operator ==(Object other) => identical(this, other) || - other is PetStatusEnum && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_arrays.dart index b79f23df362..f0e7b2417db 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_arrays.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_arrays.dart @@ -86,13 +86,6 @@ class EnumArraysJustSymbolEnum { /// The underlying value of this enum member. final String value; - @override - bool operator ==(Object other) => identical(this, other) || - other is EnumArraysJustSymbolEnum && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value; @@ -159,13 +152,6 @@ class EnumArraysArrayEnumEnum { /// The underlying value of this enum member. final String value; - @override - bool operator ==(Object other) => identical(this, other) || - other is EnumArraysArrayEnumEnum && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_class.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_class.dart index 8e1e1eb2e9e..96647a37971 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_class.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_class.dart @@ -17,13 +17,6 @@ class EnumClass { /// The underlying value of this enum member. final String value; - @override - bool operator ==(Object other) => identical(this, other) || - other is EnumClass && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_test.dart index 371858d9ea6..a4503966408 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_test.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/enum_test.dart @@ -140,13 +140,6 @@ class EnumTestEnumStringEnum { /// The underlying value of this enum member. final String value; - @override - bool operator ==(Object other) => identical(this, other) || - other is EnumTestEnumStringEnum && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value; @@ -216,13 +209,6 @@ class EnumTestEnumStringRequiredEnum { /// The underlying value of this enum member. final String value; - @override - bool operator ==(Object other) => identical(this, other) || - other is EnumTestEnumStringRequiredEnum && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value; @@ -292,13 +278,6 @@ class EnumTestEnumIntegerEnum { /// The underlying value of this enum member. final int value; - @override - bool operator ==(Object other) => identical(this, other) || - other is EnumTestEnumIntegerEnum && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value.toString(); @@ -365,13 +344,6 @@ class EnumTestEnumNumberEnum { /// The underlying value of this enum member. final double value; - @override - bool operator ==(Object other) => identical(this, other) || - other is EnumTestEnumNumberEnum && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value.toString(); diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/map_test.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/map_test.dart index 2834ab2acf4..99d39e720f9 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/map_test.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/map_test.dart @@ -112,13 +112,6 @@ class MapTestInnerEnum { /// The underlying value of this enum member. final String value; - @override - bool operator ==(Object other) => identical(this, other) || - other is MapTestInnerEnum && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/order.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/order.dart index 30d60e0120a..a7b01582664 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/order.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/order.dart @@ -125,13 +125,6 @@ class OrderStatusEnum { /// The underlying value of this enum member. final String value; - @override - bool operator ==(Object other) => identical(this, other) || - other is OrderStatusEnum && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_enum.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_enum.dart index a4494ede999..ce3f4c30a53 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_enum.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_enum.dart @@ -17,13 +17,6 @@ class OuterEnum { /// The underlying value of this enum member. final String value; - @override - bool operator ==(Object other) => identical(this, other) || - other is OuterEnum && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_enum_default_value.dart index 0eb08d128bc..8f6d40b7d1e 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_enum_default_value.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_enum_default_value.dart @@ -17,13 +17,6 @@ class OuterEnumDefaultValue { /// The underlying value of this enum member. final String value; - @override - bool operator ==(Object other) => identical(this, other) || - other is OuterEnumDefaultValue && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value; diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_enum_integer.dart index 6bbe2dda1fc..751506326be 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_enum_integer.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_enum_integer.dart @@ -17,13 +17,6 @@ class OuterEnumInteger { /// The underlying value of this enum member. final int value; - @override - bool operator ==(Object other) => identical(this, other) || - other is OuterEnumInteger && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value.toString(); diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_enum_integer_default_value.dart index 5eac2105488..c5f52fc8047 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_enum_integer_default_value.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/outer_enum_integer_default_value.dart @@ -17,13 +17,6 @@ class OuterEnumIntegerDefaultValue { /// The underlying value of this enum member. final int value; - @override - bool operator ==(Object other) => identical(this, other) || - other is OuterEnumIntegerDefaultValue && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value.toString(); diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet.dart b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet.dart index daa1c561e47..edb8930c11d 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet.dart +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/lib/model/pet.dart @@ -125,13 +125,6 @@ class PetStatusEnum { /// The underlying value of this enum member. final String value; - @override - bool operator ==(Object other) => identical(this, other) || - other is PetStatusEnum && other.value == value; - - @override - int get hashCode => toString().hashCode; - @override String toString() => value; diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/EnumTest.md b/samples/openapi3/client/petstore/go/go-petstore/docs/EnumTest.md index a1761a7cd72..75bf9867dac 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/EnumTest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **EnumNumber** | Pointer to **float64** | | [optional] **OuterEnum** | Pointer to [**NullableOuterEnum**](OuterEnum.md) | | [optional] **OuterEnumInteger** | Pointer to [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] -**OuterEnumDefaultValue** | Pointer to [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] [default to "placed"] +**OuterEnumDefaultValue** | Pointer to [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] [default to OUTERENUMDEFAULTVALUE_PLACED] **OuterEnumIntegerDefaultValue** | Pointer to [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] [default to OUTERENUMINTEGERDEFAULTVALUE__0] ## Methods 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 cab7c698817..bf7b8ca59c2 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 @@ -36,7 +36,7 @@ type _EnumTest EnumTest func NewEnumTest(enumStringRequired string, ) *EnumTest { this := EnumTest{} this.EnumStringRequired = enumStringRequired - var outerEnumDefaultValue OuterEnumDefaultValue = "placed" + var outerEnumDefaultValue OuterEnumDefaultValue = OUTERENUMDEFAULTVALUE_PLACED this.OuterEnumDefaultValue = &outerEnumDefaultValue var outerEnumIntegerDefaultValue OuterEnumIntegerDefaultValue = OUTERENUMINTEGERDEFAULTVALUE__0 this.OuterEnumIntegerDefaultValue = &outerEnumIntegerDefaultValue @@ -48,7 +48,7 @@ func NewEnumTest(enumStringRequired string, ) *EnumTest { // but it doesn't guarantee that properties required by API are set func NewEnumTestWithDefaults() *EnumTest { this := EnumTest{} - var outerEnumDefaultValue OuterEnumDefaultValue = "placed" + var outerEnumDefaultValue OuterEnumDefaultValue = OUTERENUMDEFAULTVALUE_PLACED this.OuterEnumDefaultValue = &outerEnumDefaultValue var outerEnumIntegerDefaultValue OuterEnumIntegerDefaultValue = OUTERENUMINTEGERDEFAULTVALUE__0 this.OuterEnumIntegerDefaultValue = &outerEnumIntegerDefaultValue diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java index 838e1910886..8b3dbdcebb0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java @@ -72,7 +72,7 @@ public class ApiClient extends JavaTimeFormatter { protected List servers = new ArrayList(Arrays.asList( new ServerConfiguration( - "/", + "", "No description provided", new HashMap() ) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java index d1c2e014f1d..8649a7b93cb 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java @@ -134,7 +134,6 @@ public class ChildSchema extends Parent { return Objects.hash(prop1, super.hashCode(), additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchemaAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchemaAllOf.java index 34f7f810d16..a0db494b2ac 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchemaAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchemaAllOf.java @@ -84,7 +84,6 @@ public class ChildSchemaAllOf { return Objects.hash(prop1); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java index 9e6139dd887..247c156a38d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java @@ -135,7 +135,6 @@ public class MySchemaNameCharacters extends Parent { return Objects.hash(prop2, super.hashCode(), additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharactersAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharactersAllOf.java index 35110aeb107..6cefaff7a87 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharactersAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharactersAllOf.java @@ -84,7 +84,6 @@ public class MySchemaNameCharactersAllOf { return Objects.hash(prop2); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java index 858fa5368f6..2a382d5f2ac 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/Parent.java @@ -94,7 +94,6 @@ public class Parent { return Objects.hash(objectType); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index a75297dbd0a..f7c18aae8ba 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -335,7 +335,6 @@ public class AdditionalPropertiesClass { return Objects.hash(mapProperty, mapOfMapProperty, anytype1, mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, emptyMap, mapWithUndeclaredPropertiesString); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java index 2a710f7c0eb..f15b1a4c09a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java @@ -122,7 +122,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java index 1f5d097cf8c..118f51be938 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java @@ -113,7 +113,6 @@ public class Apple { return Objects.hash(cultivar, origin); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java index 28d95b96a71..3e3ccfe74a1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java @@ -112,7 +112,6 @@ public class AppleReq { return Objects.hash(cultivar, mealy); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 61e776b5a47..9e5c4c6492f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -95,7 +95,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 57efee4d2d1..45fd7829c9e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -95,7 +95,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java index d903e38a4c1..db796d93d47 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -169,7 +169,6 @@ public class ArrayTest { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java index 435ba975ba4..41b4adf25cd 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Banana.java @@ -85,7 +85,6 @@ public class Banana { return Objects.hash(lengthCm); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java index d8ace3f992d..a25e9a07081 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BananaReq.java @@ -113,7 +113,6 @@ public class BananaReq { return Objects.hash(lengthCm, sweet); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java index 4c50d816384..96aff9e86b2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BasquePig.java @@ -83,7 +83,6 @@ public class BasquePig { return Objects.hash(className); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java index a9dea7ecdf0..e368f955e7d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java @@ -229,7 +229,6 @@ public class Capitalization { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java index 0f8d0dcf912..387d3e0895e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java @@ -133,7 +133,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode(), additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java index 03f58bfd5b1..54e6b24cdb0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -84,7 +84,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java index ee4737e8d35..ea4ceb96ec0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java @@ -112,7 +112,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java index cef2ced4547..ad00f5688d2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java @@ -175,7 +175,6 @@ public class ChildCat extends ParentPet { return Objects.hash(name, petType, super.hashCode(), additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java index 27f4ae52c63..1f574138ba2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCatAllOf.java @@ -127,7 +127,6 @@ public class ChildCatAllOf { return Objects.hash(name, petType); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java index c8ae7f8a76e..700ba2f17b7 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java @@ -85,7 +85,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java index dab78b57cd5..e7c0e00398d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java @@ -84,7 +84,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index 7242efd7262..347f19a0dba 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -155,7 +155,6 @@ public class ComplexQuadrilateral { return Objects.hash(shapeType, quadrilateralType, additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java index 38db931baa9..dae0379e10e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DanishPig.java @@ -83,7 +83,6 @@ public class DanishPig { return Objects.hash(className); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java index 701a8f5827c..91826dae78d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java @@ -133,7 +133,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode(), additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java index a9c704f742e..086058c0a71 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -84,7 +84,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java index 642404cadff..ccae4aaacd6 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Drawing.java @@ -240,7 +240,6 @@ public class Drawing { return Objects.hash(mainShape, shapeOrNull, nullableShape, shapes, additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java index 7dca4022c01..3ec9f891572 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -193,7 +193,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index 23d81b39b41..fa8a5057851 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -447,7 +447,6 @@ public class EnumTest { return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum, outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index b0a44657ed6..e5132c8288a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -155,7 +155,6 @@ public class EquilateralTriangle { return Objects.hash(shapeType, triangleType, additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index accd424c2af..c60d469c297 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -123,7 +123,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java index 0885ad1ece9..99776842253 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java @@ -84,7 +84,6 @@ public class Foo { return Objects.hash(bar); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java index ef56e32cd5b..5b6e671268e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java @@ -530,7 +530,6 @@ public class FormatTest { return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index 79973932509..0dbfc1f3721 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -93,7 +93,6 @@ public class GrandparentAnimal { return Objects.hash(petType); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index c97c586db81..7bba0219b1c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -97,7 +97,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java index d12f679c227..3e67cd1c84c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -98,7 +98,6 @@ public class HealthCheckResult { return Objects.hash(nullableMessage); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java index 3fcd2852596..0295c474b2c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/InlineResponseDefault.java @@ -85,7 +85,6 @@ public class InlineResponseDefault { return Objects.hash(string); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index dac5aa412a4..de8014802d4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -113,7 +113,6 @@ public class IsoscelesTriangle { return Objects.hash(shapeType, triangleType); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java index f1cc1f76952..82b45777945 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java @@ -241,7 +241,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 11744f59e90..1391207e425 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -156,7 +156,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java index 8dc189bc731..6f8ab9af771 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java @@ -114,7 +114,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 6526672a02e..6fca2b9dcb6 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -142,7 +142,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java index a70aae4ecd8..00ca2754808 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -85,7 +85,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java index 6654394f0f9..40e242f6aba 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java @@ -155,7 +155,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java index 484a04c73a6..6590e167179 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java @@ -619,7 +619,6 @@ public class NullableClass { return Objects.hash(integerProp, numberProp, booleanProp, stringProp, dateProp, datetimeProp, arrayNullableProp, arrayAndItemsNullableProp, arrayItemsNullable, objectNullableProp, objectAndItemsNullableProp, objectItemsNullable, additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java index ccc4d7f9696..bfb345fc28f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -85,7 +85,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java index 0db344f33dc..712287864f0 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java @@ -267,7 +267,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java index 86250c03b98..f1425c4a848 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -143,7 +143,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java index c2f46eb7430..2e1e30212aa 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java @@ -105,7 +105,6 @@ public class ParentPet extends GrandparentAnimal { return Objects.hash(super.hashCode(), additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java index 5749931544b..e9f52ee0bbb 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java @@ -281,7 +281,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index 487f149f728..159eb442251 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -83,7 +83,6 @@ public class QuadrilateralInterface { return Objects.hash(quadrilateralType); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e3a4e82ff20..22495675ccb 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -105,7 +105,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index f5a662f9426..6508911dad5 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -155,7 +155,6 @@ public class ScaleneTriangle { return Objects.hash(shapeType, triangleType, additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java index 3c2facc9feb..e44301b8d3d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -83,7 +83,6 @@ public class ShapeInterface { return Objects.hash(shapeType); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index 90094a2cf32..a665d55be01 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -155,7 +155,6 @@ public class SimpleQuadrilateral { return Objects.hash(shapeType, quadrilateralType, additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java index 34db401c79f..f72fc3538e2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -84,7 +84,6 @@ public class SpecialModelName { return Objects.hash($specialPropertyName); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java index 58d7e848629..9080c1b7b20 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java @@ -113,7 +113,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java index 34ee4ba4bed..aee2904c270 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -83,7 +83,6 @@ public class TriangleInterface { return Objects.hash(triangleType); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java index 4c2596ff335..3425d0068bd 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java @@ -436,7 +436,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus, objectWithNoDeclaredProps, objectWithNoDeclaredPropsNullable, anyTypeProp, anyTypePropNullable); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java index 903271b2308..ad576f50403 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java @@ -141,7 +141,6 @@ public class Whale { return Objects.hash(hasBaleen, hasTeeth, className); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java index d58401760d5..302896e9d9c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java @@ -191,7 +191,6 @@ public class Zebra { return Objects.hash(type, className, additionalProperties); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); diff --git a/samples/openapi3/client/petstore/python-legacy/docs/PetApi.md b/samples/openapi3/client/petstore/python-legacy/docs/PetApi.md index 186933485ee..0472f7c000a 100755 --- a/samples/openapi3/client/petstore/python-legacy/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python-legacy/docs/PetApi.md @@ -81,6 +81,7 @@ void (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| +**200** | Successful operation | - | **405** | Invalid input | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -153,6 +154,7 @@ void (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| +**200** | Successful operation | - | **400** | Invalid pet value | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -446,6 +448,7 @@ void (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| +**200** | Successful operation | - | **400** | Invalid ID supplied | - | **404** | Pet not found | - | **405** | Validation exception | - | @@ -522,6 +525,7 @@ void (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| +**200** | Successful operation | - | **405** | Invalid input | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java index c6f15ca13c3..afed4d545a9 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Category id(Long id) { @@ -26,7 +28,7 @@ public class Category { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Category { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java index b99eabed6fd..820779a1cd9 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") + private Integer code; @JsonProperty("type") + private String type; @JsonProperty("message") + private String message; public ModelApiResponse code(Integer code) { @@ -29,7 +32,7 @@ public class ModelApiResponse { * Get code * @return code **/ - public Integer getCode() { + public Integer getCode() { return code; } @@ -46,7 +49,7 @@ public class ModelApiResponse { * Get type * @return type **/ - public String getType() { + public String getType() { return type; } @@ -63,7 +66,7 @@ public class ModelApiResponse { * Get message * @return message **/ - public String getMessage() { + public String getMessage() { return message; } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java index 2d378562807..d54cba148ad 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java @@ -13,15 +13,20 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") + private Long id; @JsonProperty("petId") + private Long petId; @JsonProperty("quantity") + private Integer quantity; @JsonProperty("shipDate") + @Valid + private OffsetDateTime shipDate; /** @@ -58,9 +63,11 @@ public class Order { } @JsonProperty("status") + private StatusEnum status; @JsonProperty("complete") + private Boolean complete = false; public Order id(Long id) { @@ -72,7 +79,7 @@ public class Order { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -89,7 +96,7 @@ public class Order { * Get petId * @return petId **/ - public Long getPetId() { + public Long getPetId() { return petId; } @@ -106,7 +113,7 @@ public class Order { * Get quantity * @return quantity **/ - public Integer getQuantity() { + public Integer getQuantity() { return quantity; } @@ -123,7 +130,6 @@ public class Order { * Get shipDate * @return shipDate **/ - @Valid public OffsetDateTime getShipDate() { return shipDate; } @@ -141,7 +147,7 @@ public class Order { * Order Status * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } @@ -158,7 +164,7 @@ public class Order { * Get complete * @return complete **/ - public Boolean getComplete() { + public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java index f6c95ac4e9e..4699f7235ed 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java @@ -16,18 +16,27 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") + private Long id; @JsonProperty("category") + @Valid + private Category category; @JsonProperty("name") + @NotNull + private String name; @JsonProperty("photoUrls") + @NotNull + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") + @Valid + private List tags = null; /** @@ -64,6 +73,7 @@ public class Pet { } @JsonProperty("status") + private StatusEnum status; public Pet id(Long id) { @@ -75,7 +85,7 @@ public class Pet { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -92,7 +102,6 @@ public class Pet { * Get category * @return category **/ - @Valid public Category getCategory() { return category; } @@ -110,7 +119,6 @@ public class Pet { * Get name * @return name **/ - @NotNull public String getName() { return name; } @@ -133,7 +141,6 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @NotNull public List getPhotoUrls() { return photoUrls; } @@ -159,7 +166,6 @@ public class Pet { * Get tags * @return tags **/ - @Valid public List getTags() { return tags; } @@ -177,7 +183,7 @@ public class Pet { * pet status in the store * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java index 47799f61395..adac882cd05 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Tag id(Long id) { @@ -26,7 +28,7 @@ public class Tag { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Tag { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java index dc119d03edf..4e5d397b990 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java @@ -12,27 +12,35 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") + private Long id; @JsonProperty("username") + private String username; @JsonProperty("firstName") + private String firstName; @JsonProperty("lastName") + private String lastName; @JsonProperty("email") + private String email; @JsonProperty("password") + private String password; @JsonProperty("phone") + private String phone; @JsonProperty("userStatus") + private Integer userStatus; public User id(Long id) { @@ -44,7 +52,7 @@ public class User { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -61,7 +69,7 @@ public class User { * Get username * @return username **/ - public String getUsername() { + public String getUsername() { return username; } @@ -78,7 +86,7 @@ public class User { * Get firstName * @return firstName **/ - public String getFirstName() { + public String getFirstName() { return firstName; } @@ -95,7 +103,7 @@ public class User { * Get lastName * @return lastName **/ - public String getLastName() { + public String getLastName() { return lastName; } @@ -112,7 +120,7 @@ public class User { * Get email * @return email **/ - public String getEmail() { + public String getEmail() { return email; } @@ -129,7 +137,7 @@ public class User { * Get password * @return password **/ - public String getPassword() { + public String getPassword() { return password; } @@ -146,7 +154,7 @@ public class User { * Get phone * @return phone **/ - public String getPhone() { + public String getPhone() { return phone; } @@ -163,7 +171,7 @@ public class User { * User Status * @return userStatus **/ - public Integer getUserStatus() { + public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/java-play-framework-api-package-override/build.sbt b/samples/server/petstore/java-play-framework-api-package-override/build.sbt index 83a17e91013..b972893fc3f 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/build.sbt +++ b/samples/server/petstore/java-play-framework-api-package-override/build.sbt @@ -7,5 +7,5 @@ lazy val root = (project in file(".")).enablePlugins(PlayJava) scalaVersion := "2.12.6" libraryDependencies += "org.webjars" % "swagger-ui" % "3.32.5" -libraryDependencies += "javax.validation" % "validation-api" % "1.1.0.Final" +libraryDependencies += "javax.validation" % "validation-api" % "2.0.1.Final" libraryDependencies += guice diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-async/app/apimodels/Category.java index c6f15ca13c3..afed4d545a9 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/Category.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Category id(Long id) { @@ -26,7 +28,7 @@ public class Category { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Category { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java index b99eabed6fd..820779a1cd9 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") + private Integer code; @JsonProperty("type") + private String type; @JsonProperty("message") + private String message; public ModelApiResponse code(Integer code) { @@ -29,7 +32,7 @@ public class ModelApiResponse { * Get code * @return code **/ - public Integer getCode() { + public Integer getCode() { return code; } @@ -46,7 +49,7 @@ public class ModelApiResponse { * Get type * @return type **/ - public String getType() { + public String getType() { return type; } @@ -63,7 +66,7 @@ public class ModelApiResponse { * Get message * @return message **/ - public String getMessage() { + public String getMessage() { return message; } diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java index 2d378562807..d54cba148ad 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java @@ -13,15 +13,20 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") + private Long id; @JsonProperty("petId") + private Long petId; @JsonProperty("quantity") + private Integer quantity; @JsonProperty("shipDate") + @Valid + private OffsetDateTime shipDate; /** @@ -58,9 +63,11 @@ public class Order { } @JsonProperty("status") + private StatusEnum status; @JsonProperty("complete") + private Boolean complete = false; public Order id(Long id) { @@ -72,7 +79,7 @@ public class Order { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -89,7 +96,7 @@ public class Order { * Get petId * @return petId **/ - public Long getPetId() { + public Long getPetId() { return petId; } @@ -106,7 +113,7 @@ public class Order { * Get quantity * @return quantity **/ - public Integer getQuantity() { + public Integer getQuantity() { return quantity; } @@ -123,7 +130,6 @@ public class Order { * Get shipDate * @return shipDate **/ - @Valid public OffsetDateTime getShipDate() { return shipDate; } @@ -141,7 +147,7 @@ public class Order { * Order Status * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } @@ -158,7 +164,7 @@ public class Order { * Get complete * @return complete **/ - public Boolean getComplete() { + public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-async/app/apimodels/Pet.java index f6c95ac4e9e..4699f7235ed 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/Pet.java @@ -16,18 +16,27 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") + private Long id; @JsonProperty("category") + @Valid + private Category category; @JsonProperty("name") + @NotNull + private String name; @JsonProperty("photoUrls") + @NotNull + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") + @Valid + private List tags = null; /** @@ -64,6 +73,7 @@ public class Pet { } @JsonProperty("status") + private StatusEnum status; public Pet id(Long id) { @@ -75,7 +85,7 @@ public class Pet { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -92,7 +102,6 @@ public class Pet { * Get category * @return category **/ - @Valid public Category getCategory() { return category; } @@ -110,7 +119,6 @@ public class Pet { * Get name * @return name **/ - @NotNull public String getName() { return name; } @@ -133,7 +141,6 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @NotNull public List getPhotoUrls() { return photoUrls; } @@ -159,7 +166,6 @@ public class Pet { * Get tags * @return tags **/ - @Valid public List getTags() { return tags; } @@ -177,7 +183,7 @@ public class Pet { * pet status in the store * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-async/app/apimodels/Tag.java index 47799f61395..adac882cd05 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/Tag.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Tag id(Long id) { @@ -26,7 +28,7 @@ public class Tag { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Tag { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/User.java b/samples/server/petstore/java-play-framework-async/app/apimodels/User.java index dc119d03edf..4e5d397b990 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/User.java @@ -12,27 +12,35 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") + private Long id; @JsonProperty("username") + private String username; @JsonProperty("firstName") + private String firstName; @JsonProperty("lastName") + private String lastName; @JsonProperty("email") + private String email; @JsonProperty("password") + private String password; @JsonProperty("phone") + private String phone; @JsonProperty("userStatus") + private Integer userStatus; public User id(Long id) { @@ -44,7 +52,7 @@ public class User { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -61,7 +69,7 @@ public class User { * Get username * @return username **/ - public String getUsername() { + public String getUsername() { return username; } @@ -78,7 +86,7 @@ public class User { * Get firstName * @return firstName **/ - public String getFirstName() { + public String getFirstName() { return firstName; } @@ -95,7 +103,7 @@ public class User { * Get lastName * @return lastName **/ - public String getLastName() { + public String getLastName() { return lastName; } @@ -112,7 +120,7 @@ public class User { * Get email * @return email **/ - public String getEmail() { + public String getEmail() { return email; } @@ -129,7 +137,7 @@ public class User { * Get password * @return password **/ - public String getPassword() { + public String getPassword() { return password; } @@ -146,7 +154,7 @@ public class User { * Get phone * @return phone **/ - public String getPhone() { + public String getPhone() { return phone; } @@ -163,7 +171,7 @@ public class User { * User Status * @return userStatus **/ - public Integer getUserStatus() { + public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/java-play-framework-async/build.sbt b/samples/server/petstore/java-play-framework-async/build.sbt index 83a17e91013..b972893fc3f 100644 --- a/samples/server/petstore/java-play-framework-async/build.sbt +++ b/samples/server/petstore/java-play-framework-async/build.sbt @@ -7,5 +7,5 @@ lazy val root = (project in file(".")).enablePlugins(PlayJava) scalaVersion := "2.12.6" libraryDependencies += "org.webjars" % "swagger-ui" % "3.32.5" -libraryDependencies += "javax.validation" % "validation-api" % "1.1.0.Final" +libraryDependencies += "javax.validation" % "validation-api" % "2.0.1.Final" libraryDependencies += guice diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java index c6f15ca13c3..afed4d545a9 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Category id(Long id) { @@ -26,7 +28,7 @@ public class Category { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Category { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java index b99eabed6fd..820779a1cd9 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") + private Integer code; @JsonProperty("type") + private String type; @JsonProperty("message") + private String message; public ModelApiResponse code(Integer code) { @@ -29,7 +32,7 @@ public class ModelApiResponse { * Get code * @return code **/ - public Integer getCode() { + public Integer getCode() { return code; } @@ -46,7 +49,7 @@ public class ModelApiResponse { * Get type * @return type **/ - public String getType() { + public String getType() { return type; } @@ -63,7 +66,7 @@ public class ModelApiResponse { * Get message * @return message **/ - public String getMessage() { + public String getMessage() { return message; } diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java index 2d378562807..d54cba148ad 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java @@ -13,15 +13,20 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") + private Long id; @JsonProperty("petId") + private Long petId; @JsonProperty("quantity") + private Integer quantity; @JsonProperty("shipDate") + @Valid + private OffsetDateTime shipDate; /** @@ -58,9 +63,11 @@ public class Order { } @JsonProperty("status") + private StatusEnum status; @JsonProperty("complete") + private Boolean complete = false; public Order id(Long id) { @@ -72,7 +79,7 @@ public class Order { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -89,7 +96,7 @@ public class Order { * Get petId * @return petId **/ - public Long getPetId() { + public Long getPetId() { return petId; } @@ -106,7 +113,7 @@ public class Order { * Get quantity * @return quantity **/ - public Integer getQuantity() { + public Integer getQuantity() { return quantity; } @@ -123,7 +130,6 @@ public class Order { * Get shipDate * @return shipDate **/ - @Valid public OffsetDateTime getShipDate() { return shipDate; } @@ -141,7 +147,7 @@ public class Order { * Order Status * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } @@ -158,7 +164,7 @@ public class Order { * Get complete * @return complete **/ - public Boolean getComplete() { + public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java index f6c95ac4e9e..4699f7235ed 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java @@ -16,18 +16,27 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") + private Long id; @JsonProperty("category") + @Valid + private Category category; @JsonProperty("name") + @NotNull + private String name; @JsonProperty("photoUrls") + @NotNull + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") + @Valid + private List tags = null; /** @@ -64,6 +73,7 @@ public class Pet { } @JsonProperty("status") + private StatusEnum status; public Pet id(Long id) { @@ -75,7 +85,7 @@ public class Pet { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -92,7 +102,6 @@ public class Pet { * Get category * @return category **/ - @Valid public Category getCategory() { return category; } @@ -110,7 +119,6 @@ public class Pet { * Get name * @return name **/ - @NotNull public String getName() { return name; } @@ -133,7 +141,6 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @NotNull public List getPhotoUrls() { return photoUrls; } @@ -159,7 +166,6 @@ public class Pet { * Get tags * @return tags **/ - @Valid public List getTags() { return tags; } @@ -177,7 +183,7 @@ public class Pet { * pet status in the store * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java index 47799f61395..adac882cd05 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Tag id(Long id) { @@ -26,7 +28,7 @@ public class Tag { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Tag { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java index dc119d03edf..4e5d397b990 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java @@ -12,27 +12,35 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") + private Long id; @JsonProperty("username") + private String username; @JsonProperty("firstName") + private String firstName; @JsonProperty("lastName") + private String lastName; @JsonProperty("email") + private String email; @JsonProperty("password") + private String password; @JsonProperty("phone") + private String phone; @JsonProperty("userStatus") + private Integer userStatus; public User id(Long id) { @@ -44,7 +52,7 @@ public class User { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -61,7 +69,7 @@ public class User { * Get username * @return username **/ - public String getUsername() { + public String getUsername() { return username; } @@ -78,7 +86,7 @@ public class User { * Get firstName * @return firstName **/ - public String getFirstName() { + public String getFirstName() { return firstName; } @@ -95,7 +103,7 @@ public class User { * Get lastName * @return lastName **/ - public String getLastName() { + public String getLastName() { return lastName; } @@ -112,7 +120,7 @@ public class User { * Get email * @return email **/ - public String getEmail() { + public String getEmail() { return email; } @@ -129,7 +137,7 @@ public class User { * Get password * @return password **/ - public String getPassword() { + public String getPassword() { return password; } @@ -146,7 +154,7 @@ public class User { * Get phone * @return phone **/ - public String getPhone() { + public String getPhone() { return phone; } @@ -163,7 +171,7 @@ public class User { * User Status * @return userStatus **/ - public Integer getUserStatus() { + public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/java-play-framework-controller-only/build.sbt b/samples/server/petstore/java-play-framework-controller-only/build.sbt index 83a17e91013..b972893fc3f 100644 --- a/samples/server/petstore/java-play-framework-controller-only/build.sbt +++ b/samples/server/petstore/java-play-framework-controller-only/build.sbt @@ -7,5 +7,5 @@ lazy val root = (project in file(".")).enablePlugins(PlayJava) scalaVersion := "2.12.6" libraryDependencies += "org.webjars" % "swagger-ui" % "3.32.5" -libraryDependencies += "javax.validation" % "validation-api" % "1.1.0.Final" +libraryDependencies += "javax.validation" % "validation-api" % "2.0.1.Final" libraryDependencies += guice diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesAnyType.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesAnyType.java index ef168e15d51..b0a7d76dd74 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesAnyType.java @@ -14,6 +14,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class AdditionalPropertiesAnyType extends HashMap { @JsonProperty("name") + private String name; public AdditionalPropertiesAnyType name(String name) { @@ -25,7 +26,7 @@ public class AdditionalPropertiesAnyType extends HashMap { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesArray.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesArray.java index 56458c16eea..84342b61bd4 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesArray.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesArray.java @@ -15,6 +15,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class AdditionalPropertiesArray extends HashMap { @JsonProperty("name") + private String name; public AdditionalPropertiesArray name(String name) { @@ -26,7 +27,7 @@ public class AdditionalPropertiesArray extends HashMap { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesBoolean.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesBoolean.java index 7fd46035e0c..f6631c053d4 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesBoolean.java @@ -14,6 +14,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class AdditionalPropertiesBoolean extends HashMap { @JsonProperty("name") + private String name; public AdditionalPropertiesBoolean name(String name) { @@ -25,7 +26,7 @@ public class AdditionalPropertiesBoolean extends HashMap { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java index d1d4e7cf987..84ba450c960 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java @@ -16,36 +16,52 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class AdditionalPropertiesClass { @JsonProperty("map_string") + private Map mapString = null; @JsonProperty("map_number") + @Valid + private Map mapNumber = null; @JsonProperty("map_integer") + private Map mapInteger = null; @JsonProperty("map_boolean") + private Map mapBoolean = null; @JsonProperty("map_array_integer") + @Valid + private Map> mapArrayInteger = null; @JsonProperty("map_array_anytype") + @Valid + private Map> mapArrayAnytype = null; @JsonProperty("map_map_string") + @Valid + private Map> mapMapString = null; @JsonProperty("map_map_anytype") + @Valid + private Map> mapMapAnytype = null; @JsonProperty("anytype_1") + private Object anytype1; @JsonProperty("anytype_2") + private Object anytype2; @JsonProperty("anytype_3") + private Object anytype3; public AdditionalPropertiesClass mapString(Map mapString) { @@ -65,7 +81,7 @@ public class AdditionalPropertiesClass { * Get mapString * @return mapString **/ - public Map getMapString() { + public Map getMapString() { return mapString; } @@ -90,7 +106,6 @@ public class AdditionalPropertiesClass { * Get mapNumber * @return mapNumber **/ - @Valid public Map getMapNumber() { return mapNumber; } @@ -116,7 +131,7 @@ public class AdditionalPropertiesClass { * Get mapInteger * @return mapInteger **/ - public Map getMapInteger() { + public Map getMapInteger() { return mapInteger; } @@ -141,7 +156,7 @@ public class AdditionalPropertiesClass { * Get mapBoolean * @return mapBoolean **/ - public Map getMapBoolean() { + public Map getMapBoolean() { return mapBoolean; } @@ -166,7 +181,6 @@ public class AdditionalPropertiesClass { * Get mapArrayInteger * @return mapArrayInteger **/ - @Valid public Map> getMapArrayInteger() { return mapArrayInteger; } @@ -192,7 +206,6 @@ public class AdditionalPropertiesClass { * Get mapArrayAnytype * @return mapArrayAnytype **/ - @Valid public Map> getMapArrayAnytype() { return mapArrayAnytype; } @@ -218,7 +231,6 @@ public class AdditionalPropertiesClass { * Get mapMapString * @return mapMapString **/ - @Valid public Map> getMapMapString() { return mapMapString; } @@ -244,7 +256,6 @@ public class AdditionalPropertiesClass { * Get mapMapAnytype * @return mapMapAnytype **/ - @Valid public Map> getMapMapAnytype() { return mapMapAnytype; } @@ -262,7 +273,7 @@ public class AdditionalPropertiesClass { * Get anytype1 * @return anytype1 **/ - public Object getAnytype1() { + public Object getAnytype1() { return anytype1; } @@ -279,7 +290,7 @@ public class AdditionalPropertiesClass { * Get anytype2 * @return anytype2 **/ - public Object getAnytype2() { + public Object getAnytype2() { return anytype2; } @@ -296,7 +307,7 @@ public class AdditionalPropertiesClass { * Get anytype3 * @return anytype3 **/ - public Object getAnytype3() { + public Object getAnytype3() { return anytype3; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesInteger.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesInteger.java index 7f2a305f5d5..9d1d43a69d8 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesInteger.java @@ -14,6 +14,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class AdditionalPropertiesInteger extends HashMap { @JsonProperty("name") + private String name; public AdditionalPropertiesInteger name(String name) { @@ -25,7 +26,7 @@ public class AdditionalPropertiesInteger extends HashMap { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesNumber.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesNumber.java index a74714db2a3..d87ad137d02 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesNumber.java @@ -15,6 +15,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class AdditionalPropertiesNumber extends HashMap { @JsonProperty("name") + private String name; public AdditionalPropertiesNumber name(String name) { @@ -26,7 +27,7 @@ public class AdditionalPropertiesNumber extends HashMap { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesObject.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesObject.java index 8272dcec080..c7bf488d2ff 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesObject.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesObject.java @@ -14,6 +14,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class AdditionalPropertiesObject extends HashMap { @JsonProperty("name") + private String name; public AdditionalPropertiesObject name(String name) { @@ -25,7 +26,7 @@ public class AdditionalPropertiesObject extends HashMap { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesString.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesString.java index 2ce4c9da5b0..0c2c8c1ebc4 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesString.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesString.java @@ -14,6 +14,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class AdditionalPropertiesString extends HashMap { @JsonProperty("name") + private String name; public AdditionalPropertiesString name(String name) { @@ -25,7 +26,7 @@ public class AdditionalPropertiesString extends HashMap { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java index ae6374df458..732c05a1468 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java @@ -14,9 +14,12 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Animal { @JsonProperty("className") + @NotNull + private String className; @JsonProperty("color") + private String color = "red"; public Animal className(String className) { @@ -28,7 +31,6 @@ public class Animal { * Get className * @return className **/ - @NotNull public String getClassName() { return className; } @@ -46,7 +48,7 @@ public class Animal { * Get color * @return color **/ - public String getColor() { + public String getColor() { return color; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfArrayOfNumberOnly.java index 34bb0c90e55..ba9e0d9bf44 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfArrayOfNumberOnly.java @@ -15,6 +15,8 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") + @Valid + private List> arrayArrayNumber = null; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { @@ -34,7 +36,6 @@ public class ArrayOfArrayOfNumberOnly { * Get arrayArrayNumber * @return arrayArrayNumber **/ - @Valid public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfNumberOnly.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfNumberOnly.java index 9b43b47fb44..bca0376c0e5 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfNumberOnly.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayOfNumberOnly.java @@ -15,6 +15,8 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") + @Valid + private List arrayNumber = null; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { @@ -34,7 +36,6 @@ public class ArrayOfNumberOnly { * Get arrayNumber * @return arrayNumber **/ - @Valid public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayTest.java index 0ba694f5f54..d9701181453 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ArrayTest.java @@ -15,12 +15,17 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ArrayTest { @JsonProperty("array_of_string") + private List arrayOfString = null; @JsonProperty("array_array_of_integer") + @Valid + private List> arrayArrayOfInteger = null; @JsonProperty("array_array_of_model") + @Valid + private List> arrayArrayOfModel = null; public ArrayTest arrayOfString(List arrayOfString) { @@ -40,7 +45,7 @@ public class ArrayTest { * Get arrayOfString * @return arrayOfString **/ - public List getArrayOfString() { + public List getArrayOfString() { return arrayOfString; } @@ -65,7 +70,6 @@ public class ArrayTest { * Get arrayArrayOfInteger * @return arrayArrayOfInteger **/ - @Valid public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -91,7 +95,6 @@ public class ArrayTest { * Get arrayArrayOfModel * @return arrayArrayOfModel **/ - @Valid public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCat.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCat.java index 79ad7c7eb4a..ac832bcfd82 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCat.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCat.java @@ -49,6 +49,7 @@ public class BigCat extends Cat { } @JsonProperty("kind") + private KindEnum kind; public BigCat kind(KindEnum kind) { @@ -60,7 +61,7 @@ public class BigCat extends Cat { * Get kind * @return kind **/ - public KindEnum getKind() { + public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCatAllOf.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCatAllOf.java index b5b3979aa40..c0e2cdeab1a 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCatAllOf.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/BigCatAllOf.java @@ -47,6 +47,7 @@ public class BigCatAllOf { } @JsonProperty("kind") + private KindEnum kind; public BigCatAllOf kind(KindEnum kind) { @@ -58,7 +59,7 @@ public class BigCatAllOf { * Get kind * @return kind **/ - public KindEnum getKind() { + public KindEnum getKind() { return kind; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java index 374b619f88f..adbe5dd10fa 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java @@ -12,21 +12,27 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Capitalization { @JsonProperty("smallCamel") + private String smallCamel; @JsonProperty("CapitalCamel") + private String capitalCamel; @JsonProperty("small_Snake") + private String smallSnake; @JsonProperty("Capital_Snake") + private String capitalSnake; @JsonProperty("SCA_ETH_Flow_Points") + private String scAETHFlowPoints; @JsonProperty("ATT_NAME") + private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { @@ -38,7 +44,7 @@ public class Capitalization { * Get smallCamel * @return smallCamel **/ - public String getSmallCamel() { + public String getSmallCamel() { return smallCamel; } @@ -55,7 +61,7 @@ public class Capitalization { * Get capitalCamel * @return capitalCamel **/ - public String getCapitalCamel() { + public String getCapitalCamel() { return capitalCamel; } @@ -72,7 +78,7 @@ public class Capitalization { * Get smallSnake * @return smallSnake **/ - public String getSmallSnake() { + public String getSmallSnake() { return smallSnake; } @@ -89,7 +95,7 @@ public class Capitalization { * Get capitalSnake * @return capitalSnake **/ - public String getCapitalSnake() { + public String getCapitalSnake() { return capitalSnake; } @@ -106,7 +112,7 @@ public class Capitalization { * Get scAETHFlowPoints * @return scAETHFlowPoints **/ - public String getScAETHFlowPoints() { + public String getScAETHFlowPoints() { return scAETHFlowPoints; } @@ -123,7 +129,7 @@ public class Capitalization { * Name of the pet * @return ATT_NAME **/ - public String getATTNAME() { + public String getATTNAME() { return ATT_NAME; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java index c414034cc40..7f4b72e2c49 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java @@ -14,6 +14,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Cat extends Animal { @JsonProperty("declawed") + private Boolean declawed; public Cat declawed(Boolean declawed) { @@ -25,7 +26,7 @@ public class Cat extends Animal { * Get declawed * @return declawed **/ - public Boolean getDeclawed() { + public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java index e6e3f5115cf..d9b481c439b 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java @@ -12,6 +12,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class CatAllOf { @JsonProperty("declawed") + private Boolean declawed; public CatAllOf declawed(Boolean declawed) { @@ -23,7 +24,7 @@ public class CatAllOf { * Get declawed * @return declawed **/ - public Boolean getDeclawed() { + public Boolean getDeclawed() { return declawed; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java index 63fc1cbb0f9..453ad7e2a95 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java @@ -12,9 +12,12 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") + private Long id; @JsonProperty("name") + @NotNull + private String name = "default-name"; public Category id(Long id) { @@ -26,7 +29,7 @@ public class Category { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +46,6 @@ public class Category { * Get name * @return name **/ - @NotNull public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java index ad5868b9bc6..a35a880dd0c 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java @@ -12,6 +12,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ClassModel { @JsonProperty("_class") + private String propertyClass; public ClassModel propertyClass(String propertyClass) { @@ -23,7 +24,7 @@ public class ClassModel { * Get propertyClass * @return propertyClass **/ - public String getPropertyClass() { + public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java index 2130dfdc2c9..e5792709a19 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java @@ -12,6 +12,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Client { @JsonProperty("client") + private String client; public Client client(String client) { @@ -23,7 +24,7 @@ public class Client { * Get client * @return client **/ - public String getClient() { + public String getClient() { return client; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java index 8404afdf715..f9d261dc5f8 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java @@ -14,6 +14,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Dog extends Animal { @JsonProperty("breed") + private String breed; public Dog breed(String breed) { @@ -25,7 +26,7 @@ public class Dog extends Animal { * Get breed * @return breed **/ - public String getBreed() { + public String getBreed() { return breed; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java index 98116a594d9..ea23e72c16e 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java @@ -12,6 +12,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class DogAllOf { @JsonProperty("breed") + private String breed; public DogAllOf breed(String breed) { @@ -23,7 +24,7 @@ public class DogAllOf { * Get breed * @return breed **/ - public String getBreed() { + public String getBreed() { return breed; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java index 3b80000144b..022ba7cea91 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java @@ -45,6 +45,7 @@ public class EnumArrays { } @JsonProperty("just_symbol") + private JustSymbolEnum justSymbol; /** @@ -79,6 +80,7 @@ public class EnumArrays { } @JsonProperty("array_enum") + private List arrayEnum = null; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { @@ -90,7 +92,7 @@ public class EnumArrays { * Get justSymbol * @return justSymbol **/ - public JustSymbolEnum getJustSymbol() { + public JustSymbolEnum getJustSymbol() { return justSymbol; } @@ -115,7 +117,7 @@ public class EnumArrays { * Get arrayEnum * @return arrayEnum **/ - public List getArrayEnum() { + public List getArrayEnum() { return arrayEnum; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java index 7f69d1bd531..fd50cfba92f 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java @@ -46,6 +46,7 @@ public class EnumTest { } @JsonProperty("enum_string") + private EnumStringEnum enumString; /** @@ -82,6 +83,8 @@ public class EnumTest { } @JsonProperty("enum_string_required") + @NotNull + private EnumStringRequiredEnum enumStringRequired; /** @@ -116,6 +119,7 @@ public class EnumTest { } @JsonProperty("enum_integer") + private EnumIntegerEnum enumInteger; /** @@ -150,9 +154,12 @@ public class EnumTest { } @JsonProperty("enum_number") + private EnumNumberEnum enumNumber; @JsonProperty("outerEnum") + @Valid + private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { @@ -164,7 +171,7 @@ public class EnumTest { * Get enumString * @return enumString **/ - public EnumStringEnum getEnumString() { + public EnumStringEnum getEnumString() { return enumString; } @@ -181,7 +188,6 @@ public class EnumTest { * Get enumStringRequired * @return enumStringRequired **/ - @NotNull public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } @@ -199,7 +205,7 @@ public class EnumTest { * Get enumInteger * @return enumInteger **/ - public EnumIntegerEnum getEnumInteger() { + public EnumIntegerEnum getEnumInteger() { return enumInteger; } @@ -216,7 +222,7 @@ public class EnumTest { * Get enumNumber * @return enumNumber **/ - public EnumNumberEnum getEnumNumber() { + public EnumNumberEnum getEnumNumber() { return enumNumber; } @@ -233,7 +239,6 @@ public class EnumTest { * Get outerEnum * @return outerEnum **/ - @Valid public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FileSchemaTestClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FileSchemaTestClass.java index c8c7a6c8e02..03d1c1b0cce 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FileSchemaTestClass.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FileSchemaTestClass.java @@ -14,9 +14,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class FileSchemaTestClass { @JsonProperty("file") + @Valid + private java.io.File file; @JsonProperty("files") + @Valid + private List files = null; public FileSchemaTestClass file(java.io.File file) { @@ -28,7 +32,6 @@ public class FileSchemaTestClass { * Get file * @return file **/ - @Valid public java.io.File getFile() { return file; } @@ -54,7 +57,6 @@ public class FileSchemaTestClass { * Get files * @return files **/ - @Valid public List getFiles() { return files; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java index 324eb807822..c202d9340e7 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java @@ -17,45 +17,82 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class FormatTest { @JsonProperty("integer") + @Min(10) +@Max(100) + private Integer integer; @JsonProperty("int32") + @Min(20) +@Max(200) + private Integer int32; @JsonProperty("int64") + private Long int64; @JsonProperty("number") + @NotNull +@DecimalMin("32.1") +@DecimalMax("543.2") +@Valid + private BigDecimal number; @JsonProperty("float") + @DecimalMin("54.3") +@DecimalMax("987.6") + private Float _float; @JsonProperty("double") + @DecimalMin("67.8") +@DecimalMax("123.4") + private Double _double; @JsonProperty("string") + @Pattern(regexp="/[a-z]/i") + private String string; @JsonProperty("byte") + @NotNull +@Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") + private byte[] _byte; @JsonProperty("binary") + @Valid + private InputStream binary; @JsonProperty("date") + @NotNull +@Valid + private LocalDate date; @JsonProperty("dateTime") + @Valid + private OffsetDateTime dateTime; @JsonProperty("uuid") + @Valid + private UUID uuid; @JsonProperty("password") + @NotNull +@Size(min=10,max=64) + private String password; @JsonProperty("BigDecimal") + @Valid + private BigDecimal bigDecimal; public FormatTest integer(Integer integer) { @@ -69,8 +106,6 @@ public class FormatTest { * maximum: 100 * @return integer **/ - @Min(10) -@Max(100) public Integer getInteger() { return integer; } @@ -90,8 +125,6 @@ public class FormatTest { * maximum: 200 * @return int32 **/ - @Min(20) -@Max(200) public Integer getInt32() { return int32; } @@ -109,7 +142,7 @@ public class FormatTest { * Get int64 * @return int64 **/ - public Long getInt64() { + public Long getInt64() { return int64; } @@ -128,10 +161,6 @@ public class FormatTest { * maximum: 543.2 * @return number **/ - @NotNull -@DecimalMin("32.1") -@DecimalMax("543.2") -@Valid public BigDecimal getNumber() { return number; } @@ -151,8 +180,6 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ - @DecimalMin("54.3") -@DecimalMax("987.6") public Float getFloat() { return _float; } @@ -172,8 +199,6 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ - @DecimalMin("67.8") -@DecimalMax("123.4") public Double getDouble() { return _double; } @@ -191,7 +216,6 @@ public class FormatTest { * Get string * @return string **/ - @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -209,8 +233,6 @@ public class FormatTest { * Get _byte * @return _byte **/ - @NotNull -@Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public byte[] getByte() { return _byte; } @@ -228,7 +250,6 @@ public class FormatTest { * Get binary * @return binary **/ - @Valid public InputStream getBinary() { return binary; } @@ -246,8 +267,6 @@ public class FormatTest { * Get date * @return date **/ - @NotNull -@Valid public LocalDate getDate() { return date; } @@ -265,7 +284,6 @@ public class FormatTest { * Get dateTime * @return dateTime **/ - @Valid public OffsetDateTime getDateTime() { return dateTime; } @@ -283,7 +301,6 @@ public class FormatTest { * Get uuid * @return uuid **/ - @Valid public UUID getUuid() { return uuid; } @@ -301,8 +318,6 @@ public class FormatTest { * Get password * @return password **/ - @NotNull -@Size(min=10,max=64) public String getPassword() { return password; } @@ -320,7 +335,6 @@ public class FormatTest { * Get bigDecimal * @return bigDecimal **/ - @Valid public BigDecimal getBigDecimal() { return bigDecimal; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java index 2afc42d8a82..fa8b55adabe 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class HasOnlyReadOnly { @JsonProperty("bar") + private String bar; @JsonProperty("foo") + private String foo; public HasOnlyReadOnly bar(String bar) { @@ -26,7 +28,7 @@ public class HasOnlyReadOnly { * Get bar * @return bar **/ - public String getBar() { + public String getBar() { return bar; } @@ -43,7 +45,7 @@ public class HasOnlyReadOnly { * Get foo * @return foo **/ - public String getFoo() { + public String getFoo() { return foo; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java index 32ca77aff2a..39fc7c4eeb7 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java @@ -15,6 +15,8 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class MapTest { @JsonProperty("map_map_of_string") + @Valid + private Map> mapMapOfString = null; /** @@ -49,12 +51,15 @@ public class MapTest { } @JsonProperty("map_of_enum_string") + private Map mapOfEnumString = null; @JsonProperty("direct_map") + private Map directMap = null; @JsonProperty("indirect_map") + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { @@ -74,7 +79,6 @@ public class MapTest { * Get mapMapOfString * @return mapMapOfString **/ - @Valid public Map> getMapMapOfString() { return mapMapOfString; } @@ -100,7 +104,7 @@ public class MapTest { * Get mapOfEnumString * @return mapOfEnumString **/ - public Map getMapOfEnumString() { + public Map getMapOfEnumString() { return mapOfEnumString; } @@ -125,7 +129,7 @@ public class MapTest { * Get directMap * @return directMap **/ - public Map getDirectMap() { + public Map getDirectMap() { return directMap; } @@ -150,7 +154,7 @@ public class MapTest { * Get indirectMap * @return indirectMap **/ - public Map getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java index e6f31ddfe8d..7a6477b1916 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java @@ -18,12 +18,18 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") + @Valid + private UUID uuid; @JsonProperty("dateTime") + @Valid + private OffsetDateTime dateTime; @JsonProperty("map") + @Valid + private Map map = null; public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { @@ -35,7 +41,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - @Valid public UUID getUuid() { return uuid; } @@ -53,7 +58,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get dateTime * @return dateTime **/ - @Valid public OffsetDateTime getDateTime() { return dateTime; } @@ -79,7 +83,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get map * @return map **/ - @Valid public Map getMap() { return map; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java index ab899b2a995..f0ca332d186 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Model200Response { @JsonProperty("name") + private Integer name; @JsonProperty("class") + private String propertyClass; public Model200Response name(Integer name) { @@ -26,7 +28,7 @@ public class Model200Response { * Get name * @return name **/ - public Integer getName() { + public Integer getName() { return name; } @@ -43,7 +45,7 @@ public class Model200Response { * Get propertyClass * @return propertyClass **/ - public String getPropertyClass() { + public String getPropertyClass() { return propertyClass; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java index 4fb0e8a18ae..75f9e7c5d46 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") + private Integer code; @JsonProperty("type") + private String type; @JsonProperty("message") + private String message; public ModelApiResponse code(Integer code) { @@ -29,7 +32,7 @@ public class ModelApiResponse { * Get code * @return code **/ - public Integer getCode() { + public Integer getCode() { return code; } @@ -46,7 +49,7 @@ public class ModelApiResponse { * Get type * @return type **/ - public String getType() { + public String getType() { return type; } @@ -63,7 +66,7 @@ public class ModelApiResponse { * Get message * @return message **/ - public String getMessage() { + public String getMessage() { return message; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java index dcefaa6f206..298399adb2a 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java @@ -12,6 +12,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelReturn { @JsonProperty("return") + private Integer _return; public ModelReturn _return(Integer _return) { @@ -23,7 +24,7 @@ public class ModelReturn { * Get _return * @return _return **/ - public Integer getReturn() { + public Integer getReturn() { return _return; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java index 2e5158056e9..232f49c5dce 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java @@ -12,15 +12,20 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Name { @JsonProperty("name") + @NotNull + private Integer name; @JsonProperty("snake_case") + private Integer snakeCase; @JsonProperty("property") + private String property; @JsonProperty("123Number") + private Integer _123number; public Name name(Integer name) { @@ -32,7 +37,6 @@ public class Name { * Get name * @return name **/ - @NotNull public Integer getName() { return name; } @@ -50,7 +54,7 @@ public class Name { * Get snakeCase * @return snakeCase **/ - public Integer getSnakeCase() { + public Integer getSnakeCase() { return snakeCase; } @@ -67,7 +71,7 @@ public class Name { * Get property * @return property **/ - public String getProperty() { + public String getProperty() { return property; } @@ -84,7 +88,7 @@ public class Name { * Get _123number * @return _123number **/ - public Integer get123number() { + public Integer get123number() { return _123number; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java index 05bea5047a3..bbcccc2ebe0 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java @@ -13,6 +13,8 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class NumberOnly { @JsonProperty("JustNumber") + @Valid + private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { @@ -24,7 +26,6 @@ public class NumberOnly { * Get justNumber * @return justNumber **/ - @Valid public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java index 499a6d5d89c..ad0b6c1e861 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java @@ -13,15 +13,20 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") + private Long id; @JsonProperty("petId") + private Long petId; @JsonProperty("quantity") + private Integer quantity; @JsonProperty("shipDate") + @Valid + private OffsetDateTime shipDate; /** @@ -58,9 +63,11 @@ public class Order { } @JsonProperty("status") + private StatusEnum status; @JsonProperty("complete") + private Boolean complete = false; public Order id(Long id) { @@ -72,7 +79,7 @@ public class Order { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -89,7 +96,7 @@ public class Order { * Get petId * @return petId **/ - public Long getPetId() { + public Long getPetId() { return petId; } @@ -106,7 +113,7 @@ public class Order { * Get quantity * @return quantity **/ - public Integer getQuantity() { + public Integer getQuantity() { return quantity; } @@ -123,7 +130,6 @@ public class Order { * Get shipDate * @return shipDate **/ - @Valid public OffsetDateTime getShipDate() { return shipDate; } @@ -141,7 +147,7 @@ public class Order { * Order Status * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } @@ -158,7 +164,7 @@ public class Order { * Get complete * @return complete **/ - public Boolean getComplete() { + public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java index bbd9a3380ba..3f19923097a 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java @@ -13,12 +13,16 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class OuterComposite { @JsonProperty("my_number") + @Valid + private BigDecimal myNumber; @JsonProperty("my_string") + private String myString; @JsonProperty("my_boolean") + private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { @@ -30,7 +34,6 @@ public class OuterComposite { * Get myNumber * @return myNumber **/ - @Valid public BigDecimal getMyNumber() { return myNumber; } @@ -48,7 +51,7 @@ public class OuterComposite { * Get myString * @return myString **/ - public String getMyString() { + public String getMyString() { return myString; } @@ -65,7 +68,7 @@ public class OuterComposite { * Get myBoolean * @return myBoolean **/ - public Boolean getMyBoolean() { + public Boolean getMyBoolean() { return myBoolean; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java index 0d0d6dee1c0..819d8d21474 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java @@ -18,18 +18,27 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") + private Long id; @JsonProperty("category") + @Valid + private Category category; @JsonProperty("name") + @NotNull + private String name; @JsonProperty("photoUrls") + @NotNull + private Set photoUrls = new LinkedHashSet<>(); @JsonProperty("tags") + @Valid + private List tags = null; /** @@ -66,6 +75,7 @@ public class Pet { } @JsonProperty("status") + private StatusEnum status; public Pet id(Long id) { @@ -77,7 +87,7 @@ public class Pet { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -94,7 +104,6 @@ public class Pet { * Get category * @return category **/ - @Valid public Category getCategory() { return category; } @@ -112,7 +121,6 @@ public class Pet { * Get name * @return name **/ - @NotNull public String getName() { return name; } @@ -135,7 +143,6 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @NotNull public Set getPhotoUrls() { return photoUrls; } @@ -161,7 +168,6 @@ public class Pet { * Get tags * @return tags **/ - @Valid public List getTags() { return tags; } @@ -179,7 +185,7 @@ public class Pet { * pet status in the store * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java index ca26ecae233..55d2816002b 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ReadOnlyFirst { @JsonProperty("bar") + private String bar; @JsonProperty("baz") + private String baz; public ReadOnlyFirst bar(String bar) { @@ -26,7 +28,7 @@ public class ReadOnlyFirst { * Get bar * @return bar **/ - public String getBar() { + public String getBar() { return bar; } @@ -43,7 +45,7 @@ public class ReadOnlyFirst { * Get baz * @return baz **/ - public String getBaz() { + public String getBaz() { return baz; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java index adcf5767490..dfbc01afecd 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java @@ -12,6 +12,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class SpecialModelName { @JsonProperty("$special[property.name]") + private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { @@ -23,7 +24,7 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName **/ - public Long get$SpecialPropertyName() { + public Long get$SpecialPropertyName() { return $specialPropertyName; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java index 212267844c1..39bceb93f4a 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Tag id(Long id) { @@ -26,7 +28,7 @@ public class Tag { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Tag { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderDefault.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderDefault.java index 74af3739b27..a8e52c7bfe5 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderDefault.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderDefault.java @@ -15,18 +15,29 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class TypeHolderDefault { @JsonProperty("string_item") + @NotNull + private String stringItem = "what"; @JsonProperty("number_item") + @NotNull +@Valid + private BigDecimal numberItem; @JsonProperty("integer_item") + @NotNull + private Integer integerItem; @JsonProperty("bool_item") + @NotNull + private Boolean boolItem = true; @JsonProperty("array_item") + @NotNull + private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { @@ -38,7 +49,6 @@ public class TypeHolderDefault { * Get stringItem * @return stringItem **/ - @NotNull public String getStringItem() { return stringItem; } @@ -56,8 +66,6 @@ public class TypeHolderDefault { * Get numberItem * @return numberItem **/ - @NotNull -@Valid public BigDecimal getNumberItem() { return numberItem; } @@ -75,7 +83,6 @@ public class TypeHolderDefault { * Get integerItem * @return integerItem **/ - @NotNull public Integer getIntegerItem() { return integerItem; } @@ -93,7 +100,6 @@ public class TypeHolderDefault { * Get boolItem * @return boolItem **/ - @NotNull public Boolean getBoolItem() { return boolItem; } @@ -116,7 +122,6 @@ public class TypeHolderDefault { * Get arrayItem * @return arrayItem **/ - @NotNull public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderExample.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderExample.java index 0f18d25f21e..7295c42a7b3 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderExample.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderExample.java @@ -15,21 +15,34 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class TypeHolderExample { @JsonProperty("string_item") + @NotNull + private String stringItem; @JsonProperty("number_item") + @NotNull +@Valid + private BigDecimal numberItem; @JsonProperty("float_item") + @NotNull + private Float floatItem; @JsonProperty("integer_item") + @NotNull + private Integer integerItem; @JsonProperty("bool_item") + @NotNull + private Boolean boolItem; @JsonProperty("array_item") + @NotNull + private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { @@ -41,7 +54,6 @@ public class TypeHolderExample { * Get stringItem * @return stringItem **/ - @NotNull public String getStringItem() { return stringItem; } @@ -59,8 +71,6 @@ public class TypeHolderExample { * Get numberItem * @return numberItem **/ - @NotNull -@Valid public BigDecimal getNumberItem() { return numberItem; } @@ -78,7 +88,6 @@ public class TypeHolderExample { * Get floatItem * @return floatItem **/ - @NotNull public Float getFloatItem() { return floatItem; } @@ -96,7 +105,6 @@ public class TypeHolderExample { * Get integerItem * @return integerItem **/ - @NotNull public Integer getIntegerItem() { return integerItem; } @@ -114,7 +122,6 @@ public class TypeHolderExample { * Get boolItem * @return boolItem **/ - @NotNull public Boolean getBoolItem() { return boolItem; } @@ -137,7 +144,6 @@ public class TypeHolderExample { * Get arrayItem * @return arrayItem **/ - @NotNull public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java index adf6aa8bae7..72ef978f3dc 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java @@ -12,27 +12,35 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") + private Long id; @JsonProperty("username") + private String username; @JsonProperty("firstName") + private String firstName; @JsonProperty("lastName") + private String lastName; @JsonProperty("email") + private String email; @JsonProperty("password") + private String password; @JsonProperty("phone") + private String phone; @JsonProperty("userStatus") + private Integer userStatus; public User id(Long id) { @@ -44,7 +52,7 @@ public class User { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -61,7 +69,7 @@ public class User { * Get username * @return username **/ - public String getUsername() { + public String getUsername() { return username; } @@ -78,7 +86,7 @@ public class User { * Get firstName * @return firstName **/ - public String getFirstName() { + public String getFirstName() { return firstName; } @@ -95,7 +103,7 @@ public class User { * Get lastName * @return lastName **/ - public String getLastName() { + public String getLastName() { return lastName; } @@ -112,7 +120,7 @@ public class User { * Get email * @return email **/ - public String getEmail() { + public String getEmail() { return email; } @@ -129,7 +137,7 @@ public class User { * Get password * @return password **/ - public String getPassword() { + public String getPassword() { return password; } @@ -146,7 +154,7 @@ public class User { * Get phone * @return phone **/ - public String getPhone() { + public String getPhone() { return phone; } @@ -163,7 +171,7 @@ public class User { * User Status * @return userStatus **/ - public Integer getUserStatus() { + public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/XmlItem.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/XmlItem.java index 31c65921b23..114918e3cf9 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/XmlItem.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/XmlItem.java @@ -15,90 +15,124 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class XmlItem { @JsonProperty("attribute_string") + private String attributeString; @JsonProperty("attribute_number") + @Valid + private BigDecimal attributeNumber; @JsonProperty("attribute_integer") + private Integer attributeInteger; @JsonProperty("attribute_boolean") + private Boolean attributeBoolean; @JsonProperty("wrapped_array") + private List wrappedArray = null; @JsonProperty("name_string") + private String nameString; @JsonProperty("name_number") + @Valid + private BigDecimal nameNumber; @JsonProperty("name_integer") + private Integer nameInteger; @JsonProperty("name_boolean") + private Boolean nameBoolean; @JsonProperty("name_array") + private List nameArray = null; @JsonProperty("name_wrapped_array") + private List nameWrappedArray = null; @JsonProperty("prefix_string") + private String prefixString; @JsonProperty("prefix_number") + @Valid + private BigDecimal prefixNumber; @JsonProperty("prefix_integer") + private Integer prefixInteger; @JsonProperty("prefix_boolean") + private Boolean prefixBoolean; @JsonProperty("prefix_array") + private List prefixArray = null; @JsonProperty("prefix_wrapped_array") + private List prefixWrappedArray = null; @JsonProperty("namespace_string") + private String namespaceString; @JsonProperty("namespace_number") + @Valid + private BigDecimal namespaceNumber; @JsonProperty("namespace_integer") + private Integer namespaceInteger; @JsonProperty("namespace_boolean") + private Boolean namespaceBoolean; @JsonProperty("namespace_array") + private List namespaceArray = null; @JsonProperty("namespace_wrapped_array") + private List namespaceWrappedArray = null; @JsonProperty("prefix_ns_string") + private String prefixNsString; @JsonProperty("prefix_ns_number") + @Valid + private BigDecimal prefixNsNumber; @JsonProperty("prefix_ns_integer") + private Integer prefixNsInteger; @JsonProperty("prefix_ns_boolean") + private Boolean prefixNsBoolean; @JsonProperty("prefix_ns_array") + private List prefixNsArray = null; @JsonProperty("prefix_ns_wrapped_array") + private List prefixNsWrappedArray = null; public XmlItem attributeString(String attributeString) { @@ -110,7 +144,7 @@ public class XmlItem { * Get attributeString * @return attributeString **/ - public String getAttributeString() { + public String getAttributeString() { return attributeString; } @@ -127,7 +161,6 @@ public class XmlItem { * Get attributeNumber * @return attributeNumber **/ - @Valid public BigDecimal getAttributeNumber() { return attributeNumber; } @@ -145,7 +178,7 @@ public class XmlItem { * Get attributeInteger * @return attributeInteger **/ - public Integer getAttributeInteger() { + public Integer getAttributeInteger() { return attributeInteger; } @@ -162,7 +195,7 @@ public class XmlItem { * Get attributeBoolean * @return attributeBoolean **/ - public Boolean getAttributeBoolean() { + public Boolean getAttributeBoolean() { return attributeBoolean; } @@ -187,7 +220,7 @@ public class XmlItem { * Get wrappedArray * @return wrappedArray **/ - public List getWrappedArray() { + public List getWrappedArray() { return wrappedArray; } @@ -204,7 +237,7 @@ public class XmlItem { * Get nameString * @return nameString **/ - public String getNameString() { + public String getNameString() { return nameString; } @@ -221,7 +254,6 @@ public class XmlItem { * Get nameNumber * @return nameNumber **/ - @Valid public BigDecimal getNameNumber() { return nameNumber; } @@ -239,7 +271,7 @@ public class XmlItem { * Get nameInteger * @return nameInteger **/ - public Integer getNameInteger() { + public Integer getNameInteger() { return nameInteger; } @@ -256,7 +288,7 @@ public class XmlItem { * Get nameBoolean * @return nameBoolean **/ - public Boolean getNameBoolean() { + public Boolean getNameBoolean() { return nameBoolean; } @@ -281,7 +313,7 @@ public class XmlItem { * Get nameArray * @return nameArray **/ - public List getNameArray() { + public List getNameArray() { return nameArray; } @@ -306,7 +338,7 @@ public class XmlItem { * Get nameWrappedArray * @return nameWrappedArray **/ - public List getNameWrappedArray() { + public List getNameWrappedArray() { return nameWrappedArray; } @@ -323,7 +355,7 @@ public class XmlItem { * Get prefixString * @return prefixString **/ - public String getPrefixString() { + public String getPrefixString() { return prefixString; } @@ -340,7 +372,6 @@ public class XmlItem { * Get prefixNumber * @return prefixNumber **/ - @Valid public BigDecimal getPrefixNumber() { return prefixNumber; } @@ -358,7 +389,7 @@ public class XmlItem { * Get prefixInteger * @return prefixInteger **/ - public Integer getPrefixInteger() { + public Integer getPrefixInteger() { return prefixInteger; } @@ -375,7 +406,7 @@ public class XmlItem { * Get prefixBoolean * @return prefixBoolean **/ - public Boolean getPrefixBoolean() { + public Boolean getPrefixBoolean() { return prefixBoolean; } @@ -400,7 +431,7 @@ public class XmlItem { * Get prefixArray * @return prefixArray **/ - public List getPrefixArray() { + public List getPrefixArray() { return prefixArray; } @@ -425,7 +456,7 @@ public class XmlItem { * Get prefixWrappedArray * @return prefixWrappedArray **/ - public List getPrefixWrappedArray() { + public List getPrefixWrappedArray() { return prefixWrappedArray; } @@ -442,7 +473,7 @@ public class XmlItem { * Get namespaceString * @return namespaceString **/ - public String getNamespaceString() { + public String getNamespaceString() { return namespaceString; } @@ -459,7 +490,6 @@ public class XmlItem { * Get namespaceNumber * @return namespaceNumber **/ - @Valid public BigDecimal getNamespaceNumber() { return namespaceNumber; } @@ -477,7 +507,7 @@ public class XmlItem { * Get namespaceInteger * @return namespaceInteger **/ - public Integer getNamespaceInteger() { + public Integer getNamespaceInteger() { return namespaceInteger; } @@ -494,7 +524,7 @@ public class XmlItem { * Get namespaceBoolean * @return namespaceBoolean **/ - public Boolean getNamespaceBoolean() { + public Boolean getNamespaceBoolean() { return namespaceBoolean; } @@ -519,7 +549,7 @@ public class XmlItem { * Get namespaceArray * @return namespaceArray **/ - public List getNamespaceArray() { + public List getNamespaceArray() { return namespaceArray; } @@ -544,7 +574,7 @@ public class XmlItem { * Get namespaceWrappedArray * @return namespaceWrappedArray **/ - public List getNamespaceWrappedArray() { + public List getNamespaceWrappedArray() { return namespaceWrappedArray; } @@ -561,7 +591,7 @@ public class XmlItem { * Get prefixNsString * @return prefixNsString **/ - public String getPrefixNsString() { + public String getPrefixNsString() { return prefixNsString; } @@ -578,7 +608,6 @@ public class XmlItem { * Get prefixNsNumber * @return prefixNsNumber **/ - @Valid public BigDecimal getPrefixNsNumber() { return prefixNsNumber; } @@ -596,7 +625,7 @@ public class XmlItem { * Get prefixNsInteger * @return prefixNsInteger **/ - public Integer getPrefixNsInteger() { + public Integer getPrefixNsInteger() { return prefixNsInteger; } @@ -613,7 +642,7 @@ public class XmlItem { * Get prefixNsBoolean * @return prefixNsBoolean **/ - public Boolean getPrefixNsBoolean() { + public Boolean getPrefixNsBoolean() { return prefixNsBoolean; } @@ -638,7 +667,7 @@ public class XmlItem { * Get prefixNsArray * @return prefixNsArray **/ - public List getPrefixNsArray() { + public List getPrefixNsArray() { return prefixNsArray; } @@ -663,7 +692,7 @@ public class XmlItem { * Get prefixNsWrappedArray * @return prefixNsWrappedArray **/ - public List getPrefixNsWrappedArray() { + public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/build.sbt b/samples/server/petstore/java-play-framework-fake-endpoints/build.sbt index 83a17e91013..b972893fc3f 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/build.sbt +++ b/samples/server/petstore/java-play-framework-fake-endpoints/build.sbt @@ -7,5 +7,5 @@ lazy val root = (project in file(".")).enablePlugins(PlayJava) scalaVersion := "2.12.6" libraryDependencies += "org.webjars" % "swagger-ui" % "3.32.5" -libraryDependencies += "javax.validation" % "validation-api" % "1.1.0.Final" +libraryDependencies += "javax.validation" % "validation-api" % "2.0.1.Final" libraryDependencies += guice diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java index bc4b68aa5f7..cd9f11b6c1d 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java @@ -25,7 +25,7 @@ public class Category { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -42,7 +42,7 @@ public class Category { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java index 2e8ae992ad4..8a08c1c5af3 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java @@ -28,7 +28,7 @@ public class ModelApiResponse { * Get code * @return code **/ - public Integer getCode() { + public Integer getCode() { return code; } @@ -45,7 +45,7 @@ public class ModelApiResponse { * Get type * @return type **/ - public String getType() { + public String getType() { return type; } @@ -62,7 +62,7 @@ public class ModelApiResponse { * Get message * @return message **/ - public String getMessage() { + public String getMessage() { return message; } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java index bb456ad63bb..d1783dc0b66 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java @@ -71,7 +71,7 @@ public class Order { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -88,7 +88,7 @@ public class Order { * Get petId * @return petId **/ - public Long getPetId() { + public Long getPetId() { return petId; } @@ -105,7 +105,7 @@ public class Order { * Get quantity * @return quantity **/ - public Integer getQuantity() { + public Integer getQuantity() { return quantity; } @@ -122,7 +122,7 @@ public class Order { * Get shipDate * @return shipDate **/ - public OffsetDateTime getShipDate() { + public OffsetDateTime getShipDate() { return shipDate; } @@ -139,7 +139,7 @@ public class Order { * Order Status * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } @@ -156,7 +156,7 @@ public class Order { * Get complete * @return complete **/ - public Boolean getComplete() { + public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java index 1350c191b34..d9c93499fb7 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java @@ -74,7 +74,7 @@ public class Pet { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -91,7 +91,7 @@ public class Pet { * Get category * @return category **/ - public Category getCategory() { + public Category getCategory() { return category; } @@ -108,7 +108,7 @@ public class Pet { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } @@ -130,7 +130,7 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - public List getPhotoUrls() { + public List getPhotoUrls() { return photoUrls; } @@ -155,7 +155,7 @@ public class Pet { * Get tags * @return tags **/ - public List getTags() { + public List getTags() { return tags; } @@ -172,7 +172,7 @@ public class Pet { * pet status in the store * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java index 519bb38813a..e6981d8065b 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java @@ -25,7 +25,7 @@ public class Tag { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -42,7 +42,7 @@ public class Tag { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java index 85af038c7ec..0d20e1f0852 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java @@ -43,7 +43,7 @@ public class User { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -60,7 +60,7 @@ public class User { * Get username * @return username **/ - public String getUsername() { + public String getUsername() { return username; } @@ -77,7 +77,7 @@ public class User { * Get firstName * @return firstName **/ - public String getFirstName() { + public String getFirstName() { return firstName; } @@ -94,7 +94,7 @@ public class User { * Get lastName * @return lastName **/ - public String getLastName() { + public String getLastName() { return lastName; } @@ -111,7 +111,7 @@ public class User { * Get email * @return email **/ - public String getEmail() { + public String getEmail() { return email; } @@ -128,7 +128,7 @@ public class User { * Get password * @return password **/ - public String getPassword() { + public String getPassword() { return password; } @@ -145,7 +145,7 @@ public class User { * Get phone * @return phone **/ - public String getPhone() { + public String getPhone() { return phone; } @@ -162,7 +162,7 @@ public class User { * User Status * @return userStatus **/ - public Integer getUserStatus() { + public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java index c6f15ca13c3..afed4d545a9 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Category id(Long id) { @@ -26,7 +28,7 @@ public class Category { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Category { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java index b99eabed6fd..820779a1cd9 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") + private Integer code; @JsonProperty("type") + private String type; @JsonProperty("message") + private String message; public ModelApiResponse code(Integer code) { @@ -29,7 +32,7 @@ public class ModelApiResponse { * Get code * @return code **/ - public Integer getCode() { + public Integer getCode() { return code; } @@ -46,7 +49,7 @@ public class ModelApiResponse { * Get type * @return type **/ - public String getType() { + public String getType() { return type; } @@ -63,7 +66,7 @@ public class ModelApiResponse { * Get message * @return message **/ - public String getMessage() { + public String getMessage() { return message; } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java index 2d378562807..d54cba148ad 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java @@ -13,15 +13,20 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") + private Long id; @JsonProperty("petId") + private Long petId; @JsonProperty("quantity") + private Integer quantity; @JsonProperty("shipDate") + @Valid + private OffsetDateTime shipDate; /** @@ -58,9 +63,11 @@ public class Order { } @JsonProperty("status") + private StatusEnum status; @JsonProperty("complete") + private Boolean complete = false; public Order id(Long id) { @@ -72,7 +79,7 @@ public class Order { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -89,7 +96,7 @@ public class Order { * Get petId * @return petId **/ - public Long getPetId() { + public Long getPetId() { return petId; } @@ -106,7 +113,7 @@ public class Order { * Get quantity * @return quantity **/ - public Integer getQuantity() { + public Integer getQuantity() { return quantity; } @@ -123,7 +130,6 @@ public class Order { * Get shipDate * @return shipDate **/ - @Valid public OffsetDateTime getShipDate() { return shipDate; } @@ -141,7 +147,7 @@ public class Order { * Order Status * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } @@ -158,7 +164,7 @@ public class Order { * Get complete * @return complete **/ - public Boolean getComplete() { + public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java index f6c95ac4e9e..4699f7235ed 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java @@ -16,18 +16,27 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") + private Long id; @JsonProperty("category") + @Valid + private Category category; @JsonProperty("name") + @NotNull + private String name; @JsonProperty("photoUrls") + @NotNull + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") + @Valid + private List tags = null; /** @@ -64,6 +73,7 @@ public class Pet { } @JsonProperty("status") + private StatusEnum status; public Pet id(Long id) { @@ -75,7 +85,7 @@ public class Pet { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -92,7 +102,6 @@ public class Pet { * Get category * @return category **/ - @Valid public Category getCategory() { return category; } @@ -110,7 +119,6 @@ public class Pet { * Get name * @return name **/ - @NotNull public String getName() { return name; } @@ -133,7 +141,6 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @NotNull public List getPhotoUrls() { return photoUrls; } @@ -159,7 +166,6 @@ public class Pet { * Get tags * @return tags **/ - @Valid public List getTags() { return tags; } @@ -177,7 +183,7 @@ public class Pet { * pet status in the store * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java index 47799f61395..adac882cd05 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Tag id(Long id) { @@ -26,7 +28,7 @@ public class Tag { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Tag { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java index dc119d03edf..4e5d397b990 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java @@ -12,27 +12,35 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") + private Long id; @JsonProperty("username") + private String username; @JsonProperty("firstName") + private String firstName; @JsonProperty("lastName") + private String lastName; @JsonProperty("email") + private String email; @JsonProperty("password") + private String password; @JsonProperty("phone") + private String phone; @JsonProperty("userStatus") + private Integer userStatus; public User id(Long id) { @@ -44,7 +52,7 @@ public class User { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -61,7 +69,7 @@ public class User { * Get username * @return username **/ - public String getUsername() { + public String getUsername() { return username; } @@ -78,7 +86,7 @@ public class User { * Get firstName * @return firstName **/ - public String getFirstName() { + public String getFirstName() { return firstName; } @@ -95,7 +103,7 @@ public class User { * Get lastName * @return lastName **/ - public String getLastName() { + public String getLastName() { return lastName; } @@ -112,7 +120,7 @@ public class User { * Get email * @return email **/ - public String getEmail() { + public String getEmail() { return email; } @@ -129,7 +137,7 @@ public class User { * Get password * @return password **/ - public String getPassword() { + public String getPassword() { return password; } @@ -146,7 +154,7 @@ public class User { * Get phone * @return phone **/ - public String getPhone() { + public String getPhone() { return phone; } @@ -163,7 +171,7 @@ public class User { * User Status * @return userStatus **/ - public Integer getUserStatus() { + public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/build.sbt b/samples/server/petstore/java-play-framework-no-exception-handling/build.sbt index 83a17e91013..b972893fc3f 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/build.sbt +++ b/samples/server/petstore/java-play-framework-no-exception-handling/build.sbt @@ -7,5 +7,5 @@ lazy val root = (project in file(".")).enablePlugins(PlayJava) scalaVersion := "2.12.6" libraryDependencies += "org.webjars" % "swagger-ui" % "3.32.5" -libraryDependencies += "javax.validation" % "validation-api" % "1.1.0.Final" +libraryDependencies += "javax.validation" % "validation-api" % "2.0.1.Final" libraryDependencies += guice diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java index c6f15ca13c3..afed4d545a9 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Category id(Long id) { @@ -26,7 +28,7 @@ public class Category { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Category { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java index b99eabed6fd..820779a1cd9 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") + private Integer code; @JsonProperty("type") + private String type; @JsonProperty("message") + private String message; public ModelApiResponse code(Integer code) { @@ -29,7 +32,7 @@ public class ModelApiResponse { * Get code * @return code **/ - public Integer getCode() { + public Integer getCode() { return code; } @@ -46,7 +49,7 @@ public class ModelApiResponse { * Get type * @return type **/ - public String getType() { + public String getType() { return type; } @@ -63,7 +66,7 @@ public class ModelApiResponse { * Get message * @return message **/ - public String getMessage() { + public String getMessage() { return message; } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java index 2d378562807..d54cba148ad 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java @@ -13,15 +13,20 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") + private Long id; @JsonProperty("petId") + private Long petId; @JsonProperty("quantity") + private Integer quantity; @JsonProperty("shipDate") + @Valid + private OffsetDateTime shipDate; /** @@ -58,9 +63,11 @@ public class Order { } @JsonProperty("status") + private StatusEnum status; @JsonProperty("complete") + private Boolean complete = false; public Order id(Long id) { @@ -72,7 +79,7 @@ public class Order { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -89,7 +96,7 @@ public class Order { * Get petId * @return petId **/ - public Long getPetId() { + public Long getPetId() { return petId; } @@ -106,7 +113,7 @@ public class Order { * Get quantity * @return quantity **/ - public Integer getQuantity() { + public Integer getQuantity() { return quantity; } @@ -123,7 +130,6 @@ public class Order { * Get shipDate * @return shipDate **/ - @Valid public OffsetDateTime getShipDate() { return shipDate; } @@ -141,7 +147,7 @@ public class Order { * Order Status * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } @@ -158,7 +164,7 @@ public class Order { * Get complete * @return complete **/ - public Boolean getComplete() { + public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java index f6c95ac4e9e..4699f7235ed 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java @@ -16,18 +16,27 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") + private Long id; @JsonProperty("category") + @Valid + private Category category; @JsonProperty("name") + @NotNull + private String name; @JsonProperty("photoUrls") + @NotNull + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") + @Valid + private List tags = null; /** @@ -64,6 +73,7 @@ public class Pet { } @JsonProperty("status") + private StatusEnum status; public Pet id(Long id) { @@ -75,7 +85,7 @@ public class Pet { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -92,7 +102,6 @@ public class Pet { * Get category * @return category **/ - @Valid public Category getCategory() { return category; } @@ -110,7 +119,6 @@ public class Pet { * Get name * @return name **/ - @NotNull public String getName() { return name; } @@ -133,7 +141,6 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @NotNull public List getPhotoUrls() { return photoUrls; } @@ -159,7 +166,6 @@ public class Pet { * Get tags * @return tags **/ - @Valid public List getTags() { return tags; } @@ -177,7 +183,7 @@ public class Pet { * pet status in the store * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java index 47799f61395..adac882cd05 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Tag id(Long id) { @@ -26,7 +28,7 @@ public class Tag { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Tag { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java index dc119d03edf..4e5d397b990 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java @@ -12,27 +12,35 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") + private Long id; @JsonProperty("username") + private String username; @JsonProperty("firstName") + private String firstName; @JsonProperty("lastName") + private String lastName; @JsonProperty("email") + private String email; @JsonProperty("password") + private String password; @JsonProperty("phone") + private String phone; @JsonProperty("userStatus") + private Integer userStatus; public User id(Long id) { @@ -44,7 +52,7 @@ public class User { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -61,7 +69,7 @@ public class User { * Get username * @return username **/ - public String getUsername() { + public String getUsername() { return username; } @@ -78,7 +86,7 @@ public class User { * Get firstName * @return firstName **/ - public String getFirstName() { + public String getFirstName() { return firstName; } @@ -95,7 +103,7 @@ public class User { * Get lastName * @return lastName **/ - public String getLastName() { + public String getLastName() { return lastName; } @@ -112,7 +120,7 @@ public class User { * Get email * @return email **/ - public String getEmail() { + public String getEmail() { return email; } @@ -129,7 +137,7 @@ public class User { * Get password * @return password **/ - public String getPassword() { + public String getPassword() { return password; } @@ -146,7 +154,7 @@ public class User { * Get phone * @return phone **/ - public String getPhone() { + public String getPhone() { return phone; } @@ -163,7 +171,7 @@ public class User { * User Status * @return userStatus **/ - public Integer getUserStatus() { + public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/java-play-framework-no-interface/build.sbt b/samples/server/petstore/java-play-framework-no-interface/build.sbt index 83a17e91013..b972893fc3f 100644 --- a/samples/server/petstore/java-play-framework-no-interface/build.sbt +++ b/samples/server/petstore/java-play-framework-no-interface/build.sbt @@ -7,5 +7,5 @@ lazy val root = (project in file(".")).enablePlugins(PlayJava) scalaVersion := "2.12.6" libraryDependencies += "org.webjars" % "swagger-ui" % "3.32.5" -libraryDependencies += "javax.validation" % "validation-api" % "1.1.0.Final" +libraryDependencies += "javax.validation" % "validation-api" % "2.0.1.Final" libraryDependencies += guice diff --git a/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Category.java index c6f15ca13c3..afed4d545a9 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Category.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Category id(Long id) { @@ -26,7 +28,7 @@ public class Category { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Category { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/ModelApiResponse.java index b99eabed6fd..820779a1cd9 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/ModelApiResponse.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") + private Integer code; @JsonProperty("type") + private String type; @JsonProperty("message") + private String message; public ModelApiResponse code(Integer code) { @@ -29,7 +32,7 @@ public class ModelApiResponse { * Get code * @return code **/ - public Integer getCode() { + public Integer getCode() { return code; } @@ -46,7 +49,7 @@ public class ModelApiResponse { * Get type * @return type **/ - public String getType() { + public String getType() { return type; } @@ -63,7 +66,7 @@ public class ModelApiResponse { * Get message * @return message **/ - public String getMessage() { + public String getMessage() { return message; } diff --git a/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Order.java index 2d378562807..d54cba148ad 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Order.java @@ -13,15 +13,20 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") + private Long id; @JsonProperty("petId") + private Long petId; @JsonProperty("quantity") + private Integer quantity; @JsonProperty("shipDate") + @Valid + private OffsetDateTime shipDate; /** @@ -58,9 +63,11 @@ public class Order { } @JsonProperty("status") + private StatusEnum status; @JsonProperty("complete") + private Boolean complete = false; public Order id(Long id) { @@ -72,7 +79,7 @@ public class Order { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -89,7 +96,7 @@ public class Order { * Get petId * @return petId **/ - public Long getPetId() { + public Long getPetId() { return petId; } @@ -106,7 +113,7 @@ public class Order { * Get quantity * @return quantity **/ - public Integer getQuantity() { + public Integer getQuantity() { return quantity; } @@ -123,7 +130,6 @@ public class Order { * Get shipDate * @return shipDate **/ - @Valid public OffsetDateTime getShipDate() { return shipDate; } @@ -141,7 +147,7 @@ public class Order { * Order Status * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } @@ -158,7 +164,7 @@ public class Order { * Get complete * @return complete **/ - public Boolean getComplete() { + public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Pet.java index f6c95ac4e9e..4699f7235ed 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Pet.java @@ -16,18 +16,27 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") + private Long id; @JsonProperty("category") + @Valid + private Category category; @JsonProperty("name") + @NotNull + private String name; @JsonProperty("photoUrls") + @NotNull + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") + @Valid + private List tags = null; /** @@ -64,6 +73,7 @@ public class Pet { } @JsonProperty("status") + private StatusEnum status; public Pet id(Long id) { @@ -75,7 +85,7 @@ public class Pet { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -92,7 +102,6 @@ public class Pet { * Get category * @return category **/ - @Valid public Category getCategory() { return category; } @@ -110,7 +119,6 @@ public class Pet { * Get name * @return name **/ - @NotNull public String getName() { return name; } @@ -133,7 +141,6 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @NotNull public List getPhotoUrls() { return photoUrls; } @@ -159,7 +166,6 @@ public class Pet { * Get tags * @return tags **/ - @Valid public List getTags() { return tags; } @@ -177,7 +183,7 @@ public class Pet { * pet status in the store * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Tag.java index 47799f61395..adac882cd05 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/Tag.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Tag id(Long id) { @@ -26,7 +28,7 @@ public class Tag { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Tag { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/User.java index dc119d03edf..4e5d397b990 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-nullable/app/apimodels/User.java @@ -12,27 +12,35 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") + private Long id; @JsonProperty("username") + private String username; @JsonProperty("firstName") + private String firstName; @JsonProperty("lastName") + private String lastName; @JsonProperty("email") + private String email; @JsonProperty("password") + private String password; @JsonProperty("phone") + private String phone; @JsonProperty("userStatus") + private Integer userStatus; public User id(Long id) { @@ -44,7 +52,7 @@ public class User { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -61,7 +69,7 @@ public class User { * Get username * @return username **/ - public String getUsername() { + public String getUsername() { return username; } @@ -78,7 +86,7 @@ public class User { * Get firstName * @return firstName **/ - public String getFirstName() { + public String getFirstName() { return firstName; } @@ -95,7 +103,7 @@ public class User { * Get lastName * @return lastName **/ - public String getLastName() { + public String getLastName() { return lastName; } @@ -112,7 +120,7 @@ public class User { * Get email * @return email **/ - public String getEmail() { + public String getEmail() { return email; } @@ -129,7 +137,7 @@ public class User { * Get password * @return password **/ - public String getPassword() { + public String getPassword() { return password; } @@ -146,7 +154,7 @@ public class User { * Get phone * @return phone **/ - public String getPhone() { + public String getPhone() { return phone; } @@ -163,7 +171,7 @@ public class User { * User Status * @return userStatus **/ - public Integer getUserStatus() { + public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/java-play-framework-no-nullable/build.sbt b/samples/server/petstore/java-play-framework-no-nullable/build.sbt index 83a17e91013..b972893fc3f 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/build.sbt +++ b/samples/server/petstore/java-play-framework-no-nullable/build.sbt @@ -7,5 +7,5 @@ lazy val root = (project in file(".")).enablePlugins(PlayJava) scalaVersion := "2.12.6" libraryDependencies += "org.webjars" % "swagger-ui" % "3.32.5" -libraryDependencies += "javax.validation" % "validation-api" % "1.1.0.Final" +libraryDependencies += "javax.validation" % "validation-api" % "2.0.1.Final" libraryDependencies += guice diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java index c6f15ca13c3..afed4d545a9 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Category id(Long id) { @@ -26,7 +28,7 @@ public class Category { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Category { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java index b99eabed6fd..820779a1cd9 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") + private Integer code; @JsonProperty("type") + private String type; @JsonProperty("message") + private String message; public ModelApiResponse code(Integer code) { @@ -29,7 +32,7 @@ public class ModelApiResponse { * Get code * @return code **/ - public Integer getCode() { + public Integer getCode() { return code; } @@ -46,7 +49,7 @@ public class ModelApiResponse { * Get type * @return type **/ - public String getType() { + public String getType() { return type; } @@ -63,7 +66,7 @@ public class ModelApiResponse { * Get message * @return message **/ - public String getMessage() { + public String getMessage() { return message; } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java index 2d378562807..d54cba148ad 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java @@ -13,15 +13,20 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") + private Long id; @JsonProperty("petId") + private Long petId; @JsonProperty("quantity") + private Integer quantity; @JsonProperty("shipDate") + @Valid + private OffsetDateTime shipDate; /** @@ -58,9 +63,11 @@ public class Order { } @JsonProperty("status") + private StatusEnum status; @JsonProperty("complete") + private Boolean complete = false; public Order id(Long id) { @@ -72,7 +79,7 @@ public class Order { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -89,7 +96,7 @@ public class Order { * Get petId * @return petId **/ - public Long getPetId() { + public Long getPetId() { return petId; } @@ -106,7 +113,7 @@ public class Order { * Get quantity * @return quantity **/ - public Integer getQuantity() { + public Integer getQuantity() { return quantity; } @@ -123,7 +130,6 @@ public class Order { * Get shipDate * @return shipDate **/ - @Valid public OffsetDateTime getShipDate() { return shipDate; } @@ -141,7 +147,7 @@ public class Order { * Order Status * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } @@ -158,7 +164,7 @@ public class Order { * Get complete * @return complete **/ - public Boolean getComplete() { + public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java index f6c95ac4e9e..4699f7235ed 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java @@ -16,18 +16,27 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") + private Long id; @JsonProperty("category") + @Valid + private Category category; @JsonProperty("name") + @NotNull + private String name; @JsonProperty("photoUrls") + @NotNull + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") + @Valid + private List tags = null; /** @@ -64,6 +73,7 @@ public class Pet { } @JsonProperty("status") + private StatusEnum status; public Pet id(Long id) { @@ -75,7 +85,7 @@ public class Pet { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -92,7 +102,6 @@ public class Pet { * Get category * @return category **/ - @Valid public Category getCategory() { return category; } @@ -110,7 +119,6 @@ public class Pet { * Get name * @return name **/ - @NotNull public String getName() { return name; } @@ -133,7 +141,6 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @NotNull public List getPhotoUrls() { return photoUrls; } @@ -159,7 +166,6 @@ public class Pet { * Get tags * @return tags **/ - @Valid public List getTags() { return tags; } @@ -177,7 +183,7 @@ public class Pet { * pet status in the store * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java index 47799f61395..adac882cd05 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Tag id(Long id) { @@ -26,7 +28,7 @@ public class Tag { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Tag { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java index dc119d03edf..4e5d397b990 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java @@ -12,27 +12,35 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") + private Long id; @JsonProperty("username") + private String username; @JsonProperty("firstName") + private String firstName; @JsonProperty("lastName") + private String lastName; @JsonProperty("email") + private String email; @JsonProperty("password") + private String password; @JsonProperty("phone") + private String phone; @JsonProperty("userStatus") + private Integer userStatus; public User id(Long id) { @@ -44,7 +52,7 @@ public class User { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -61,7 +69,7 @@ public class User { * Get username * @return username **/ - public String getUsername() { + public String getUsername() { return username; } @@ -78,7 +86,7 @@ public class User { * Get firstName * @return firstName **/ - public String getFirstName() { + public String getFirstName() { return firstName; } @@ -95,7 +103,7 @@ public class User { * Get lastName * @return lastName **/ - public String getLastName() { + public String getLastName() { return lastName; } @@ -112,7 +120,7 @@ public class User { * Get email * @return email **/ - public String getEmail() { + public String getEmail() { return email; } @@ -129,7 +137,7 @@ public class User { * Get password * @return password **/ - public String getPassword() { + public String getPassword() { return password; } @@ -146,7 +154,7 @@ public class User { * Get phone * @return phone **/ - public String getPhone() { + public String getPhone() { return phone; } @@ -163,7 +171,7 @@ public class User { * User Status * @return userStatus **/ - public Integer getUserStatus() { + public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/build.sbt b/samples/server/petstore/java-play-framework-no-swagger-ui/build.sbt index 2b56ff7331c..45bebc24cf0 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/build.sbt +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/build.sbt @@ -6,5 +6,5 @@ lazy val root = (project in file(".")).enablePlugins(PlayJava) scalaVersion := "2.12.6" -libraryDependencies += "javax.validation" % "validation-api" % "1.1.0.Final" +libraryDependencies += "javax.validation" % "validation-api" % "2.0.1.Final" libraryDependencies += guice diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java index c6f15ca13c3..afed4d545a9 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Category id(Long id) { @@ -26,7 +28,7 @@ public class Category { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Category { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java index b99eabed6fd..820779a1cd9 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") + private Integer code; @JsonProperty("type") + private String type; @JsonProperty("message") + private String message; public ModelApiResponse code(Integer code) { @@ -29,7 +32,7 @@ public class ModelApiResponse { * Get code * @return code **/ - public Integer getCode() { + public Integer getCode() { return code; } @@ -46,7 +49,7 @@ public class ModelApiResponse { * Get type * @return type **/ - public String getType() { + public String getType() { return type; } @@ -63,7 +66,7 @@ public class ModelApiResponse { * Get message * @return message **/ - public String getMessage() { + public String getMessage() { return message; } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java index 2d378562807..d54cba148ad 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java @@ -13,15 +13,20 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") + private Long id; @JsonProperty("petId") + private Long petId; @JsonProperty("quantity") + private Integer quantity; @JsonProperty("shipDate") + @Valid + private OffsetDateTime shipDate; /** @@ -58,9 +63,11 @@ public class Order { } @JsonProperty("status") + private StatusEnum status; @JsonProperty("complete") + private Boolean complete = false; public Order id(Long id) { @@ -72,7 +79,7 @@ public class Order { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -89,7 +96,7 @@ public class Order { * Get petId * @return petId **/ - public Long getPetId() { + public Long getPetId() { return petId; } @@ -106,7 +113,7 @@ public class Order { * Get quantity * @return quantity **/ - public Integer getQuantity() { + public Integer getQuantity() { return quantity; } @@ -123,7 +130,6 @@ public class Order { * Get shipDate * @return shipDate **/ - @Valid public OffsetDateTime getShipDate() { return shipDate; } @@ -141,7 +147,7 @@ public class Order { * Order Status * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } @@ -158,7 +164,7 @@ public class Order { * Get complete * @return complete **/ - public Boolean getComplete() { + public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java index f6c95ac4e9e..4699f7235ed 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java @@ -16,18 +16,27 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") + private Long id; @JsonProperty("category") + @Valid + private Category category; @JsonProperty("name") + @NotNull + private String name; @JsonProperty("photoUrls") + @NotNull + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") + @Valid + private List tags = null; /** @@ -64,6 +73,7 @@ public class Pet { } @JsonProperty("status") + private StatusEnum status; public Pet id(Long id) { @@ -75,7 +85,7 @@ public class Pet { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -92,7 +102,6 @@ public class Pet { * Get category * @return category **/ - @Valid public Category getCategory() { return category; } @@ -110,7 +119,6 @@ public class Pet { * Get name * @return name **/ - @NotNull public String getName() { return name; } @@ -133,7 +141,6 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @NotNull public List getPhotoUrls() { return photoUrls; } @@ -159,7 +166,6 @@ public class Pet { * Get tags * @return tags **/ - @Valid public List getTags() { return tags; } @@ -177,7 +183,7 @@ public class Pet { * pet status in the store * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java index 47799f61395..adac882cd05 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Tag id(Long id) { @@ -26,7 +28,7 @@ public class Tag { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Tag { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java index dc119d03edf..4e5d397b990 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java @@ -12,27 +12,35 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") + private Long id; @JsonProperty("username") + private String username; @JsonProperty("firstName") + private String firstName; @JsonProperty("lastName") + private String lastName; @JsonProperty("email") + private String email; @JsonProperty("password") + private String password; @JsonProperty("phone") + private String phone; @JsonProperty("userStatus") + private Integer userStatus; public User id(Long id) { @@ -44,7 +52,7 @@ public class User { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -61,7 +69,7 @@ public class User { * Get username * @return username **/ - public String getUsername() { + public String getUsername() { return username; } @@ -78,7 +86,7 @@ public class User { * Get firstName * @return firstName **/ - public String getFirstName() { + public String getFirstName() { return firstName; } @@ -95,7 +103,7 @@ public class User { * Get lastName * @return lastName **/ - public String getLastName() { + public String getLastName() { return lastName; } @@ -112,7 +120,7 @@ public class User { * Get email * @return email **/ - public String getEmail() { + public String getEmail() { return email; } @@ -129,7 +137,7 @@ public class User { * Get password * @return password **/ - public String getPassword() { + public String getPassword() { return password; } @@ -146,7 +154,7 @@ public class User { * Get phone * @return phone **/ - public String getPhone() { + public String getPhone() { return phone; } @@ -163,7 +171,7 @@ public class User { * User Status * @return userStatus **/ - public Integer getUserStatus() { + public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/build.sbt b/samples/server/petstore/java-play-framework-no-wrap-calls/build.sbt index 83a17e91013..b972893fc3f 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/build.sbt +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/build.sbt @@ -7,5 +7,5 @@ lazy val root = (project in file(".")).enablePlugins(PlayJava) scalaVersion := "2.12.6" libraryDependencies += "org.webjars" % "swagger-ui" % "3.32.5" -libraryDependencies += "javax.validation" % "validation-api" % "1.1.0.Final" +libraryDependencies += "javax.validation" % "validation-api" % "2.0.1.Final" libraryDependencies += guice diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Category.java b/samples/server/petstore/java-play-framework/app/apimodels/Category.java index c6f15ca13c3..afed4d545a9 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Category.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Category id(Long id) { @@ -26,7 +28,7 @@ public class Category { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Category { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java index b99eabed6fd..820779a1cd9 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java @@ -12,12 +12,15 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") + private Integer code; @JsonProperty("type") + private String type; @JsonProperty("message") + private String message; public ModelApiResponse code(Integer code) { @@ -29,7 +32,7 @@ public class ModelApiResponse { * Get code * @return code **/ - public Integer getCode() { + public Integer getCode() { return code; } @@ -46,7 +49,7 @@ public class ModelApiResponse { * Get type * @return type **/ - public String getType() { + public String getType() { return type; } @@ -63,7 +66,7 @@ public class ModelApiResponse { * Get message * @return message **/ - public String getMessage() { + public String getMessage() { return message; } diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Order.java b/samples/server/petstore/java-play-framework/app/apimodels/Order.java index 2d378562807..d54cba148ad 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Order.java @@ -13,15 +13,20 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") + private Long id; @JsonProperty("petId") + private Long petId; @JsonProperty("quantity") + private Integer quantity; @JsonProperty("shipDate") + @Valid + private OffsetDateTime shipDate; /** @@ -58,9 +63,11 @@ public class Order { } @JsonProperty("status") + private StatusEnum status; @JsonProperty("complete") + private Boolean complete = false; public Order id(Long id) { @@ -72,7 +79,7 @@ public class Order { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -89,7 +96,7 @@ public class Order { * Get petId * @return petId **/ - public Long getPetId() { + public Long getPetId() { return petId; } @@ -106,7 +113,7 @@ public class Order { * Get quantity * @return quantity **/ - public Integer getQuantity() { + public Integer getQuantity() { return quantity; } @@ -123,7 +130,6 @@ public class Order { * Get shipDate * @return shipDate **/ - @Valid public OffsetDateTime getShipDate() { return shipDate; } @@ -141,7 +147,7 @@ public class Order { * Order Status * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } @@ -158,7 +164,7 @@ public class Order { * Get complete * @return complete **/ - public Boolean getComplete() { + public Boolean getComplete() { return complete; } diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java index f6c95ac4e9e..4699f7235ed 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java @@ -16,18 +16,27 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") + private Long id; @JsonProperty("category") + @Valid + private Category category; @JsonProperty("name") + @NotNull + private String name; @JsonProperty("photoUrls") + @NotNull + private List photoUrls = new ArrayList<>(); @JsonProperty("tags") + @Valid + private List tags = null; /** @@ -64,6 +73,7 @@ public class Pet { } @JsonProperty("status") + private StatusEnum status; public Pet id(Long id) { @@ -75,7 +85,7 @@ public class Pet { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -92,7 +102,6 @@ public class Pet { * Get category * @return category **/ - @Valid public Category getCategory() { return category; } @@ -110,7 +119,6 @@ public class Pet { * Get name * @return name **/ - @NotNull public String getName() { return name; } @@ -133,7 +141,6 @@ public class Pet { * Get photoUrls * @return photoUrls **/ - @NotNull public List getPhotoUrls() { return photoUrls; } @@ -159,7 +166,6 @@ public class Pet { * Get tags * @return tags **/ - @Valid public List getTags() { return tags; } @@ -177,7 +183,7 @@ public class Pet { * pet status in the store * @return status **/ - public StatusEnum getStatus() { + public StatusEnum getStatus() { return status; } diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework/app/apimodels/Tag.java index 47799f61395..adac882cd05 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Tag.java @@ -12,9 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") + private Long id; @JsonProperty("name") + private String name; public Tag id(Long id) { @@ -26,7 +28,7 @@ public class Tag { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -43,7 +45,7 @@ public class Tag { * Get name * @return name **/ - public String getName() { + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework/app/apimodels/User.java b/samples/server/petstore/java-play-framework/app/apimodels/User.java index dc119d03edf..4e5d397b990 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/User.java @@ -12,27 +12,35 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") + private Long id; @JsonProperty("username") + private String username; @JsonProperty("firstName") + private String firstName; @JsonProperty("lastName") + private String lastName; @JsonProperty("email") + private String email; @JsonProperty("password") + private String password; @JsonProperty("phone") + private String phone; @JsonProperty("userStatus") + private Integer userStatus; public User id(Long id) { @@ -44,7 +52,7 @@ public class User { * Get id * @return id **/ - public Long getId() { + public Long getId() { return id; } @@ -61,7 +69,7 @@ public class User { * Get username * @return username **/ - public String getUsername() { + public String getUsername() { return username; } @@ -78,7 +86,7 @@ public class User { * Get firstName * @return firstName **/ - public String getFirstName() { + public String getFirstName() { return firstName; } @@ -95,7 +103,7 @@ public class User { * Get lastName * @return lastName **/ - public String getLastName() { + public String getLastName() { return lastName; } @@ -112,7 +120,7 @@ public class User { * Get email * @return email **/ - public String getEmail() { + public String getEmail() { return email; } @@ -129,7 +137,7 @@ public class User { * Get password * @return password **/ - public String getPassword() { + public String getPassword() { return password; } @@ -146,7 +154,7 @@ public class User { * Get phone * @return phone **/ - public String getPhone() { + public String getPhone() { return phone; } @@ -163,7 +171,7 @@ public class User { * User Status * @return userStatus **/ - public Integer getUserStatus() { + public Integer getUserStatus() { return userStatus; } diff --git a/samples/server/petstore/java-play-framework/build.sbt b/samples/server/petstore/java-play-framework/build.sbt index 83a17e91013..b972893fc3f 100644 --- a/samples/server/petstore/java-play-framework/build.sbt +++ b/samples/server/petstore/java-play-framework/build.sbt @@ -7,5 +7,5 @@ lazy val root = (project in file(".")).enablePlugins(PlayJava) scalaVersion := "2.12.6" libraryDependencies += "org.webjars" % "swagger-ui" % "3.32.5" -libraryDependencies += "javax.validation" % "validation-api" % "1.1.0.Final" +libraryDependencies += "javax.validation" % "validation-api" % "2.0.1.Final" libraryDependencies += guice diff --git a/samples/server/petstore/java-undertow/.openapi-generator/FILES b/samples/server/petstore/java-undertow/.openapi-generator/FILES index 8857fbfab67..780862a8b8f 100644 --- a/samples/server/petstore/java-undertow/.openapi-generator/FILES +++ b/samples/server/petstore/java-undertow/.openapi-generator/FILES @@ -1,5 +1,6 @@ README.md pom.xml +src/main/java/org/openapitools/handler/PathHandlerInterface.java src/main/java/org/openapitools/handler/PathHandlerProvider.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ModelApiResponse.java diff --git a/samples/server/petstore/java-undertow/.openapi-generator/VERSION b/samples/server/petstore/java-undertow/.openapi-generator/VERSION index d99e7162d01..c30f0ec2be7 100644 --- a/samples/server/petstore/java-undertow/.openapi-generator/VERSION +++ b/samples/server/petstore/java-undertow/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-undertow/README.md b/samples/server/petstore/java-undertow/README.md index a983dba343c..f452d35095a 100644 --- a/samples/server/petstore/java-undertow/README.md +++ b/samples/server/petstore/java-undertow/README.md @@ -10,15 +10,13 @@ mvn package exec:exec ## Test -By default, all endpoints are protected by OAuth jwt token verifier. It can be turned off with config change through for development. - +By default, all endpoints are protected by the OAuth JWT token verifier. It can be turned off with a config change, when required. In order to access the server, there is a long lived token below issued by my -oauth2 server [undertow-server-oauth2](https://github.com/networknt/undertow-server-oauth2) +OAuth2 server [undertow-server-oauth2](https://github.com/networknt/undertow-server-oauth2). ``` Bearer eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJ1cm46Y29tOm5ldHdvcmtudDpvYXV0aDI6djEiLCJhdWQiOiJ1cm46Y29tLm5ldHdvcmtudCIsImV4cCI6MTc4ODEzMjczNSwianRpIjoiNWtyM2ZWOHJaelBZNEJrSnNYZzFpQSIsImlhdCI6MTQ3Mjc3MjczNSwibmJmIjoxNDcyNzcyNjE1LCJ2ZXJzaW9uIjoiMS4wIiwidXNlcl9pZCI6InN0ZXZlIiwidXNlcl90eXBlIjoiRU1QTE9ZRUUiLCJjbGllbnRfaWQiOiJkZGNhZjBiYS0xMTMxLTIyMzItMzMxMy1kNmYyNzUzZjI1ZGMiLCJzY29wZSI6WyJhcGkuciIsImFwaS53Il19.gteJiy1uao8HLeWRljpZxHWUgQfofwmnFP-zv3EPUyXjyCOy3xclnfeTnTE39j8PgBwdFASPcDLLk1YfZJbsU6pLlmYXLtdpHDBsVmIRuch6LFPCVQ3JdqSQVci59OhSK0bBThGWqCD3UzDI_OnX4IVCAahcT9Bu94m5u_H_JNmwDf1XaP3Lt4I34buYMuRD9stchsnZi-tuIRkL13FARm1XA9aPZUMUXFdedBWDXo1zMREQ_qCJXOpaZDJM9Im0rIkq9wTEVU00pbRp_Vcdya3dfkFteBMHiwFVt6VNQaco5BXURDAIzXidwQxNEbX1ek03wra8AIani65ZK7fy_w ``` Add "Authorization" header with value as above token and a dummy message will return from the generated stub. - diff --git a/samples/server/petstore/java-undertow/dependency-reduced-pom.xml b/samples/server/petstore/java-undertow/dependency-reduced-pom.xml index 2c176c4af89..f86a92f3f0a 100644 --- a/samples/server/petstore/java-undertow/dependency-reduced-pom.xml +++ b/samples/server/petstore/java-undertow/dependency-reduced-pom.xml @@ -1,131 +1,131 @@ - - - - oss-parent - org.sonatype.oss - 5 - ../pom.xml/pom.xml - - 4.0.0 - org.openapitools - openapi-undertow-server - openapi-undertow-server - 1.0.0 - - install - target - ${project.artifactId}-${project.version} - - - maven-enforcer-plugin - 3.0.0-M1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - maven-shade-plugin - 2.4.3 - - - package - - shade - - - - - - - - - - - maven-jar-plugin - 2.6 - - - - com.networknt.server.Server - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.4.0 - - java - - -jar - target/${project.build.finalName}.jar - - - - - - - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - - - junit - junit - 4.13 - test - - - hamcrest-core - org.hamcrest - - - - - org.apache.httpcomponents - httpclient - 4.5.2 - test - - - - 4.1.2 - 2.9.10.4 - 2.2.0 - 1.10 - 3.1.2 - UTF-8 - 1.2 - 4.5.2 - 1.4.0.Final - 0.5.2 - 2.6 - 1.8 - 2.9.10 - 0.1.1 - 1.5.10 - 2.1.0-beta.124 - 1.7.21 - 2.5 - 1.1.7 - 4.13 - 4.5.3 - - - + + + + oss-parent + org.sonatype.oss + 5 + ../pom.xml/pom.xml + + 4.0.0 + org.openapitools + openapi-undertow-server + openapi-undertow-server + 1.0.0 + + install + target + ${project.artifactId}-${project.version} + + + maven-enforcer-plugin + 3.0.0-M1 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + maven-shade-plugin + 2.4.3 + + + package + + shade + + + + + + + + + + + maven-jar-plugin + 2.6 + + + + com.networknt.server.Server + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.4.0 + + java + + -jar + target/${project.build.finalName}.jar + + + + + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + + + junit + junit + 4.13 + test + + + hamcrest-core + org.hamcrest + + + + + org.apache.httpcomponents + httpclient + 4.5.2 + test + + + + 4.1.2 + 2.9.10.4 + 2.2.0 + 1.10 + 3.1.2 + UTF-8 + 1.2 + 4.5.2 + 1.4.0.Final + 0.5.2 + 2.6 + 1.8 + 2.9.10 + 0.1.1 + 1.5.10 + 2.1.0-beta.124 + 1.7.21 + 2.5 + 1.1.7 + 4.13 + 4.5.3 + + + diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java new file mode 100644 index 00000000000..5733e1ee0b0 --- /dev/null +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java @@ -0,0 +1,604 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI document version: 1.0.0 + * + * + * AUTO-GENERATED FILE, DO NOT MODIFY! + */ +package org.openapitools.handler; + +import io.undertow.server.*; +import io.undertow.util.*; + +import org.openapitools.model.*; + +@SuppressWarnings("TooManyFunctions") +public interface PathHandlerInterface { + + /** + *

    Add a new pet to the store

    + * + *

    Endpoint: {@link Methods#POST POST} "/v2/pet" (privileged: true)

    + * + *

    Request parameters:

    + *
      + *
    + * + *

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

    + *

    Payload: {@link Pet} (required: true)

    + * + * + *

    Responses:

    + *
      + *
    • 405 (client error): Invalid input
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler addPet(); + + /** + *

    Deletes a pet

    + * + *

    Endpoint: {@link Methods#DELETE DELETE} "/v2/pet/{petId}" (privileged: true)

    + * + *

    Request parameters:

    + *
      + *
    • + *

      "petId" + *

      Pet id to delete

      + *

      + * - Parameter type: {@link Long}
      + * - Appears in: {@link HttpServerExchange#getPathParameters Path}
      + * - Required: true + *

      + *
    • + *
    • + *

      "api_key" + *

      + * - Parameter type: {@link String}
      + * - Appears in: {@link Headers Header}
      + * - Required: false + *

      + *
    • + *
    + * + * + *

    Responses:

    + *
      + *
    • 400 (client error): Invalid pet value
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler deletePet(); + + /** + *

    Finds Pets by status

    + * + *

    Multiple status values can be provided with comma separated strings

    + * + *

    Endpoint: {@link Methods#GET GET} "/v2/pet/findByStatus" (privileged: true)

    + * + *

    Request parameters:

    + *
      + *
    • + *

      "status" + *

      Status values that need to be considered for filter

      + *

      + * - Parameter type: {@link java.util.List List} of {@link List<String>}
      + * - Appears in: {@link HttpServerExchange#getQueryParameters Query}
      + * - Default value: new ArrayList()
      + * - Required: true + *

      + *
    • + *
    + * + *

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

    + *

    Returns: {@link java.util.List List} of {@link Pet}

    + * + *

    Responses:

    + *
      + *
    • 200 (success): successful operation
    • + *
    • 400 (client error): Invalid status value
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler findPetsByStatus(); + + /** + *

    Finds Pets by tags

    + * + *

    Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

    + * + *

    Endpoint: {@link Methods#GET GET} "/v2/pet/findByTags" (privileged: true)

    + * + *

    Request parameters:

    + *
      + *
    • + *

      "tags" + *

      Tags to filter by

      + *

      + * - Parameter type: {@link java.util.List List} of {@link List<String>}
      + * - Appears in: {@link HttpServerExchange#getQueryParameters Query}
      + * - Default value: new ArrayList()
      + * - Required: true + *

      + *
    • + *
    + * + *

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

    + *

    Returns: {@link java.util.List List} of {@link Pet}

    + * + *

    Responses:

    + *
      + *
    • 200 (success): successful operation
    • + *
    • 400 (client error): Invalid tag value
    • + *
    + */ + @javax.annotation.Nonnull + @Deprecated + HttpHandler findPetsByTags(); + + /** + *

    Find pet by ID

    + * + *

    Returns a single pet

    + * + *

    Endpoint: {@link Methods#GET GET} "/v2/pet/{petId}" (privileged: true)

    + * + *

    Request parameters:

    + *
      + *
    • + *

      "petId" + *

      ID of pet to return

      + *

      + * - Parameter type: {@link Long}
      + * - Appears in: {@link HttpServerExchange#getPathParameters Path}
      + * - Required: true + *

      + *
    • + *
    + * + *

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

    + *

    Returns: {@link Pet}

    + * + *

    Responses:

    + *
      + *
    • 200 (success): successful operation
    • + *
    • 400 (client error): Invalid ID supplied
    • + *
    • 404 (client error): Pet not found
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler getPetById(); + + /** + *

    Update an existing pet

    + * + *

    Endpoint: {@link Methods#PUT PUT} "/v2/pet" (privileged: true)

    + * + *

    Request parameters:

    + *
      + *
    + * + *

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

    + *

    Payload: {@link Pet} (required: true)

    + * + * + *

    Responses:

    + *
      + *
    • 400 (client error): Invalid ID supplied
    • + *
    • 404 (client error): Pet not found
    • + *
    • 405 (client error): Validation exception
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler updatePet(); + + /** + *

    Updates a pet in the store with form data

    + * + *

    Endpoint: {@link Methods#POST POST} "/v2/pet/{petId}" (privileged: true)

    + * + *

    Request parameters:

    + *
      + *
    • + *

      "petId" + *

      ID of pet that needs to be updated

      + *

      + * - Parameter type: {@link Long}
      + * - Appears in: {@link HttpServerExchange#getPathParameters Path}
      + * - Required: true + *

      + *
    • + *
    • + *

      "name" + *

      Updated name of the pet

      + *

      + * - Parameter type: {@link String}
      + * - Appears in: {@link io.undertow.server.handlers.form.FormDataParser Form}
      + * - Required: false + *

      + *
    • + *
    • + *

      "status" + *

      Updated status of the pet

      + *

      + * - Parameter type: {@link String}
      + * - Appears in: {@link io.undertow.server.handlers.form.FormDataParser Form}
      + * - Required: false + *

      + *
    • + *
    + * + *

    Consumes: [{mediaType=application/x-www-form-urlencoded}]

    + * + * + *

    Responses:

    + *
      + *
    • 405 (client error): Invalid input
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler updatePetWithForm(); + + /** + *

    uploads an image

    + * + *

    Endpoint: {@link Methods#POST POST} "/v2/pet/{petId}/uploadImage" (privileged: true)

    + * + *

    Request parameters:

    + *
      + *
    • + *

      "petId" + *

      ID of pet to update

      + *

      + * - Parameter type: {@link Long}
      + * - Appears in: {@link HttpServerExchange#getPathParameters Path}
      + * - Required: true + *

      + *
    • + *
    • + *

      "additionalMetadata" + *

      Additional data to pass to server

      + *

      + * - Parameter type: {@link String}
      + * - Appears in: {@link io.undertow.server.handlers.form.FormDataParser Form}
      + * - Required: false + *

      + *
    • + *
    • + *

      "file" + *

      file to upload

      + *

      + * - Parameter type: BinaryFile
      + * - Appears in: {@link io.undertow.server.handlers.form.FormDataParser Form}
      + * - Required: false + *

      + *
    • + *
    + * + *

    Consumes: [{mediaType=multipart/form-data}]

    + * + *

    Produces: [{mediaType=application/json}]

    + *

    Returns: {@link ModelApiResponse}

    + * + *

    Responses:

    + *
      + *
    • 200 (success): successful operation
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler uploadFile(); + + /** + *

    Delete purchase order by ID

    + * + *

    For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors

    + * + *

    Endpoint: {@link Methods#DELETE DELETE} "/v2/store/order/{orderId}" (privileged: false)

    + * + *

    Request parameters:

    + *
      + *
    • + *

      "orderId" + *

      ID of the order that needs to be deleted

      + *

      + * - Parameter type: {@link String}
      + * - Appears in: {@link HttpServerExchange#getPathParameters Path}
      + * - Required: true + *

      + *
    • + *
    + * + * + *

    Responses:

    + *
      + *
    • 400 (client error): Invalid ID supplied
    • + *
    • 404 (client error): Order not found
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler deleteOrder(); + + /** + *

    Returns pet inventories by status

    + * + *

    Returns a map of status codes to quantities

    + * + *

    Endpoint: {@link Methods#GET GET} "/v2/store/inventory" (privileged: true)

    + * + *

    Produces: [{mediaType=application/json}]

    + *

    Returns: {@link java.util.Map Map} of {@link Integer}

    + * + *

    Responses:

    + *
      + *
    • 200 (success): successful operation
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler getInventory(); + + /** + *

    Find purchase order by ID

    + * + *

    For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions

    + * + *

    Endpoint: {@link Methods#GET GET} "/v2/store/order/{orderId}" (privileged: false)

    + * + *

    Request parameters:

    + *
      + *
    • + *

      "orderId" + *

      ID of pet that needs to be fetched

      + *

      + * - Parameter type: {@link Long}
      + * - Appears in: {@link HttpServerExchange#getPathParameters Path}
      + * - Required: true + *

      + *
    • + *
    + * + *

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

    + *

    Returns: {@link Order}

    + * + *

    Responses:

    + *
      + *
    • 200 (success): successful operation
    • + *
    • 400 (client error): Invalid ID supplied
    • + *
    • 404 (client error): Order not found
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler getOrderById(); + + /** + *

    Place an order for a pet

    + * + *

    Endpoint: {@link Methods#POST POST} "/v2/store/order" (privileged: false)

    + * + *

    Request parameters:

    + *
      + *
    + * + *

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

    + *

    Returns: {@link Order}

    + * + *

    Responses:

    + *
      + *
    • 200 (success): successful operation
    • + *
    • 400 (client error): Invalid Order
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler placeOrder(); + + /** + *

    Create user

    + * + *

    This can only be done by the logged in user.

    + * + *

    Endpoint: {@link Methods#POST POST} "/v2/user" (privileged: false)

    + * + *

    Request parameters:

    + *
      + *
    + * + * + *

    Responses:

    + *
      + *
    • Default: successful operation
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler createUser(); + + /** + *

    Creates list of users with given input array

    + * + *

    Endpoint: {@link Methods#POST POST} "/v2/user/createWithArray" (privileged: false)

    + * + *

    Request parameters:

    + *
      + *
    + * + * + *

    Responses:

    + *
      + *
    • Default: successful operation
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler createUsersWithArrayInput(); + + /** + *

    Creates list of users with given input array

    + * + *

    Endpoint: {@link Methods#POST POST} "/v2/user/createWithList" (privileged: false)

    + * + *

    Request parameters:

    + *
      + *
    + * + * + *

    Responses:

    + *
      + *
    • Default: successful operation
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler createUsersWithListInput(); + + /** + *

    Delete user

    + * + *

    This can only be done by the logged in user.

    + * + *

    Endpoint: {@link Methods#DELETE DELETE} "/v2/user/{username}" (privileged: false)

    + * + *

    Request parameters:

    + *
      + *
    • + *

      "username" + *

      The name that needs to be deleted

      + *

      + * - Parameter type: {@link String}
      + * - Appears in: {@link HttpServerExchange#getPathParameters Path}
      + * - Required: true + *

      + *
    • + *
    + * + * + *

    Responses:

    + *
      + *
    • 400 (client error): Invalid username supplied
    • + *
    • 404 (client error): User not found
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler deleteUser(); + + /** + *

    Get user by user name

    + * + *

    Endpoint: {@link Methods#GET GET} "/v2/user/{username}" (privileged: false)

    + * + *

    Request parameters:

    + *
      + *
    • + *

      "username" + *

      The name that needs to be fetched. Use user1 for testing.

      + *

      + * - Parameter type: {@link String}
      + * - Appears in: {@link HttpServerExchange#getPathParameters Path}
      + * - Required: true + *

      + *
    • + *
    + * + *

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

    + *

    Returns: {@link User}

    + * + *

    Responses:

    + *
      + *
    • 200 (success): successful operation
    • + *
    • 400 (client error): Invalid username supplied
    • + *
    • 404 (client error): User not found
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler getUserByName(); + + /** + *

    Logs user into the system

    + * + *

    Endpoint: {@link Methods#GET GET} "/v2/user/login" (privileged: false)

    + * + *

    Request parameters:

    + *
      + *
    • + *

      "username" + *

      The user name for login

      + *

      + * - Parameter type: {@link String}
      + * - Appears in: {@link HttpServerExchange#getQueryParameters Query}
      + * - Required: true + *

      + *
    • + *
    • + *

      "password" + *

      The password for login in clear text

      + *

      + * - Parameter type: {@link String}
      + * - Appears in: {@link HttpServerExchange#getQueryParameters Query}
      + * - Required: true + *

      + *
    • + *
    + *

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

    + * + *

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

    + *

    Returns: {@link String}

    + * + *

    Responses:

    + *
      + *
    • 200 (success): successful operation
    • + *
    • 400 (client error): Invalid username/password supplied
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler loginUser(); + + /** + *

    Logs out current logged in user session

    + * + *

    Endpoint: {@link Methods#GET GET} "/v2/user/logout" (privileged: false)

    + * + * + *

    Responses:

    + *
      + *
    • Default: successful operation
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler logoutUser(); + + /** + *

    Updated user

    + * + *

    This can only be done by the logged in user.

    + * + *

    Endpoint: {@link Methods#PUT PUT} "/v2/user/{username}" (privileged: false)

    + * + *

    Request parameters:

    + *
      + *
    • + *

      "username" + *

      name that need to be deleted

      + *

      + * - Parameter type: {@link String}
      + * - Appears in: {@link HttpServerExchange#getPathParameters Path}
      + * - Required: true + *

      + *
    • + *
    + * + * + *

    Responses:

    + *
      + *
    • 400 (client error): Invalid user supplied
    • + *
    • 404 (client error): User not found
    • + *
    + */ + @javax.annotation.Nonnull + HttpHandler updateUser(); +} diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerProvider.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerProvider.java index 2fc96fbbba3..0636e605513 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerProvider.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerProvider.java @@ -1,159 +1,287 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI document version: 1.0.0 + * + * + * AUTO-GENERATED FILE, DO NOT MODIFY! + */ package org.openapitools.handler; -import com.networknt.config.Config; import com.networknt.server.HandlerProvider; import io.undertow.Handlers; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; +import io.undertow.server.RoutingHandler; +import io.undertow.server.handlers.PathHandler; import io.undertow.util.Methods; -public class PathHandlerProvider implements HandlerProvider { +/** + * The default implementation for {@link HandlerProvider} and {@link PathHandlerInterface}. + * + *

    There are two flavors of {@link HttpHandler}s to choose from, depending on your needs:

    + * + *
      + *
    • + * Stateless: if a specific endpoint is called more than once from multiple sessions, + * its state is not retained – a different {@link HttpHandler} is instantiated for every new + * session. This is the default behavior. + *
    • + *
    • + * Stateful: if a specific endpoint is called more than once from multiple sessions, + * its state is retained properly. For example, if you want to keep a class property that counts + * the number of requests or the last time a request was received. + *
    • + *
    + *

    Note: Stateful flavor is more performant than Stateless.

    + */ +@SuppressWarnings("TooManyFunctions") +abstract public class PathHandlerProvider implements HandlerProvider, PathHandlerInterface { + /** + * Returns the default base path to access this server. + */ + @javax.annotation.Nonnull + public String getBasePath() { + return "/v2"; + } + /** + * Returns a stateless {@link HttpHandler} that configures all endpoints in this server. + * + *

    Endpoints bound in this method do NOT start with "/v2", and + * it's your responsibility to configure a {@link PathHandler} with a prefix path + * by calling {@link PathHandler#addPrefixPath} like so:

    + * + * pathHandler.addPrefixPath("/v2", handler) + * + *

    Note: the endpoints bound to the returned {@link HttpHandler} are stateless and won't + * retain any state between multiple sessions.

    + * + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + @Override public HttpHandler getHandler() { - HttpHandler handler = Handlers.routing() + return getHandler(false); + } + /** + * Returns a stateless {@link HttpHandler} that configures all endpoints in this server. + * + *

    Note: the endpoints bound to the returned {@link HttpHandler} are stateless and won't + * retain any state between multiple sessions.

    + * + * @param withBasePath if true, all endpoints would start with "/v2" + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + public HttpHandler getHandler(final boolean withBasePath) { + return getHandler(withBasePath ? getBasePath() : ""); + } - .add(Methods.POST, "/v2/pet", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("addPet"); - } - }) + /** + * Returns a stateless {@link HttpHandler} that configures all endpoints in this server. + * + *

    Note: the endpoints bound to the returned {@link HttpHandler} are stateless and won't + * retain any state between multiple sessions.

    + * + * @param basePath base path to set for all endpoints + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @SuppressWarnings("Convert2Lambda") + @javax.annotation.Nonnull + public HttpHandler getHandler(final String basePath) { + return Handlers.routing() + .add(Methods.POST, basePath + "/pet", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + addPet().handleRequest(exchange); + } + }) + .add(Methods.DELETE, basePath + "/pet/{petId}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + deletePet().handleRequest(exchange); + } + }) + .add(Methods.GET, basePath + "/pet/findByStatus", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + findPetsByStatus().handleRequest(exchange); + } + }) + .add(Methods.GET, basePath + "/pet/findByTags", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + findPetsByTags().handleRequest(exchange); + } + }) + .add(Methods.GET, basePath + "/pet/{petId}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + getPetById().handleRequest(exchange); + } + }) + .add(Methods.PUT, basePath + "/pet", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + updatePet().handleRequest(exchange); + } + }) + .add(Methods.POST, basePath + "/pet/{petId}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + updatePetWithForm().handleRequest(exchange); + } + }) + .add(Methods.POST, basePath + "/pet/{petId}/uploadImage", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + uploadFile().handleRequest(exchange); + } + }) + .add(Methods.DELETE, basePath + "/store/order/{orderId}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + deleteOrder().handleRequest(exchange); + } + }) + .add(Methods.GET, basePath + "/store/inventory", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + getInventory().handleRequest(exchange); + } + }) + .add(Methods.GET, basePath + "/store/order/{orderId}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + getOrderById().handleRequest(exchange); + } + }) + .add(Methods.POST, basePath + "/store/order", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + placeOrder().handleRequest(exchange); + } + }) + .add(Methods.POST, basePath + "/user", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + createUser().handleRequest(exchange); + } + }) + .add(Methods.POST, basePath + "/user/createWithArray", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + createUsersWithArrayInput().handleRequest(exchange); + } + }) + .add(Methods.POST, basePath + "/user/createWithList", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + createUsersWithListInput().handleRequest(exchange); + } + }) + .add(Methods.DELETE, basePath + "/user/{username}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + deleteUser().handleRequest(exchange); + } + }) + .add(Methods.GET, basePath + "/user/{username}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + getUserByName().handleRequest(exchange); + } + }) + .add(Methods.GET, basePath + "/user/login", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + loginUser().handleRequest(exchange); + } + }) + .add(Methods.GET, basePath + "/user/logout", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + logoutUser().handleRequest(exchange); + } + }) + .add(Methods.PUT, basePath + "/user/{username}", new HttpHandler() { + @Override + public void handleRequest(HttpServerExchange exchange) throws Exception { + updateUser().handleRequest(exchange); + } + }) + ; + } + /** + * Returns a stateful {@link HttpHandler} that configures all endpoints in this server. + * + *

    Endpoints bound in this method do NOT start with "/v2", and + * it's your responsibility to configure a {@link PathHandler} with a prefix path + * by calling {@link PathHandler#addPrefixPath} like so:

    + * + * pathHandler.addPrefixPath("/v2", handler) + * + *

    Note: the endpoints bound to the returned {@link HttpHandler} are stateful and will + * retain any state between multiple sessions.

    + * + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + public HttpHandler getStatefulHandler() { + return getStatefulHandler(false); + } - .add(Methods.DELETE, "/v2/pet/{petId}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("deletePet"); - } - }) + /** + * Returns a stateful {@link HttpHandler} that configures all endpoints in this server. + * + *

    Note: the endpoints bound to the returned {@link HttpHandler} are stateful and will + * retain any state between multiple sessions.

    + * + * @param withBasePath if true, all endpoints would start with "/v2" + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + public HttpHandler getStatefulHandler(final boolean withBasePath) { + return getStatefulHandler(withBasePath ? getBasePath() : ""); + } - - .add(Methods.GET, "/v2/pet/findByStatus", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("findPetsByStatus"); - } - }) - - - .add(Methods.GET, "/v2/pet/findByTags", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("findPetsByTags"); - } - }) - - - .add(Methods.GET, "/v2/pet/{petId}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("getPetById"); - } - }) - - - .add(Methods.PUT, "/v2/pet", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("updatePet"); - } - }) - - - .add(Methods.POST, "/v2/pet/{petId}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("updatePetWithForm"); - } - }) - - - .add(Methods.POST, "/v2/pet/{petId}/uploadImage", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("uploadFile"); - } - }) - - - .add(Methods.DELETE, "/v2/store/order/{orderId}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("deleteOrder"); - } - }) - - - .add(Methods.GET, "/v2/store/inventory", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("getInventory"); - } - }) - - - .add(Methods.GET, "/v2/store/order/{orderId}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("getOrderById"); - } - }) - - - .add(Methods.POST, "/v2/store/order", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("placeOrder"); - } - }) - - - .add(Methods.POST, "/v2/user", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("createUser"); - } - }) - - - .add(Methods.POST, "/v2/user/createWithArray", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("createUsersWithArrayInput"); - } - }) - - - .add(Methods.POST, "/v2/user/createWithList", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("createUsersWithListInput"); - } - }) - - - .add(Methods.DELETE, "/v2/user/{username}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("deleteUser"); - } - }) - - - .add(Methods.GET, "/v2/user/{username}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("getUserByName"); - } - }) - - - .add(Methods.GET, "/v2/user/login", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("loginUser"); - } - }) - - - .add(Methods.GET, "/v2/user/logout", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("logoutUser"); - } - }) - - - .add(Methods.PUT, "/v2/user/{username}", new HttpHandler() { - public void handleRequest(HttpServerExchange exchange) throws Exception { - exchange.getResponseSender().send("updateUser"); - } - }) - - ; - return handler; + /** + * Returns a stateful {@link HttpHandler} that configures all endpoints in this server. + * + *

    Note: the endpoints bound to the returned {@link HttpHandler} are stateful and will + * retain any state between multiple sessions.

    + * + * @param basePath base path to set for all endpoints + * @return an {@link HttpHandler} of type {@link RoutingHandler} + */ + @javax.annotation.Nonnull + public HttpHandler getStatefulHandler(final String basePath) { + return Handlers.routing() + .add(Methods.POST, basePath + "/pet", addPet()) + .add(Methods.DELETE, basePath + "/pet/{petId}", deletePet()) + .add(Methods.GET, basePath + "/pet/findByStatus", findPetsByStatus()) + .add(Methods.GET, basePath + "/pet/findByTags", findPetsByTags()) + .add(Methods.GET, basePath + "/pet/{petId}", getPetById()) + .add(Methods.PUT, basePath + "/pet", updatePet()) + .add(Methods.POST, basePath + "/pet/{petId}", updatePetWithForm()) + .add(Methods.POST, basePath + "/pet/{petId}/uploadImage", uploadFile()) + .add(Methods.DELETE, basePath + "/store/order/{orderId}", deleteOrder()) + .add(Methods.GET, basePath + "/store/inventory", getInventory()) + .add(Methods.GET, basePath + "/store/order/{orderId}", getOrderById()) + .add(Methods.POST, basePath + "/store/order", placeOrder()) + .add(Methods.POST, basePath + "/user", createUser()) + .add(Methods.POST, basePath + "/user/createWithArray", createUsersWithArrayInput()) + .add(Methods.POST, basePath + "/user/createWithList", createUsersWithListInput()) + .add(Methods.DELETE, basePath + "/user/{username}", deleteUser()) + .add(Methods.GET, basePath + "/user/{username}", getUserByName()) + .add(Methods.GET, basePath + "/user/login", loginUser()) + .add(Methods.GET, basePath + "/user/logout", logoutUser()) + .add(Methods.PUT, basePath + "/user/{username}", updateUser()) + ; } } - diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Category.java index bda35d2f045..4700938d352 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Category.java @@ -1,3 +1,13 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI document version: 1.0.0 + * + * + * AUTO-GENERATED FILE, DO NOT MODIFY! + */ package org.openapitools.model; import java.util.Objects; @@ -10,7 +20,7 @@ import io.swagger.annotations.ApiModelProperty; /** * A category for a pet - **/ + */ @ApiModel(description = "A category for a pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen") @@ -20,7 +30,7 @@ public class Category { private String name; /** - **/ + */ public Category id(Long id) { this.id = id; return this; @@ -37,7 +47,7 @@ public class Category { } /** - **/ + */ public Category name(String name) { this.name = name; return this; diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/ModelApiResponse.java index 0d4cb3865cb..04568d59bb5 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -1,3 +1,13 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI document version: 1.0.0 + * + * + * AUTO-GENERATED FILE, DO NOT MODIFY! + */ package org.openapitools.model; import java.util.Objects; @@ -10,7 +20,7 @@ import io.swagger.annotations.ApiModelProperty; /** * Describes the result of uploading an image resource - **/ + */ @ApiModel(description = "Describes the result of uploading an image resource") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen") @@ -21,7 +31,7 @@ public class ModelApiResponse { private String message; /** - **/ + */ public ModelApiResponse code(Integer code) { this.code = code; return this; @@ -38,7 +48,7 @@ public class ModelApiResponse { } /** - **/ + */ public ModelApiResponse type(String type) { this.type = type; return this; @@ -55,7 +65,7 @@ public class ModelApiResponse { } /** - **/ + */ public ModelApiResponse message(String message) { this.message = message; return this; diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Order.java index f057848f0cf..2f7209f8ef7 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Order.java @@ -1,3 +1,13 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI document version: 1.0.0 + * + * + * AUTO-GENERATED FILE, DO NOT MODIFY! + */ package org.openapitools.model; import java.util.Objects; @@ -12,7 +22,7 @@ import java.util.Date; /** * An order for a pets from the pet store - **/ + */ @ApiModel(description = "An order for a pets from the pet store") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen") @@ -46,7 +56,7 @@ public class Order { private Boolean complete = false; /** - **/ + */ public Order id(Long id) { this.id = id; return this; @@ -63,7 +73,7 @@ public class Order { } /** - **/ + */ public Order petId(Long petId) { this.petId = petId; return this; @@ -80,7 +90,7 @@ public class Order { } /** - **/ + */ public Order quantity(Integer quantity) { this.quantity = quantity; return this; @@ -97,7 +107,7 @@ public class Order { } /** - **/ + */ public Order shipDate(Date shipDate) { this.shipDate = shipDate; return this; @@ -115,7 +125,7 @@ public class Order { /** * Order Status - **/ + */ public Order status(StatusEnum status) { this.status = status; return this; @@ -132,7 +142,7 @@ public class Order { } /** - **/ + */ public Order complete(Boolean complete) { this.complete = complete; return this; diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java index a80d291fc41..2837ebec20a 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Pet.java @@ -1,3 +1,13 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI document version: 1.0.0 + * + * + * AUTO-GENERATED FILE, DO NOT MODIFY! + */ package org.openapitools.model; import java.util.Objects; @@ -15,7 +25,7 @@ import org.openapitools.model.Tag; /** * A pet for sale in the pet store - **/ + */ @ApiModel(description = "A pet for sale in the pet store") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen") @@ -49,7 +59,7 @@ public class Pet { private StatusEnum status; /** - **/ + */ public Pet id(Long id) { this.id = id; return this; @@ -66,7 +76,7 @@ public class Pet { } /** - **/ + */ public Pet category(Category category) { this.category = category; return this; @@ -83,7 +93,7 @@ public class Pet { } /** - **/ + */ public Pet name(String name) { this.name = name; return this; @@ -100,7 +110,7 @@ public class Pet { } /** - **/ + */ public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; @@ -117,7 +127,7 @@ public class Pet { } /** - **/ + */ public Pet tags(List tags) { this.tags = tags; return this; @@ -135,7 +145,7 @@ public class Pet { /** * pet status in the store - **/ + */ public Pet status(StatusEnum status) { this.status = status; return this; diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Tag.java index a68f772854e..bab2a254cf2 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/Tag.java @@ -1,3 +1,13 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI document version: 1.0.0 + * + * + * AUTO-GENERATED FILE, DO NOT MODIFY! + */ package org.openapitools.model; import java.util.Objects; @@ -10,7 +20,7 @@ import io.swagger.annotations.ApiModelProperty; /** * A tag for a pet - **/ + */ @ApiModel(description = "A tag for a pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen") @@ -20,7 +30,7 @@ public class Tag { private String name; /** - **/ + */ public Tag id(Long id) { this.id = id; return this; @@ -37,7 +47,7 @@ public class Tag { } /** - **/ + */ public Tag name(String name) { this.name = name; return this; diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/User.java index 7ef8b096a8f..2e66108f65d 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/model/User.java @@ -1,3 +1,13 @@ +/* + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI document version: 1.0.0 + * + * + * AUTO-GENERATED FILE, DO NOT MODIFY! + */ package org.openapitools.model; import java.util.Objects; @@ -10,7 +20,7 @@ import io.swagger.annotations.ApiModelProperty; /** * A User who is purchasing from the pet store - **/ + */ @ApiModel(description = "A User who is purchasing from the pet store") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen") @@ -26,7 +36,7 @@ public class User { private Integer userStatus; /** - **/ + */ public User id(Long id) { this.id = id; return this; @@ -43,7 +53,7 @@ public class User { } /** - **/ + */ public User username(String username) { this.username = username; return this; @@ -60,7 +70,7 @@ public class User { } /** - **/ + */ public User firstName(String firstName) { this.firstName = firstName; return this; @@ -77,7 +87,7 @@ public class User { } /** - **/ + */ public User lastName(String lastName) { this.lastName = lastName; return this; @@ -94,7 +104,7 @@ public class User { } /** - **/ + */ public User email(String email) { this.email = email; return this; @@ -111,7 +121,7 @@ public class User { } /** - **/ + */ public User password(String password) { this.password = password; return this; @@ -128,7 +138,7 @@ public class User { } /** - **/ + */ public User phone(String phone) { this.phone = phone; return this; @@ -146,7 +156,7 @@ public class User { /** * User Status - **/ + */ public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; 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 1a863721712..e1554af7b8f 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 @@ -1037,5 +1037,6 @@ "type" : "apiKey" } } - } + }, + "x-original-swagger-version" : "2.0" } \ No newline at end of file diff --git a/samples/server/petstore/java-vertx-web/.openapi-generator/FILES b/samples/server/petstore/java-vertx-web/.openapi-generator/FILES index 4169de32e26..08e93e05a0c 100644 --- a/samples/server/petstore/java-vertx-web/.openapi-generator/FILES +++ b/samples/server/petstore/java-vertx-web/.openapi-generator/FILES @@ -12,8 +12,6 @@ src/main/java/org/openapitools/vertxweb/server/api/UserApi.java src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java src/main/java/org/openapitools/vertxweb/server/model/Category.java -src/main/java/org/openapitools/vertxweb/server/model/InlineObject.java -src/main/java/org/openapitools/vertxweb/server/model/InlineObject1.java src/main/java/org/openapitools/vertxweb/server/model/ModelApiResponse.java src/main/java/org/openapitools/vertxweb/server/model/Order.java src/main/java/org/openapitools/vertxweb/server/model/Pet.java diff --git a/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION b/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION index d99e7162d01..3fa3b389a57 100644 --- a/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx-web/pom.xml b/samples/server/petstore/java-vertx-web/pom.xml index e813663f8d1..56eebc06b10 100644 --- a/samples/server/petstore/java-vertx-web/pom.xml +++ b/samples/server/petstore/java-vertx-web/pom.xml @@ -17,8 +17,8 @@ 2.22.2 1.5.0 - 4.0.0.Beta3 - 5.6.2 + 4.0.0 + 5.7.0 1.7.30 2.11.2 diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/HttpServerVerticle.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/HttpServerVerticle.java index ceb3d606acd..f06b6c3e014 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/HttpServerVerticle.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/HttpServerVerticle.java @@ -5,8 +5,8 @@ import io.vertx.core.Promise; import io.vertx.core.http.HttpServerOptions; import io.vertx.ext.web.Router; import io.vertx.ext.web.RoutingContext; -import io.vertx.ext.web.openapi.RouterFactory; -import io.vertx.ext.web.openapi.RouterFactoryOptions; +import io.vertx.ext.web.openapi.RouterBuilder; +import io.vertx.ext.web.openapi.RouterBuilderOptions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -26,18 +26,18 @@ public class HttpServerVerticle extends AbstractVerticle { @Override public void start(Promise startPromise) { - RouterFactory.create(vertx, specFile) - .map(factory -> { - factory.setOptions(new RouterFactoryOptions() + RouterBuilder.create(vertx, specFile) + .map(builder -> { + builder.setOptions(new RouterBuilderOptions() // For production use case, you need to enable this flag and provide the proper security handler .setRequireSecurityHandlers(false) ); - petHandler.mount(factory); - storeHandler.mount(factory); - userHandler.mount(factory); + petHandler.mount(builder); + storeHandler.mount(builder); + userHandler.mount(builder); - Router router = factory.createRouter(); + Router router = builder.createRouter(); router.errorHandler(400, this::validationFailureHandler); return router; diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiHandler.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiHandler.java index 9dd5df60d58..d215f5db7c5 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiHandler.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/PetApiHandler.java @@ -6,7 +6,7 @@ import org.openapitools.vertxweb.server.model.Pet; import com.fasterxml.jackson.core.type.TypeReference; import io.vertx.core.json.jackson.DatabindCodec; -import io.vertx.ext.web.openapi.RouterFactory; +import io.vertx.ext.web.openapi.RouterBuilder; import io.vertx.ext.web.validation.RequestParameters; import io.vertx.ext.web.validation.RequestParameter; import io.vertx.ext.web.validation.ValidationHandler; @@ -28,15 +28,15 @@ public class PetApiHandler { this.apiImpl = new PetApiImpl(); } - public void mount(RouterFactory factory) { - factory.operation("addPet").handler(this::addPet); - factory.operation("deletePet").handler(this::deletePet); - factory.operation("findPetsByStatus").handler(this::findPetsByStatus); - factory.operation("findPetsByTags").handler(this::findPetsByTags); - factory.operation("getPetById").handler(this::getPetById); - factory.operation("updatePet").handler(this::updatePet); - factory.operation("updatePetWithForm").handler(this::updatePetWithForm); - factory.operation("uploadFile").handler(this::uploadFile); + public void mount(RouterBuilder builder) { + builder.operation("addPet").handler(this::addPet); + builder.operation("deletePet").handler(this::deletePet); + builder.operation("findPetsByStatus").handler(this::findPetsByStatus); + builder.operation("findPetsByTags").handler(this::findPetsByTags); + builder.operation("getPetById").handler(this::getPetById); + builder.operation("updatePet").handler(this::updatePet); + builder.operation("updatePetWithForm").handler(this::updatePetWithForm); + builder.operation("uploadFile").handler(this::uploadFile); } private void addPet(RoutingContext routingContext) { diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/StoreApiHandler.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/StoreApiHandler.java index 32b410ad2f6..584f7cc633d 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/StoreApiHandler.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/StoreApiHandler.java @@ -4,7 +4,7 @@ import org.openapitools.vertxweb.server.model.Order; import com.fasterxml.jackson.core.type.TypeReference; import io.vertx.core.json.jackson.DatabindCodec; -import io.vertx.ext.web.openapi.RouterFactory; +import io.vertx.ext.web.openapi.RouterBuilder; import io.vertx.ext.web.validation.RequestParameters; import io.vertx.ext.web.validation.RequestParameter; import io.vertx.ext.web.validation.ValidationHandler; @@ -26,11 +26,11 @@ public class StoreApiHandler { this.apiImpl = new StoreApiImpl(); } - public void mount(RouterFactory factory) { - factory.operation("deleteOrder").handler(this::deleteOrder); - factory.operation("getInventory").handler(this::getInventory); - factory.operation("getOrderById").handler(this::getOrderById); - factory.operation("placeOrder").handler(this::placeOrder); + public void mount(RouterBuilder builder) { + builder.operation("deleteOrder").handler(this::deleteOrder); + builder.operation("getInventory").handler(this::getInventory); + builder.operation("getOrderById").handler(this::getOrderById); + builder.operation("placeOrder").handler(this::placeOrder); } private void deleteOrder(RoutingContext routingContext) { diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java index dfcbd41aef8..db26552844e 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java @@ -4,7 +4,7 @@ import org.openapitools.vertxweb.server.model.User; import com.fasterxml.jackson.core.type.TypeReference; import io.vertx.core.json.jackson.DatabindCodec; -import io.vertx.ext.web.openapi.RouterFactory; +import io.vertx.ext.web.openapi.RouterBuilder; import io.vertx.ext.web.validation.RequestParameters; import io.vertx.ext.web.validation.RequestParameter; import io.vertx.ext.web.validation.ValidationHandler; @@ -26,15 +26,15 @@ public class UserApiHandler { this.apiImpl = new UserApiImpl(); } - public void mount(RouterFactory factory) { - factory.operation("createUser").handler(this::createUser); - factory.operation("createUsersWithArrayInput").handler(this::createUsersWithArrayInput); - factory.operation("createUsersWithListInput").handler(this::createUsersWithListInput); - factory.operation("deleteUser").handler(this::deleteUser); - factory.operation("getUserByName").handler(this::getUserByName); - factory.operation("loginUser").handler(this::loginUser); - factory.operation("logoutUser").handler(this::logoutUser); - factory.operation("updateUser").handler(this::updateUser); + public void mount(RouterBuilder builder) { + builder.operation("createUser").handler(this::createUser); + builder.operation("createUsersWithArrayInput").handler(this::createUsersWithArrayInput); + builder.operation("createUsersWithListInput").handler(this::createUsersWithListInput); + builder.operation("deleteUser").handler(this::deleteUser); + builder.operation("getUserByName").handler(this::getUserByName); + builder.operation("loginUser").handler(this::loginUser); + builder.operation("logoutUser").handler(this::logoutUser); + builder.operation("updateUser").handler(this::updateUser); } private void createUser(RoutingContext routingContext) { diff --git a/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION b/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION index d99e7162d01..3fa3b389a57 100644 --- a/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/async/pom.xml b/samples/server/petstore/java-vertx/async/pom.xml index 045fe15ed66..217266e583e 100644 --- a/samples/server/petstore/java-vertx/async/pom.xml +++ b/samples/server/petstore/java-vertx/async/pom.xml @@ -12,7 +12,7 @@ UTF-8 1.8 - 4.13 + 4.13.1 3.4.1 3.8.1 1.4.0 @@ -88,4 +88,4 @@ - \ No newline at end of file + diff --git a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/MainApiVerticle.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/MainApiVerticle.java index 695ca48e592..26381f058f1 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/MainApiVerticle.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/MainApiVerticle.java @@ -19,7 +19,7 @@ import io.vertx.core.Vertx; import io.vertx.ext.web.Router; public class MainApiVerticle extends AbstractVerticle { - final static Logger LOGGER = LoggerFactory.getLogger(MainApiVerticle.class); + static final Logger LOGGER = LoggerFactory.getLogger(MainApiVerticle.class); private int serverPort = 8080; protected Router router; @@ -59,9 +59,9 @@ public class MainApiVerticle extends AbstractVerticle { } }); } else { - startFuture.fail(readFile.cause()); + startFuture.fail(readFile.cause()); } - }); + }); } public void deployVerticles(Future startFuture) { @@ -94,4 +94,4 @@ public class MainApiVerticle extends AbstractVerticle { }); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java index 4b3aa4cfb38..d1849cb43f1 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java @@ -17,16 +17,16 @@ import java.util.List; import java.util.Map; public class PetApiVerticle extends AbstractVerticle { - final static Logger LOGGER = LoggerFactory.getLogger(PetApiVerticle.class); + static final Logger LOGGER = LoggerFactory.getLogger(PetApiVerticle.class); - final static String ADDPET_SERVICE_ID = "addPet"; - final static String DELETEPET_SERVICE_ID = "deletePet"; - final static String FINDPETSBYSTATUS_SERVICE_ID = "findPetsByStatus"; - final static String FINDPETSBYTAGS_SERVICE_ID = "findPetsByTags"; - final static String GETPETBYID_SERVICE_ID = "getPetById"; - final static String UPDATEPET_SERVICE_ID = "updatePet"; - final static String UPDATEPETWITHFORM_SERVICE_ID = "updatePetWithForm"; - final static String UPLOADFILE_SERVICE_ID = "uploadFile"; + static final String ADDPET_SERVICE_ID = "addPet"; + static final String DELETEPET_SERVICE_ID = "deletePet"; + static final String FINDPETSBYSTATUS_SERVICE_ID = "findPetsByStatus"; + static final String FINDPETSBYTAGS_SERVICE_ID = "findPetsByTags"; + static final String GETPETBYID_SERVICE_ID = "getPetById"; + static final String UPDATEPET_SERVICE_ID = "updatePet"; + static final String UPDATEPETWITHFORM_SERVICE_ID = "updatePetWithForm"; + static final String UPLOADFILE_SERVICE_ID = "uploadFile"; final PetApi service; diff --git a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java index f83133b94b4..b8cb7b01f36 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java @@ -15,12 +15,12 @@ import java.util.List; import java.util.Map; public class StoreApiVerticle extends AbstractVerticle { - final static Logger LOGGER = LoggerFactory.getLogger(StoreApiVerticle.class); + static final Logger LOGGER = LoggerFactory.getLogger(StoreApiVerticle.class); - final static String DELETEORDER_SERVICE_ID = "deleteOrder"; - final static String GETINVENTORY_SERVICE_ID = "getInventory"; - final static String GETORDERBYID_SERVICE_ID = "getOrderById"; - final static String PLACEORDER_SERVICE_ID = "placeOrder"; + static final String DELETEORDER_SERVICE_ID = "deleteOrder"; + static final String GETINVENTORY_SERVICE_ID = "getInventory"; + static final String GETORDERBYID_SERVICE_ID = "getOrderById"; + static final String PLACEORDER_SERVICE_ID = "placeOrder"; final StoreApi service; diff --git a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java index 8773908b5a0..61ac44f5584 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java @@ -15,16 +15,16 @@ import java.util.List; import java.util.Map; public class UserApiVerticle extends AbstractVerticle { - final static Logger LOGGER = LoggerFactory.getLogger(UserApiVerticle.class); + static final Logger LOGGER = LoggerFactory.getLogger(UserApiVerticle.class); - final static String CREATEUSER_SERVICE_ID = "createUser"; - final static String CREATEUSERSWITHARRAYINPUT_SERVICE_ID = "createUsersWithArrayInput"; - final static String CREATEUSERSWITHLISTINPUT_SERVICE_ID = "createUsersWithListInput"; - final static String DELETEUSER_SERVICE_ID = "deleteUser"; - final static String GETUSERBYNAME_SERVICE_ID = "getUserByName"; - final static String LOGINUSER_SERVICE_ID = "loginUser"; - final static String LOGOUTUSER_SERVICE_ID = "logoutUser"; - final static String UPDATEUSER_SERVICE_ID = "updateUser"; + static final String CREATEUSER_SERVICE_ID = "createUser"; + static final String CREATEUSERSWITHARRAYINPUT_SERVICE_ID = "createUsersWithArrayInput"; + static final String CREATEUSERSWITHLISTINPUT_SERVICE_ID = "createUsersWithListInput"; + static final String DELETEUSER_SERVICE_ID = "deleteUser"; + static final String GETUSERBYNAME_SERVICE_ID = "getUserByName"; + static final String LOGINUSER_SERVICE_ID = "loginUser"; + static final String LOGOUTUSER_SERVICE_ID = "logoutUser"; + static final String UPDATEUSER_SERVICE_ID = "updateUser"; final UserApi service; diff --git a/samples/server/petstore/java-vertx/async/src/main/resources/openapi.json b/samples/server/petstore/java-vertx/async/src/main/resources/openapi.json index 2f40e269947..c292bb5e95a 100644 --- a/samples/server/petstore/java-vertx/async/src/main/resources/openapi.json +++ b/samples/server/petstore/java-vertx/async/src/main/resources/openapi.json @@ -1077,5 +1077,6 @@ "type" : "apiKey" } } - } + }, + "x-original-swagger-version" : "2.0" } \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION b/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION index d99e7162d01..3fa3b389a57 100644 --- a/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +5.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/rx/pom.xml b/samples/server/petstore/java-vertx/rx/pom.xml index 94552601511..2b575c68e75 100644 --- a/samples/server/petstore/java-vertx/rx/pom.xml +++ b/samples/server/petstore/java-vertx/rx/pom.xml @@ -12,7 +12,7 @@ UTF-8 1.8 - 4.13 + 4.13.1 3.4.1 3.8.1 1.4.0 @@ -88,4 +88,4 @@ - \ No newline at end of file + diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/MainApiVerticle.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/MainApiVerticle.java index 695ca48e592..26381f058f1 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/MainApiVerticle.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/MainApiVerticle.java @@ -19,7 +19,7 @@ import io.vertx.core.Vertx; import io.vertx.ext.web.Router; public class MainApiVerticle extends AbstractVerticle { - final static Logger LOGGER = LoggerFactory.getLogger(MainApiVerticle.class); + static final Logger LOGGER = LoggerFactory.getLogger(MainApiVerticle.class); private int serverPort = 8080; protected Router router; @@ -59,9 +59,9 @@ public class MainApiVerticle extends AbstractVerticle { } }); } else { - startFuture.fail(readFile.cause()); + startFuture.fail(readFile.cause()); } - }); + }); } public void deployVerticles(Future startFuture) { @@ -94,4 +94,4 @@ public class MainApiVerticle extends AbstractVerticle { }); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java index 7caf45dfd24..2d5cfdb068b 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java @@ -17,16 +17,16 @@ import java.util.List; import java.util.Map; public class PetApiVerticle extends AbstractVerticle { - final static Logger LOGGER = LoggerFactory.getLogger(PetApiVerticle.class); + static final Logger LOGGER = LoggerFactory.getLogger(PetApiVerticle.class); - final static String ADDPET_SERVICE_ID = "addPet"; - final static String DELETEPET_SERVICE_ID = "deletePet"; - final static String FINDPETSBYSTATUS_SERVICE_ID = "findPetsByStatus"; - final static String FINDPETSBYTAGS_SERVICE_ID = "findPetsByTags"; - final static String GETPETBYID_SERVICE_ID = "getPetById"; - final static String UPDATEPET_SERVICE_ID = "updatePet"; - final static String UPDATEPETWITHFORM_SERVICE_ID = "updatePetWithForm"; - final static String UPLOADFILE_SERVICE_ID = "uploadFile"; + static final String ADDPET_SERVICE_ID = "addPet"; + static final String DELETEPET_SERVICE_ID = "deletePet"; + static final String FINDPETSBYSTATUS_SERVICE_ID = "findPetsByStatus"; + static final String FINDPETSBYTAGS_SERVICE_ID = "findPetsByTags"; + static final String GETPETBYID_SERVICE_ID = "getPetById"; + static final String UPDATEPET_SERVICE_ID = "updatePet"; + static final String UPDATEPETWITHFORM_SERVICE_ID = "updatePetWithForm"; + static final String UPLOADFILE_SERVICE_ID = "uploadFile"; final PetApi service; diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java index 6e1a60becac..f8b2d9ce0aa 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java @@ -15,12 +15,12 @@ import java.util.List; import java.util.Map; public class StoreApiVerticle extends AbstractVerticle { - final static Logger LOGGER = LoggerFactory.getLogger(StoreApiVerticle.class); + static final Logger LOGGER = LoggerFactory.getLogger(StoreApiVerticle.class); - final static String DELETEORDER_SERVICE_ID = "deleteOrder"; - final static String GETINVENTORY_SERVICE_ID = "getInventory"; - final static String GETORDERBYID_SERVICE_ID = "getOrderById"; - final static String PLACEORDER_SERVICE_ID = "placeOrder"; + static final String DELETEORDER_SERVICE_ID = "deleteOrder"; + static final String GETINVENTORY_SERVICE_ID = "getInventory"; + static final String GETORDERBYID_SERVICE_ID = "getOrderById"; + static final String PLACEORDER_SERVICE_ID = "placeOrder"; final StoreApi service; diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java index 7233d8e3e29..756b31863fa 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java @@ -15,16 +15,16 @@ import java.util.List; import java.util.Map; public class UserApiVerticle extends AbstractVerticle { - final static Logger LOGGER = LoggerFactory.getLogger(UserApiVerticle.class); + static final Logger LOGGER = LoggerFactory.getLogger(UserApiVerticle.class); - final static String CREATEUSER_SERVICE_ID = "createUser"; - final static String CREATEUSERSWITHARRAYINPUT_SERVICE_ID = "createUsersWithArrayInput"; - final static String CREATEUSERSWITHLISTINPUT_SERVICE_ID = "createUsersWithListInput"; - final static String DELETEUSER_SERVICE_ID = "deleteUser"; - final static String GETUSERBYNAME_SERVICE_ID = "getUserByName"; - final static String LOGINUSER_SERVICE_ID = "loginUser"; - final static String LOGOUTUSER_SERVICE_ID = "logoutUser"; - final static String UPDATEUSER_SERVICE_ID = "updateUser"; + static final String CREATEUSER_SERVICE_ID = "createUser"; + static final String CREATEUSERSWITHARRAYINPUT_SERVICE_ID = "createUsersWithArrayInput"; + static final String CREATEUSERSWITHLISTINPUT_SERVICE_ID = "createUsersWithListInput"; + static final String DELETEUSER_SERVICE_ID = "deleteUser"; + static final String GETUSERBYNAME_SERVICE_ID = "getUserByName"; + static final String LOGINUSER_SERVICE_ID = "loginUser"; + static final String LOGOUTUSER_SERVICE_ID = "logoutUser"; + static final String UPDATEUSER_SERVICE_ID = "updateUser"; final UserApi service; diff --git a/samples/server/petstore/java-vertx/rx/src/main/resources/openapi.json b/samples/server/petstore/java-vertx/rx/src/main/resources/openapi.json index 2f40e269947..c292bb5e95a 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/resources/openapi.json +++ b/samples/server/petstore/java-vertx/rx/src/main/resources/openapi.json @@ -1077,5 +1077,6 @@ "type" : "apiKey" } } - } + }, + "x-original-swagger-version" : "2.0" } \ No newline at end of file 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 c3b6939b7e7..8f7d9a631ce 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 @@ -60,8 +60,9 @@ public class AnotherFakeApi { @Consumes({ "application/json" }) @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) public Response call123testSpecialTags(@ApiParam(value = "client model", required = true) @NotNull @Valid Client body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.call123testSpecialTags(body, securityContext); 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 c1790615497..7f54c488ad1 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 @@ -70,8 +70,9 @@ public class FakeApi { @Consumes({ "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }) @io.swagger.annotations.ApiOperation(value = "creates an XmlItem", notes = "this route creates an XmlItem", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @NotNull @Valid XmlItem xmlItem,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createXmlItem(xmlItem, securityContext); @@ -81,8 +82,9 @@ public class FakeApi { @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) + }) public Response fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") Boolean body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterBooleanSerialize(body, securityContext); @@ -92,8 +94,9 @@ public class FakeApi { @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) + }) public Response fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid OuterComposite body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterCompositeSerialize(body, securityContext); @@ -103,8 +106,9 @@ public class FakeApi { @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) + }) public Response fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") BigDecimal body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterNumberSerialize(body, securityContext); @@ -114,8 +118,9 @@ public class FakeApi { @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Output string", response = String.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Output string", response = String.class) + }) public Response fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") String body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterStringSerialize(body, securityContext); @@ -125,8 +130,9 @@ public class FakeApi { @Consumes({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "", notes = "For this test, the body for this request much reference a schema named `File`.", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) + }) public Response testBodyWithFileSchema(@ApiParam(value = "", required = true) @NotNull @Valid FileSchemaTestClass body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testBodyWithFileSchema(body, securityContext); @@ -136,8 +142,9 @@ public class FakeApi { @Consumes({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "", notes = "", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) + }) public Response testBodyWithQueryParams(@ApiParam(value = "", required = true) @QueryParam("query") @NotNull String query,@ApiParam(value = "", required = true) @NotNull @Valid User body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testBodyWithQueryParams(query, body, securityContext); @@ -147,8 +154,9 @@ public class FakeApi { @Consumes({ "application/json" }) @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) public Response testClientModel(@ApiParam(value = "client model", required = true) @NotNull @Valid Client body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testClientModel(body, securityContext); @@ -160,10 +168,10 @@ public class FakeApi { @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "http_basic_test") }, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response testEndpointParameters(@ApiParam(value = "None", required=true) @FormParam("number") BigDecimal number,@ApiParam(value = "None", required=true) @FormParam("double") Double _double,@ApiParam(value = "None", required=true) @FormParam("pattern_without_delimiter") String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @FormParam("byte") byte[] _byte,@ApiParam(value = "None") @FormParam("integer") Integer integer,@ApiParam(value = "None") @FormParam("int32") Integer int32,@ApiParam(value = "None") @FormParam("int64") Long int64,@ApiParam(value = "None") @FormParam("float") Float _float,@ApiParam(value = "None") @FormParam("string") String string, @FormDataParam("binary") FormDataBodyPart binaryBodypart ,@ApiParam(value = "None") @FormParam("date") LocalDate date,@ApiParam(value = "None") @FormParam("dateTime") OffsetDateTime dateTime,@ApiParam(value = "None") @FormParam("password") String password,@ApiParam(value = "None") @FormParam("callback") String paramCallback,@Context SecurityContext securityContext) throws NotFoundException { @@ -174,10 +182,10 @@ public class FakeApi { @Consumes({ "application/x-www-form-urlencoded" }) @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) + }) public Response testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $", defaultValue="new ArrayList<>()")@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)") @QueryParam("enum_query_string_array") @Valid List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue = "-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @QueryParam("enum_query_double") Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $", defaultValue="$") @DefaultValue("$") @FormParam("enum_form_string_array") List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, securityContext); @@ -187,8 +195,9 @@ public class FakeApi { @io.swagger.annotations.ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Someting wrong", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Someting wrong", response = Void.class) + }) public Response testGroupParameters(@ApiParam(value = "Required String in group parameters", required = true) @QueryParam("required_string_group") @NotNull Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true)@HeaderParam("required_boolean_group") Boolean requiredBooleanGroup,@ApiParam(value = "Required Integer in group parameters", required = true) @QueryParam("required_int64_group") @NotNull Long requiredInt64Group,@ApiParam(value = "String in group parameters") @QueryParam("string_group") Integer stringGroup,@ApiParam(value = "Boolean in group parameters" )@HeaderParam("boolean_group") Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @QueryParam("int64_group") Long int64Group,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, securityContext); @@ -198,8 +207,9 @@ public class FakeApi { @Consumes({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @NotNull @Valid Map param,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testInlineAdditionalProperties(param, securityContext); @@ -209,8 +219,9 @@ public class FakeApi { @Consumes({ "application/x-www-form-urlencoded" }) @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response testJsonFormData(@ApiParam(value = "field1", required=true) @FormParam("param") String param,@ApiParam(value = "field2", required=true) @FormParam("param2") String param2,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testJsonFormData(param, param2, securityContext); @@ -220,8 +231,9 @@ public class FakeApi { @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) + }) public Response testQueryParameterCollectionFormat(@ApiParam(value = "", required = true) @QueryParam("pipe") @NotNull @Valid List pipe,@ApiParam(value = "", required = true) @QueryParam("ioutil") @NotNull @Valid List ioutil,@ApiParam(value = "", required = true) @QueryParam("http") @NotNull @Valid List http,@ApiParam(value = "", required = true) @QueryParam("url") @NotNull @Valid List url,@ApiParam(value = "", required = true) @QueryParam("context") @NotNull @Valid List context,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, securityContext); @@ -236,8 +248,9 @@ public class FakeApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) + }) public Response uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathParam("petId") @NotNull Long petId, @FormDataParam("requiredFile") FormDataBodyPart requiredFileBodypart ,@ApiParam(value = "Additional data to pass to server")@FormDataParam("additionalMetadata") String additionalMetadata,@Context SecurityContext securityContext) throws NotFoundException { 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 d0b9ebe7ab7..cb2aa18bb80 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 @@ -62,8 +62,9 @@ public class FakeClassnameTestApi { @io.swagger.annotations.ApiOperation(value = "To test class name in snake case", notes = "To test class name in snake case", response = Client.class, authorizations = { @io.swagger.annotations.Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) public Response testClassname(@ApiParam(value = "client model", required = true) @NotNull @Valid Client body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testClassname(body, securityContext); 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 22e390d6d75..a31dd8b4083 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 @@ -68,10 +68,10 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) + }) public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @NotNull @Valid Pet body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.addPet(body, securityContext); @@ -86,10 +86,10 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) + }) public Response deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathParam("petId") @NotNull Long petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext) throws NotFoundException { return delegate.deletePet(petId, apiKey, securityContext); @@ -104,10 +104,10 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) + }) public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true) @QueryParam("status") @NotNull @Valid List status,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByStatus(status, securityContext); @@ -122,10 +122,10 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) + }) public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid Set tags,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags, securityContext); @@ -137,12 +137,11 @@ public class PetApi { @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { @io.swagger.annotations.Authorization(value = "api_key") }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) + }) public Response getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathParam("petId") @NotNull Long petId,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getPetById(petId, securityContext); @@ -157,14 +156,12 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) + }) public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @NotNull @Valid Pet body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.updatePet(body, securityContext); @@ -179,8 +176,9 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) + }) public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathParam("petId") @NotNull Long petId,@ApiParam(value = "Updated name of the pet") @FormParam("name") String name,@ApiParam(value = "Updated status of the pet") @FormParam("status") String status,@Context SecurityContext securityContext) throws NotFoundException { return delegate.updatePetWithForm(petId, name, status, securityContext); @@ -195,8 +193,9 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) + }) public Response uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathParam("petId") @NotNull Long petId,@ApiParam(value = "Additional data to pass to server")@FormDataParam("additionalMetadata") String additionalMetadata, @FormDataParam("file") FormDataBodyPart fileBodypart ,@Context SecurityContext securityContext) throws NotFoundException { 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 11a88fa9459..39fbe7fb874 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 @@ -61,10 +61,10 @@ public class StoreApi { @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) + }) public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathParam("order_id") @NotNull String orderId,@Context SecurityContext securityContext) throws NotFoundException { return delegate.deleteOrder(orderId, securityContext); @@ -76,8 +76,9 @@ public class StoreApi { @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @io.swagger.annotations.Authorization(value = "api_key") }, tags={ "store", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") + }) public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException { return delegate.getInventory(securityContext); @@ -87,12 +88,11 @@ public class StoreApi { @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) + }) public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathParam("order_id") @NotNull @Min(1L) @Max(5L) Long orderId,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getOrderById(orderId, securityContext); @@ -102,10 +102,10 @@ public class StoreApi { @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) + }) public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @NotNull @Valid Order body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.placeOrder(body, securityContext); 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 8f8e8f72c01..36cc9df40f1 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 @@ -61,8 +61,9 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response createUser(@ApiParam(value = "Created user object", required = true) @NotNull @Valid User body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createUser(body, securityContext); @@ -72,8 +73,9 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @NotNull @Valid List body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createUsersWithArrayInput(body, securityContext); @@ -83,8 +85,9 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @NotNull @Valid List body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createUsersWithListInput(body, securityContext); @@ -94,10 +97,10 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathParam("username") @NotNull String username,@Context SecurityContext securityContext) throws NotFoundException { return delegate.deleteUser(username, securityContext); @@ -107,12 +110,11 @@ public class UserApi { @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathParam("username") @NotNull String username,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getUserByName(username, securityContext); @@ -122,10 +124,10 @@ public class UserApi { @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) + }) public Response loginUser(@ApiParam(value = "The user name for login", required = true) @QueryParam("username") @NotNull String username,@ApiParam(value = "The password for login in clear text", required = true) @QueryParam("password") @NotNull String password,@Context SecurityContext securityContext) throws NotFoundException { return delegate.loginUser(username, password, securityContext); @@ -135,8 +137,9 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response logoutUser(@Context SecurityContext securityContext) throws NotFoundException { return delegate.logoutUser(securityContext); @@ -146,10 +149,10 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathParam("username") @NotNull String username,@ApiParam(value = "Updated user object", required = true) @NotNull @Valid User body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.updateUser(username, body, securityContext); 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 df37d6838b2..107c2ff4dab 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 @@ -60,8 +60,9 @@ public class AnotherFakeApi { @Consumes({ "application/json" }) @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) public Response call123testSpecialTags(@ApiParam(value = "client model", required = true) @NotNull @Valid Client client,@Context SecurityContext securityContext) throws NotFoundException { return delegate.call123testSpecialTags(client, securityContext); 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 e3e8e029a2d..3ce42cd81fb 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 @@ -70,8 +70,9 @@ public class FakeApi { @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "Health check endpoint", notes = "", response = HealthCheckResult.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "The instance started successfully", response = HealthCheckResult.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "The instance started successfully", response = HealthCheckResult.class) + }) public Response fakeHealthGet(@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeHealthGet(securityContext); @@ -83,8 +84,9 @@ public class FakeApi { @io.swagger.annotations.ApiOperation(value = "test http signature authentication", notes = "", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "http_signature_test") }, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "The instance started successfully", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "The instance started successfully", response = Void.class) + }) public Response fakeHttpSignatureTest(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @NotNull @Valid Pet pet,@ApiParam(value = "query parameter") @QueryParam("query_1") String query1,@ApiParam(value = "header parameter" )@HeaderParam("header_1") String header1,@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeHttpSignatureTest(pet, query1, header1, securityContext); @@ -94,8 +96,9 @@ public class FakeApi { @Consumes({ "application/json" }) @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) + }) public Response fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") Boolean body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterBooleanSerialize(body, securityContext); @@ -105,8 +108,9 @@ public class FakeApi { @Consumes({ "application/json" }) @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) + }) public Response fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid OuterComposite outerComposite,@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterCompositeSerialize(outerComposite, securityContext); @@ -116,8 +120,9 @@ public class FakeApi { @Consumes({ "application/json" }) @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) + }) public Response fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") BigDecimal body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterNumberSerialize(body, securityContext); @@ -127,8 +132,9 @@ public class FakeApi { @Consumes({ "application/json" }) @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Output string", response = String.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Output string", response = String.class) + }) public Response fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") String body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterStringSerialize(body, securityContext); @@ -138,8 +144,9 @@ public class FakeApi { @Consumes({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "", notes = "For this test, the body for this request much reference a schema named `File`.", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) + }) public Response testBodyWithFileSchema(@ApiParam(value = "", required = true) @NotNull @Valid FileSchemaTestClass fileSchemaTestClass,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testBodyWithFileSchema(fileSchemaTestClass, securityContext); @@ -149,8 +156,9 @@ public class FakeApi { @Consumes({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "", notes = "", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) + }) public Response testBodyWithQueryParams(@ApiParam(value = "", required = true) @QueryParam("query") @NotNull String query,@ApiParam(value = "", required = true) @NotNull @Valid User user,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testBodyWithQueryParams(query, user, securityContext); @@ -160,8 +168,9 @@ public class FakeApi { @Consumes({ "application/json" }) @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) public Response testClientModel(@ApiParam(value = "client model", required = true) @NotNull @Valid Client client,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testClientModel(client, securityContext); @@ -173,10 +182,10 @@ public class FakeApi { @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "http_basic_test") }, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response testEndpointParameters(@ApiParam(value = "None", required=true) @FormParam("number") BigDecimal number,@ApiParam(value = "None", required=true) @FormParam("double") Double _double,@ApiParam(value = "None", required=true) @FormParam("pattern_without_delimiter") String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @FormParam("byte") byte[] _byte,@ApiParam(value = "None") @FormParam("integer") Integer integer,@ApiParam(value = "None") @FormParam("int32") Integer int32,@ApiParam(value = "None") @FormParam("int64") Long int64,@ApiParam(value = "None") @FormParam("float") Float _float,@ApiParam(value = "None") @FormParam("string") String string, @FormDataParam("binary") FormDataBodyPart binaryBodypart ,@ApiParam(value = "None") @FormParam("date") Date date,@ApiParam(value = "None") @FormParam("dateTime") Date dateTime,@ApiParam(value = "None") @FormParam("password") String password,@ApiParam(value = "None") @FormParam("callback") String paramCallback,@Context SecurityContext securityContext) throws NotFoundException { @@ -187,10 +196,10 @@ public class FakeApi { @Consumes({ "application/x-www-form-urlencoded" }) @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) + }) public Response testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $", defaultValue="new ArrayList()")@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)") @QueryParam("enum_query_string_array") @Valid List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue = "-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @QueryParam("enum_query_double") Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $", defaultValue="$") @DefaultValue("$") @FormParam("enum_form_string_array") List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, securityContext); @@ -202,8 +211,9 @@ public class FakeApi { @io.swagger.annotations.ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "bearer_test") }, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Someting wrong", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Someting wrong", response = Void.class) + }) public Response testGroupParameters(@ApiParam(value = "Required String in group parameters", required = true) @QueryParam("required_string_group") @NotNull Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true)@HeaderParam("required_boolean_group") Boolean requiredBooleanGroup,@ApiParam(value = "Required Integer in group parameters", required = true) @QueryParam("required_int64_group") @NotNull Long requiredInt64Group,@ApiParam(value = "String in group parameters") @QueryParam("string_group") Integer stringGroup,@ApiParam(value = "Boolean in group parameters" )@HeaderParam("boolean_group") Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @QueryParam("int64_group") Long int64Group,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, securityContext); @@ -213,8 +223,9 @@ public class FakeApi { @Consumes({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @NotNull @Valid Map requestBody,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testInlineAdditionalProperties(requestBody, securityContext); @@ -224,8 +235,9 @@ public class FakeApi { @Consumes({ "application/x-www-form-urlencoded" }) @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response testJsonFormData(@ApiParam(value = "field1", required=true) @FormParam("param") String param,@ApiParam(value = "field2", required=true) @FormParam("param2") String param2,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testJsonFormData(param, param2, securityContext); @@ -235,8 +247,9 @@ public class FakeApi { @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) + }) public Response testQueryParameterCollectionFormat(@ApiParam(value = "", required = true) @QueryParam("pipe") @NotNull @Valid List pipe,@ApiParam(value = "", required = true) @QueryParam("ioutil") @NotNull @Valid List ioutil,@ApiParam(value = "", required = true) @QueryParam("http") @NotNull @Valid List http,@ApiParam(value = "", required = true) @QueryParam("url") @NotNull @Valid List url,@ApiParam(value = "", required = true) @QueryParam("context") @NotNull @Valid List context,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, securityContext); @@ -251,8 +264,9 @@ public class FakeApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) + }) public Response uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathParam("petId") @NotNull Long petId, @FormDataParam("requiredFile") FormDataBodyPart requiredFileBodypart ,@ApiParam(value = "Additional data to pass to server")@FormDataParam("additionalMetadata") String additionalMetadata,@Context SecurityContext securityContext) throws NotFoundException { 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 d0c2ed09e19..610cdf10541 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 @@ -62,8 +62,9 @@ public class FakeClassnameTestApi { @io.swagger.annotations.ApiOperation(value = "To test class name in snake case", notes = "To test class name in snake case", response = Client.class, authorizations = { @io.swagger.annotations.Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) public Response testClassname(@ApiParam(value = "client model", required = true) @NotNull @Valid Client client,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testClassname(client, securityContext); 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 b8c8acf12a9..c03c94e18f2 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 @@ -60,8 +60,9 @@ public class FooApi { @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "", notes = "", response = InlineResponseDefault.class, tags={ }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "response", response = InlineResponseDefault.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "response", response = InlineResponseDefault.class) + }) public Response fooGet(@Context SecurityContext securityContext) throws NotFoundException { return delegate.fooGet(securityContext); 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 e4e091bf1d8..498a5e0d55a 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 @@ -67,8 +67,10 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Successful operation", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) + }) public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @NotNull @Valid Pet pet,@Context SecurityContext securityContext) throws NotFoundException { return delegate.addPet(pet, securityContext); @@ -83,8 +85,10 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Successful operation", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) + }) public Response deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathParam("petId") @NotNull Long petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext) throws NotFoundException { return delegate.deletePet(petId, apiKey, securityContext); @@ -99,10 +103,10 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) + }) public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true) @QueryParam("status") @NotNull @Valid List status,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByStatus(status, securityContext); @@ -117,10 +121,10 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) + }) public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid List tags,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags, securityContext); @@ -132,12 +136,11 @@ public class PetApi { @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { @io.swagger.annotations.Authorization(value = "api_key") }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) + }) public Response getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathParam("petId") @NotNull Long petId,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getPetById(petId, securityContext); @@ -152,12 +155,12 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Successful operation", response = Void.class), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) + }) public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @NotNull @Valid Pet pet,@Context SecurityContext securityContext) throws NotFoundException { return delegate.updatePet(pet, securityContext); @@ -172,8 +175,10 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Successful operation", response = Void.class), + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) + }) public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathParam("petId") @NotNull Long petId,@ApiParam(value = "Updated name of the pet") @FormParam("name") String name,@ApiParam(value = "Updated status of the pet") @FormParam("status") String status,@Context SecurityContext securityContext) throws NotFoundException { return delegate.updatePetWithForm(petId, name, status, securityContext); @@ -188,8 +193,9 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) + }) public Response uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathParam("petId") @NotNull Long petId,@ApiParam(value = "Additional data to pass to server")@FormDataParam("additionalMetadata") String additionalMetadata, @FormDataParam("file") FormDataBodyPart fileBodypart ,@Context SecurityContext securityContext) throws NotFoundException { 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 8b8feaa5aa3..59e5838348c 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 @@ -61,10 +61,10 @@ public class StoreApi { @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) + }) public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathParam("order_id") @NotNull String orderId,@Context SecurityContext securityContext) throws NotFoundException { return delegate.deleteOrder(orderId, securityContext); @@ -76,8 +76,9 @@ public class StoreApi { @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @io.swagger.annotations.Authorization(value = "api_key") }, tags={ "store", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") + }) public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException { return delegate.getInventory(securityContext); @@ -87,12 +88,11 @@ public class StoreApi { @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) + }) public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathParam("order_id") @NotNull @Min(1L) @Max(5L) Long orderId,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getOrderById(orderId, securityContext); @@ -102,10 +102,10 @@ public class StoreApi { @Consumes({ "application/json" }) @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) + }) public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @NotNull @Valid Order order,@Context SecurityContext securityContext) throws NotFoundException { return delegate.placeOrder(order, securityContext); 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 bd4006d8d8c..e394533a252 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 @@ -61,8 +61,9 @@ public class UserApi { @Consumes({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response createUser(@ApiParam(value = "Created user object", required = true) @NotNull @Valid User user,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createUser(user, securityContext); @@ -72,8 +73,9 @@ public class UserApi { @Consumes({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @NotNull @Valid List user,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createUsersWithArrayInput(user, securityContext); @@ -83,8 +85,9 @@ public class UserApi { @Consumes({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @NotNull @Valid List user,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createUsersWithListInput(user, securityContext); @@ -94,10 +97,10 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathParam("username") @NotNull String username,@Context SecurityContext securityContext) throws NotFoundException { return delegate.deleteUser(username, securityContext); @@ -107,12 +110,11 @@ public class UserApi { @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathParam("username") @NotNull String username,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getUserByName(username, securityContext); @@ -122,10 +124,10 @@ public class UserApi { @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) + }) public Response loginUser(@ApiParam(value = "The user name for login", required = true) @QueryParam("username") @NotNull String username,@ApiParam(value = "The password for login in clear text", required = true) @QueryParam("password") @NotNull String password,@Context SecurityContext securityContext) throws NotFoundException { return delegate.loginUser(username, password, securityContext); @@ -135,8 +137,9 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response logoutUser(@Context SecurityContext securityContext) throws NotFoundException { return delegate.logoutUser(securityContext); @@ -146,10 +149,10 @@ public class UserApi { @Consumes({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathParam("username") @NotNull String username,@ApiParam(value = "Updated user object", required = true) @NotNull @Valid User user,@Context SecurityContext securityContext) throws NotFoundException { return delegate.updateUser(username, user, securityContext); 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 828b1a21e67..e2e969716b3 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 @@ -60,8 +60,9 @@ public class AnotherFakeApi { @Consumes({ "application/json" }) @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) public Response call123testSpecialTags(@ApiParam(value = "client model", required = true) @NotNull @Valid Client body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.call123testSpecialTags(body, securityContext); 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 1db92cafd33..80dee9b4398 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 @@ -68,8 +68,9 @@ public class FakeApi { @Consumes({ "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }) @io.swagger.annotations.ApiOperation(value = "creates an XmlItem", notes = "this route creates an XmlItem", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @NotNull @Valid XmlItem xmlItem,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createXmlItem(xmlItem, securityContext); @@ -79,8 +80,9 @@ public class FakeApi { @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) + }) public Response fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") Boolean body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterBooleanSerialize(body, securityContext); @@ -90,8 +92,9 @@ public class FakeApi { @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) + }) public Response fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid OuterComposite body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterCompositeSerialize(body, securityContext); @@ -101,8 +104,9 @@ public class FakeApi { @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) + }) public Response fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") BigDecimal body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterNumberSerialize(body, securityContext); @@ -112,8 +116,9 @@ public class FakeApi { @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Output string", response = String.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Output string", response = String.class) + }) public Response fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") String body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterStringSerialize(body, securityContext); @@ -123,8 +128,9 @@ public class FakeApi { @Consumes({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "", notes = "For this test, the body for this request much reference a schema named `File`.", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) + }) public Response testBodyWithFileSchema(@ApiParam(value = "", required = true) @NotNull @Valid FileSchemaTestClass body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testBodyWithFileSchema(body, securityContext); @@ -134,8 +140,9 @@ public class FakeApi { @Consumes({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "", notes = "", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) + }) public Response testBodyWithQueryParams(@ApiParam(value = "", required = true) @QueryParam("query") @NotNull String query,@ApiParam(value = "", required = true) @NotNull @Valid User body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testBodyWithQueryParams(query, body, securityContext); @@ -145,8 +152,9 @@ public class FakeApi { @Consumes({ "application/json" }) @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) public Response testClientModel(@ApiParam(value = "client model", required = true) @NotNull @Valid Client body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testClientModel(body, securityContext); @@ -158,10 +166,10 @@ public class FakeApi { @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "http_basic_test") }, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response testEndpointParameters(@ApiParam(value = "None", required=true) @FormParam("number") BigDecimal number,@ApiParam(value = "None", required=true) @FormParam("double") Double _double,@ApiParam(value = "None", required=true) @FormParam("pattern_without_delimiter") String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @FormParam("byte") byte[] _byte,@ApiParam(value = "None") @FormParam("integer") Integer integer,@ApiParam(value = "None") @FormParam("int32") Integer int32,@ApiParam(value = "None") @FormParam("int64") Long int64,@ApiParam(value = "None") @FormParam("float") Float _float,@ApiParam(value = "None") @FormParam("string") String string, @FormDataParam("binary") FormDataBodyPart binaryBodypart ,@ApiParam(value = "None") @FormParam("date") Date date,@ApiParam(value = "None") @FormParam("dateTime") Date dateTime,@ApiParam(value = "None") @FormParam("password") String password,@ApiParam(value = "None") @FormParam("callback") String paramCallback,@Context SecurityContext securityContext) throws NotFoundException { @@ -172,10 +180,10 @@ public class FakeApi { @Consumes({ "application/x-www-form-urlencoded" }) @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) + }) public Response testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $", defaultValue="new ArrayList()")@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)") @QueryParam("enum_query_string_array") @Valid List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue = "-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @QueryParam("enum_query_double") Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $", defaultValue="$") @DefaultValue("$") @FormParam("enum_form_string_array") List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, securityContext); @@ -185,8 +193,9 @@ public class FakeApi { @io.swagger.annotations.ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Someting wrong", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Someting wrong", response = Void.class) + }) public Response testGroupParameters(@ApiParam(value = "Required String in group parameters", required = true) @QueryParam("required_string_group") @NotNull Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true)@HeaderParam("required_boolean_group") Boolean requiredBooleanGroup,@ApiParam(value = "Required Integer in group parameters", required = true) @QueryParam("required_int64_group") @NotNull Long requiredInt64Group,@ApiParam(value = "String in group parameters") @QueryParam("string_group") Integer stringGroup,@ApiParam(value = "Boolean in group parameters" )@HeaderParam("boolean_group") Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @QueryParam("int64_group") Long int64Group,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, securityContext); @@ -196,8 +205,9 @@ public class FakeApi { @Consumes({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @NotNull @Valid Map param,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testInlineAdditionalProperties(param, securityContext); @@ -207,8 +217,9 @@ public class FakeApi { @Consumes({ "application/x-www-form-urlencoded" }) @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response testJsonFormData(@ApiParam(value = "field1", required=true) @FormParam("param") String param,@ApiParam(value = "field2", required=true) @FormParam("param2") String param2,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testJsonFormData(param, param2, securityContext); @@ -218,8 +229,9 @@ public class FakeApi { @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) + }) public Response testQueryParameterCollectionFormat(@ApiParam(value = "", required = true) @QueryParam("pipe") @NotNull @Valid List pipe,@ApiParam(value = "", required = true) @QueryParam("ioutil") @NotNull @Valid List ioutil,@ApiParam(value = "", required = true) @QueryParam("http") @NotNull @Valid List http,@ApiParam(value = "", required = true) @QueryParam("url") @NotNull @Valid List url,@ApiParam(value = "", required = true) @QueryParam("context") @NotNull @Valid List context,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, securityContext); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java index 7576189e356..a7cb2eb4f9c 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 @@ -62,8 +62,9 @@ public class FakeClassnameTags123Api { @io.swagger.annotations.ApiOperation(value = "To test class name in snake case", notes = "To test class name in snake case", response = Client.class, authorizations = { @io.swagger.annotations.Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) public Response testClassname(@ApiParam(value = "client model", required = true) @NotNull @Valid Client body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testClassname(body, securityContext); 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 1f5fd171a90..34a10fd7595 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 @@ -68,10 +68,10 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) + }) public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @NotNull @Valid Pet body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.addPet(body, securityContext); @@ -86,10 +86,10 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) + }) public Response deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathParam("petId") @NotNull Long petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext) throws NotFoundException { return delegate.deletePet(petId, apiKey, securityContext); @@ -104,10 +104,10 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) + }) public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true) @QueryParam("status") @NotNull @Valid List status,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByStatus(status, securityContext); @@ -122,10 +122,10 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) + }) public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid Set tags,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags, securityContext); @@ -137,12 +137,11 @@ public class PetApi { @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { @io.swagger.annotations.Authorization(value = "api_key") }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) + }) public Response getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathParam("petId") @NotNull Long petId,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getPetById(petId, securityContext); @@ -157,14 +156,12 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) + }) public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @NotNull @Valid Pet body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.updatePet(body, securityContext); @@ -179,8 +176,9 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) + }) public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathParam("petId") @NotNull Long petId,@ApiParam(value = "Updated name of the pet") @FormParam("name") String name,@ApiParam(value = "Updated status of the pet") @FormParam("status") String status,@Context SecurityContext securityContext) throws NotFoundException { return delegate.updatePetWithForm(petId, name, status, securityContext); @@ -195,8 +193,9 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) + }) public Response uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathParam("petId") @NotNull Long petId,@ApiParam(value = "Additional data to pass to server")@FormDataParam("additionalMetadata") String additionalMetadata, @FormDataParam("file") FormDataBodyPart fileBodypart ,@Context SecurityContext securityContext) throws NotFoundException { @@ -212,8 +211,9 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) + }) public Response uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathParam("petId") @NotNull Long petId, @FormDataParam("requiredFile") FormDataBodyPart requiredFileBodypart ,@ApiParam(value = "Additional data to pass to server")@FormDataParam("additionalMetadata") String additionalMetadata,@Context SecurityContext securityContext) throws NotFoundException { 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 3f9f55d4acc..717f813e51f 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 @@ -61,10 +61,10 @@ public class StoreApi { @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) + }) public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathParam("order_id") @NotNull String orderId,@Context SecurityContext securityContext) throws NotFoundException { return delegate.deleteOrder(orderId, securityContext); @@ -76,8 +76,9 @@ public class StoreApi { @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @io.swagger.annotations.Authorization(value = "api_key") }, tags={ "store", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") + }) public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException { return delegate.getInventory(securityContext); @@ -87,12 +88,11 @@ public class StoreApi { @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) + }) public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathParam("order_id") @NotNull @Min(1L) @Max(5L) Long orderId,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getOrderById(orderId, securityContext); @@ -102,10 +102,10 @@ public class StoreApi { @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) + }) public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @NotNull @Valid Order body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.placeOrder(body, securityContext); 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 7ad517e4c0d..18cbe2d5c3b 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 @@ -61,8 +61,9 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response createUser(@ApiParam(value = "Created user object", required = true) @NotNull @Valid User body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createUser(body, securityContext); @@ -72,8 +73,9 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @NotNull @Valid List body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createUsersWithArrayInput(body, securityContext); @@ -83,8 +85,9 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @NotNull @Valid List body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createUsersWithListInput(body, securityContext); @@ -94,10 +97,10 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathParam("username") @NotNull String username,@Context SecurityContext securityContext) throws NotFoundException { return delegate.deleteUser(username, securityContext); @@ -107,12 +110,11 @@ public class UserApi { @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathParam("username") @NotNull String username,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getUserByName(username, securityContext); @@ -122,10 +124,10 @@ public class UserApi { @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) + }) public Response loginUser(@ApiParam(value = "The user name for login", required = true) @QueryParam("username") @NotNull String username,@ApiParam(value = "The password for login in clear text", required = true) @QueryParam("password") @NotNull String password,@Context SecurityContext securityContext) throws NotFoundException { return delegate.loginUser(username, password, securityContext); @@ -135,8 +137,9 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response logoutUser(@Context SecurityContext securityContext) throws NotFoundException { return delegate.logoutUser(securityContext); @@ -146,10 +149,10 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathParam("username") @NotNull String username,@ApiParam(value = "Updated user object", required = true) @NotNull @Valid User body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.updateUser(username, body, securityContext); 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 c3b6939b7e7..8f7d9a631ce 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 @@ -60,8 +60,9 @@ public class AnotherFakeApi { @Consumes({ "application/json" }) @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) public Response call123testSpecialTags(@ApiParam(value = "client model", required = true) @NotNull @Valid Client body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.call123testSpecialTags(body, securityContext); 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 847f76099f9..f6fee9c47f9 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 @@ -69,8 +69,9 @@ public class FakeApi { @Consumes({ "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }) @io.swagger.annotations.ApiOperation(value = "creates an XmlItem", notes = "this route creates an XmlItem", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response createXmlItem(@ApiParam(value = "XmlItem Body", required = true) @NotNull @Valid XmlItem xmlItem,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createXmlItem(xmlItem, securityContext); @@ -80,8 +81,9 @@ public class FakeApi { @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) + }) public Response fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body") Boolean body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterBooleanSerialize(body, securityContext); @@ -91,8 +93,9 @@ public class FakeApi { @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) + }) public Response fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body") @Valid OuterComposite body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterCompositeSerialize(body, securityContext); @@ -102,8 +105,9 @@ public class FakeApi { @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) + }) public Response fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body") BigDecimal body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterNumberSerialize(body, securityContext); @@ -113,8 +117,9 @@ public class FakeApi { @Produces({ "*/*" }) @io.swagger.annotations.ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Output string", response = String.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Output string", response = String.class) + }) public Response fakeOuterStringSerialize(@ApiParam(value = "Input string as post body") String body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.fakeOuterStringSerialize(body, securityContext); @@ -124,8 +129,9 @@ public class FakeApi { @Consumes({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "", notes = "For this test, the body for this request much reference a schema named `File`.", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) + }) public Response testBodyWithFileSchema(@ApiParam(value = "", required = true) @NotNull @Valid FileSchemaTestClass body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testBodyWithFileSchema(body, securityContext); @@ -135,8 +141,9 @@ public class FakeApi { @Consumes({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "", notes = "", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) + }) public Response testBodyWithQueryParams(@ApiParam(value = "", required = true) @QueryParam("query") @NotNull String query,@ApiParam(value = "", required = true) @NotNull @Valid User body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testBodyWithQueryParams(query, body, securityContext); @@ -146,8 +153,9 @@ public class FakeApi { @Consumes({ "application/json" }) @Produces({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) public Response testClientModel(@ApiParam(value = "client model", required = true) @NotNull @Valid Client body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testClientModel(body, securityContext); @@ -159,10 +167,10 @@ public class FakeApi { @io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", response = Void.class, authorizations = { @io.swagger.annotations.Authorization(value = "http_basic_test") }, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response testEndpointParameters(@ApiParam(value = "None", required=true) @FormParam("number") BigDecimal number,@ApiParam(value = "None", required=true) @FormParam("double") Double _double,@ApiParam(value = "None", required=true) @FormParam("pattern_without_delimiter") String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @FormParam("byte") byte[] _byte,@ApiParam(value = "None") @FormParam("integer") Integer integer,@ApiParam(value = "None") @FormParam("int32") Integer int32,@ApiParam(value = "None") @FormParam("int64") Long int64,@ApiParam(value = "None") @FormParam("float") Float _float,@ApiParam(value = "None") @FormParam("string") String string, @FormDataParam("binary") FormDataBodyPart binaryBodypart ,@ApiParam(value = "None") @FormParam("date") Date date,@ApiParam(value = "None") @FormParam("dateTime") Date dateTime,@ApiParam(value = "None") @FormParam("password") String password,@ApiParam(value = "None") @FormParam("callback") String paramCallback,@Context SecurityContext securityContext) throws NotFoundException { @@ -173,10 +181,10 @@ public class FakeApi { @Consumes({ "application/x-www-form-urlencoded" }) @io.swagger.annotations.ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = Void.class) + }) public Response testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $", defaultValue="new ArrayList()")@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg")@HeaderParam("enum_header_string") String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)") @QueryParam("enum_query_string_array") @Valid List enumQueryStringArray,@ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue = "-efg") @DefaultValue("-efg") @QueryParam("enum_query_string") String enumQueryString,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1, -2") @QueryParam("enum_query_integer") Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @QueryParam("enum_query_double") Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $", defaultValue="$") @DefaultValue("$") @FormParam("enum_form_string_array") List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_form_string") String enumFormString,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, securityContext); @@ -186,8 +194,9 @@ public class FakeApi { @io.swagger.annotations.ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 400, message = "Someting wrong", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 400, message = "Someting wrong", response = Void.class) + }) public Response testGroupParameters(@ApiParam(value = "Required String in group parameters", required = true) @QueryParam("required_string_group") @NotNull Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true)@HeaderParam("required_boolean_group") Boolean requiredBooleanGroup,@ApiParam(value = "Required Integer in group parameters", required = true) @QueryParam("required_int64_group") @NotNull Long requiredInt64Group,@ApiParam(value = "String in group parameters") @QueryParam("string_group") Integer stringGroup,@ApiParam(value = "Boolean in group parameters" )@HeaderParam("boolean_group") Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @QueryParam("int64_group") Long int64Group,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, securityContext); @@ -197,8 +206,9 @@ public class FakeApi { @Consumes({ "application/json" }) @io.swagger.annotations.ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response testInlineAdditionalProperties(@ApiParam(value = "request body", required = true) @NotNull @Valid Map param,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testInlineAdditionalProperties(param, securityContext); @@ -208,8 +218,9 @@ public class FakeApi { @Consumes({ "application/x-www-form-urlencoded" }) @io.swagger.annotations.ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response testJsonFormData(@ApiParam(value = "field1", required=true) @FormParam("param") String param,@ApiParam(value = "field2", required=true) @FormParam("param2") String param2,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testJsonFormData(param, param2, securityContext); @@ -219,8 +230,9 @@ public class FakeApi { @io.swagger.annotations.ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "Success", response = Void.class) + }) public Response testQueryParameterCollectionFormat(@ApiParam(value = "", required = true) @QueryParam("pipe") @NotNull @Valid List pipe,@ApiParam(value = "", required = true) @QueryParam("ioutil") @NotNull @Valid List ioutil,@ApiParam(value = "", required = true) @QueryParam("http") @NotNull @Valid List http,@ApiParam(value = "", required = true) @QueryParam("url") @NotNull @Valid List url,@ApiParam(value = "", required = true) @QueryParam("context") @NotNull @Valid List context,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, securityContext); @@ -235,8 +247,9 @@ public class FakeApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) + }) public Response uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update", required = true) @PathParam("petId") @NotNull Long petId, @FormDataParam("requiredFile") FormDataBodyPart requiredFileBodypart ,@ApiParam(value = "Additional data to pass to server")@FormDataParam("additionalMetadata") String additionalMetadata,@Context SecurityContext securityContext) throws NotFoundException { 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 d0b9ebe7ab7..cb2aa18bb80 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 @@ -62,8 +62,9 @@ public class FakeClassnameTestApi { @io.swagger.annotations.ApiOperation(value = "To test class name in snake case", notes = "To test class name in snake case", response = Client.class, authorizations = { @io.swagger.annotations.Authorization(value = "api_key_query") }, tags={ "fake_classname_tags 123#$%^", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) + }) public Response testClassname(@ApiParam(value = "client model", required = true) @NotNull @Valid Client body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.testClassname(body, securityContext); 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 22e390d6d75..a31dd8b4083 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 @@ -68,10 +68,10 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) + }) public Response addPet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @NotNull @Valid Pet body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.addPet(body, securityContext); @@ -86,10 +86,10 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) + }) public Response deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathParam("petId") @NotNull Long petId,@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext) throws NotFoundException { return delegate.deletePet(petId, apiKey, securityContext); @@ -104,10 +104,10 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Void.class) + }) public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true) @QueryParam("status") @NotNull @Valid List status,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByStatus(status, securityContext); @@ -122,10 +122,10 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) + }) public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid Set tags,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags, securityContext); @@ -137,12 +137,11 @@ public class PetApi { @io.swagger.annotations.ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { @io.swagger.annotations.Authorization(value = "api_key") }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class) + }) public Response getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathParam("petId") @NotNull Long petId,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getPetById(petId, securityContext); @@ -157,14 +156,12 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 405, message = "Validation exception", response = Void.class) + }) public Response updatePet(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @NotNull @Valid Pet body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.updatePet(body, securityContext); @@ -179,8 +176,9 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 405, message = "Invalid input", response = Void.class) + }) public Response updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathParam("petId") @NotNull Long petId,@ApiParam(value = "Updated name of the pet") @FormParam("name") String name,@ApiParam(value = "Updated status of the pet") @FormParam("status") String status,@Context SecurityContext securityContext) throws NotFoundException { return delegate.updatePetWithForm(petId, name, status, securityContext); @@ -195,8 +193,9 @@ public class PetApi { @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) + }) public Response uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathParam("petId") @NotNull Long petId,@ApiParam(value = "Additional data to pass to server")@FormDataParam("additionalMetadata") String additionalMetadata, @FormDataParam("file") FormDataBodyPart fileBodypart ,@Context SecurityContext securityContext) throws NotFoundException { 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 11a88fa9459..39fbe7fb874 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 @@ -61,10 +61,10 @@ public class StoreApi { @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) + }) public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathParam("order_id") @NotNull String orderId,@Context SecurityContext securityContext) throws NotFoundException { return delegate.deleteOrder(orderId, securityContext); @@ -76,8 +76,9 @@ public class StoreApi { @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { @io.swagger.annotations.Authorization(value = "api_key") }, tags={ "store", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") + }) public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException { return delegate.getInventory(securityContext); @@ -87,12 +88,11 @@ public class StoreApi { @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Void.class) + }) public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathParam("order_id") @NotNull @Min(1L) @Max(5L) Long orderId,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getOrderById(orderId, securityContext); @@ -102,10 +102,10 @@ public class StoreApi { @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Void.class) + }) public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet", required = true) @NotNull @Valid Order body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.placeOrder(body, securityContext); 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 8f8e8f72c01..36cc9df40f1 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 @@ -61,8 +61,9 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response createUser(@ApiParam(value = "Created user object", required = true) @NotNull @Valid User body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createUser(body, securityContext); @@ -72,8 +73,9 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response createUsersWithArrayInput(@ApiParam(value = "List of user object", required = true) @NotNull @Valid List body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createUsersWithArrayInput(body, securityContext); @@ -83,8 +85,9 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response createUsersWithListInput(@ApiParam(value = "List of user object", required = true) @NotNull @Valid List body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.createUsersWithListInput(body, securityContext); @@ -94,10 +97,10 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathParam("username") @NotNull String username,@Context SecurityContext securityContext) throws NotFoundException { return delegate.deleteUser(username, securityContext); @@ -107,12 +110,11 @@ public class UserApi { @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = User.class), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathParam("username") @NotNull String username,@Context SecurityContext securityContext) throws NotFoundException { return delegate.getUserByName(username, securityContext); @@ -122,10 +124,10 @@ public class UserApi { @Produces({ "application/xml", "application/json" }) @io.swagger.annotations.ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = String.class), - - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) + }) public Response loginUser(@ApiParam(value = "The user name for login", required = true) @QueryParam("username") @NotNull String username,@ApiParam(value = "The password for login in clear text", required = true) @QueryParam("password") @NotNull String password,@Context SecurityContext securityContext) throws NotFoundException { return delegate.loginUser(username, password, securityContext); @@ -135,8 +137,9 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) public Response logoutUser(@Context SecurityContext securityContext) throws NotFoundException { return delegate.logoutUser(securityContext); @@ -146,10 +149,10 @@ public class UserApi { @io.swagger.annotations.ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) - @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), - - @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) }) + @io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = Void.class) + }) public Response updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathParam("username") @NotNull String username,@ApiParam(value = "Updated user object", required = true) @NotNull @Valid User body,@Context SecurityContext securityContext) throws NotFoundException { return delegate.updateUser(username, body, securityContext); diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt index 203292a60ee..2de2fa35642 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt @@ -40,7 +40,7 @@ data class Order( @field:JsonProperty("status") val status: Order.Status? = null, @ApiModelProperty(example = "null", value = "") - @field:JsonProperty("complete") val complete: kotlin.Boolean? = null + @field:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { /** diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt index 203292a60ee..2de2fa35642 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt @@ -40,7 +40,7 @@ data class Order( @field:JsonProperty("status") val status: Order.Status? = null, @ApiModelProperty(example = "null", value = "") - @field:JsonProperty("complete") val complete: kotlin.Boolean? = null + @field:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { /** diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt index 203292a60ee..2de2fa35642 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt @@ -40,7 +40,7 @@ data class Order( @field:JsonProperty("status") val status: Order.Status? = null, @ApiModelProperty(example = "null", value = "") - @field:JsonProperty("complete") val complete: kotlin.Boolean? = null + @field:JsonProperty("complete") val complete: kotlin.Boolean? = false ) { /** 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 eaca5af92e2..9efa57da146 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml +++ b/samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" default = ["client", "server"] client = [ "mime_0_2", - "multipart", "multipart/client", "swagger/multipart", + "multipart", "multipart/client", "swagger/multipart_form", "hyper_0_10", "mime_multipart", "hyper", "hyper-openssl", "hyper-tls", "native-tls", "openssl", "url" ] @@ -35,7 +35,7 @@ openssl = {version = "0.10", optional = true } async-trait = "0.1.24" chrono = { version = "0.4", features = ["serde"] } futures = "0.3" -swagger = "5.0.0-alpha-1" +swagger = "5.0.2" log = "0.4.0" mime = "0.3" diff --git a/samples/server/petstore/rust-server/output/multipart-v3/docs/MultipartRequest.md b/samples/server/petstore/rust-server/output/multipart-v3/docs/MultipartRequest.md deleted file mode 100644 index dc52f53832a..00000000000 --- a/samples/server/petstore/rust-server/output/multipart-v3/docs/MultipartRequest.md +++ /dev/null @@ -1,13 +0,0 @@ -# MultipartRequest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string_field** | **String** | | -**optional_string_field** | **String** | | [optional] [default to None] -**object_field** | [***models::MultipartRequestObjectField**](multipart_request_object_field.md) | | [optional] [default to None] -**binary_field** | [***swagger::ByteArray**](ByteArray.md) | | - -[[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/server/petstore/rust-server/output/multipart-v3/src/models.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/models.rs index b86806bfeeb..d201b0407f2 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/src/models.rs +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/models.rs @@ -4,46 +4,6 @@ use crate::models; #[cfg(any(feature = "client", feature = "server"))] use crate::header; - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { - type Error = String; - - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { - let hdr_value = hdr_value.to_string(); - match hyper::header::HeaderValue::from_str(&hdr_value) { - std::result::Result::Ok(value) => std::result::Result::Ok(value), - std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for InlineObject - value: {} is invalid {}", - hdr_value, e)) - } - } -} - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { - type Error = String; - - fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { - match hdr_value.to_str() { - std::result::Result::Ok(value) => { - match ::from_str(value) { - std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), - std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into InlineObject - {}", - value, err)) - } - }, - std::result::Result::Err(e) => std::result::Result::Err( - format!("Unable to convert header: {:?} to string: {}", - hdr_value, e)) - } - } -} - - #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct InlineObject { @@ -128,36 +88,34 @@ impl std::str::FromStr for InlineObject { } } - - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for MultipartRelatedRequest - value: {} is invalid {}", + format!("Invalid header value for InlineObject - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into MultipartRelatedRequest - {}", + format!("Unable to convert header value '{}' into InlineObject - {}", value, err)) } }, @@ -242,7 +200,7 @@ impl std::str::FromStr for MultipartRelatedRequest { if let Some(key) = key_result { match key { - "object_field" => intermediate_rep.object_field.push(models::MultipartRequestObjectField::from_str(val).map_err(|x| format!("{}", x))?), + "object_field" => intermediate_rep.object_field.push(::from_str(val).map_err(|x| format!("{}", x))?), "optional_binary_field" => return std::result::Result::Err("Parsing binary data in this style is not supported in MultipartRelatedRequest".to_string()), "required_binary_field" => return std::result::Result::Err("Parsing binary data in this style is not supported in MultipartRelatedRequest".to_string()), _ => return std::result::Result::Err("Unexpected key while parsing MultipartRelatedRequest".to_string()) @@ -262,36 +220,34 @@ impl std::str::FromStr for MultipartRelatedRequest { } } - - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for MultipartRequestObjectField - value: {} is invalid {}", + format!("Invalid header value for MultipartRelatedRequest - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into MultipartRequestObjectField - {}", + format!("Unable to convert header value '{}' into MultipartRelatedRequest - {}", value, err)) } }, @@ -372,7 +328,7 @@ impl std::str::FromStr for MultipartRequestObjectField { if let Some(key) = key_result { match key { - "field_a" => intermediate_rep.field_a.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "field_a" => intermediate_rep.field_a.push(::from_str(val).map_err(|x| format!("{}", x))?), "field_b" => return std::result::Result::Err("Parsing a container in this style is not supported in MultipartRequestObjectField".to_string()), _ => return std::result::Result::Err("Unexpected key while parsing MultipartRequestObjectField".to_string()) } @@ -390,4 +346,41 @@ impl std::str::FromStr for MultipartRequestObjectField { } } +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for MultipartRequestObjectField - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into MultipartRequestObjectField - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs index 72cf6b4f20e..a9890bb121a 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs @@ -286,7 +286,7 @@ impl hyper::service::Service<(Request, C)> for Service where // MultipartRequestPost - POST /multipart_request &hyper::Method::POST if path.matched(paths::ID_MULTIPART_REQUEST) => { - let boundary = match swagger::multipart::boundary(&headers) { + let boundary = match swagger::multipart::form::boundary(&headers) { Some(boundary) => boundary.to_string(), None => return Ok(Response::builder() .status(StatusCode::BAD_REQUEST) 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 da632fac28d..589b163d0e3 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 @@ -29,7 +29,7 @@ openssl = {version = "0.10", optional = true } async-trait = "0.1.24" chrono = { version = "0.4", features = ["serde"] } futures = "0.3" -swagger = "5.0.0-alpha-1" +swagger = "5.0.2" log = "0.4.0" mime = "0.3" diff --git a/samples/server/petstore/rust-server/output/no-example-v3/src/models.rs b/samples/server/petstore/rust-server/output/no-example-v3/src/models.rs index 7caa4ed9c1e..0175af64b56 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/src/models.rs +++ b/samples/server/petstore/rust-server/output/no-example-v3/src/models.rs @@ -4,46 +4,6 @@ use crate::models; #[cfg(any(feature = "client", feature = "server"))] use crate::header; - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { - type Error = String; - - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { - let hdr_value = hdr_value.to_string(); - match hyper::header::HeaderValue::from_str(&hdr_value) { - std::result::Result::Ok(value) => std::result::Result::Ok(value), - std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for InlineObject - value: {} is invalid {}", - hdr_value, e)) - } - } -} - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { - type Error = String; - - fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { - match hdr_value.to_str() { - std::result::Result::Ok(value) => { - match ::from_str(value) { - std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), - std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into InlineObject - {}", - value, err)) - } - }, - std::result::Result::Err(e) => std::result::Result::Err( - format!("Unable to convert header: {:?} to string: {}", - hdr_value, e)) - } - } -} - - #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct InlineObject { @@ -104,7 +64,7 @@ impl std::str::FromStr for InlineObject { if let Some(key) = key_result { match key { - "propery" => intermediate_rep.propery.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "propery" => intermediate_rep.propery.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing InlineObject".to_string()) } } @@ -120,4 +80,41 @@ impl std::str::FromStr for InlineObject { } } +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for InlineObject - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into InlineObject - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} diff --git a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES index 5f3122fbc3d..d1eaac072b4 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES +++ b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES @@ -7,11 +7,16 @@ docs/AdditionalPropertiesWithList.md docs/AnotherXmlArray.md docs/AnotherXmlInner.md docs/AnotherXmlObject.md +docs/AnyOfObject.md +docs/AnyOfObjectAnyOf.md +docs/AnyOfProperty.md docs/DuplicateXmlObject.md docs/EnumWithStarObject.md docs/Err.md docs/Error.md docs/InlineResponse201.md +docs/Model12345AnyOfObject.md +docs/Model12345AnyOfObjectAnyOf.md docs/MyId.md docs/MyIdList.md docs/NullableTest.md 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 0f19d1f064a..45c2007cd6f 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml +++ b/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml @@ -31,7 +31,7 @@ openssl = {version = "0.10", optional = true } async-trait = "0.1.24" chrono = { version = "0.4", features = ["serde"] } futures = "0.3" -swagger = "5.0.0-alpha-1" +swagger = "5.0.2" log = "0.4.0" mime = "0.3" diff --git a/samples/server/petstore/rust-server/output/openapi-v3/README.md b/samples/server/petstore/rust-server/output/openapi-v3/README.md index b0fc2ee15f1..d0e29d93bf4 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/README.md +++ b/samples/server/petstore/rust-server/output/openapi-v3/README.md @@ -61,6 +61,7 @@ cargo run --example server To run a client, follow one of the following simple steps: ``` +cargo run --example client AnyOfGet cargo run --example client CallbackWithHeaderPost cargo run --example client ComplexQueryParamGet cargo run --example client JsonComplexQueryParamGet @@ -68,6 +69,7 @@ cargo run --example client MandatoryRequestHeaderGet cargo run --example client MergePatchJsonGet cargo run --example client MultigetGet cargo run --example client MultipleAuthSchemeGet +cargo run --example client OneOfGet cargo run --example client OverrideServerGet cargo run --example client ParamgetGet cargo run --example client ReadonlyAuthSchemeGet @@ -117,6 +119,7 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +[****](docs/default_api.md#) | **GET** /any-of | [****](docs/default_api.md#) | **POST** /callback-with-header | [****](docs/default_api.md#) | **GET** /complex-query-param | [****](docs/default_api.md#) | **GET** /enum_in_path/{path_param} | @@ -125,6 +128,7 @@ Method | HTTP request | Description [****](docs/default_api.md#) | **GET** /merge-patch-json | [****](docs/default_api.md#) | **GET** /multiget | Get some stuff. [****](docs/default_api.md#) | **GET** /multiple_auth_scheme | +[****](docs/default_api.md#) | **GET** /one-of | [****](docs/default_api.md#) | **GET** /override-server | [****](docs/default_api.md#) | **GET** /paramget | Get some stuff with parameters. [****](docs/default_api.md#) | **GET** /readonly_auth_scheme | @@ -149,11 +153,16 @@ Method | HTTP request | Description - [AnotherXmlArray](docs/AnotherXmlArray.md) - [AnotherXmlInner](docs/AnotherXmlInner.md) - [AnotherXmlObject](docs/AnotherXmlObject.md) + - [AnyOfObject](docs/AnyOfObject.md) + - [AnyOfObjectAnyOf](docs/AnyOfObjectAnyOf.md) + - [AnyOfProperty](docs/AnyOfProperty.md) - [DuplicateXmlObject](docs/DuplicateXmlObject.md) - [EnumWithStarObject](docs/EnumWithStarObject.md) - [Err](docs/Err.md) - [Error](docs/Error.md) - [InlineResponse201](docs/InlineResponse201.md) + - [Model12345AnyOfObject](docs/Model12345AnyOfObject.md) + - [Model12345AnyOfObjectAnyOf](docs/Model12345AnyOfObjectAnyOf.md) - [MyId](docs/MyId.md) - [MyIdList](docs/MyIdList.md) - [NullableTest](docs/NullableTest.md) diff --git a/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml b/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml index 984374b520a..fab686f0ebf 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml @@ -407,6 +407,54 @@ paths: description: Success tags: - Repo + /one-of: + get: + responses: + "200": + content: + application/json: + schema: + oneOf: + - type: integer + - items: + type: string + type: array + description: Success + /any-of: + get: + parameters: + - description: list of any of objects + explode: true + in: query + name: any-of + required: false + schema: + items: + $ref: '#/components/schemas/AnyOfObject' + minItems: 1 + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/AnyOfObject' + description: Success + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/12345AnyOfObject' + description: AlternateSuccess + "202": + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/StringObject' + - $ref: '#/components/schemas/UuidObject' + description: AnyOfSuccess /json-complex-query-param: get: parameters: @@ -426,6 +474,27 @@ paths: description: Success components: schemas: + AnyOfProperty: + description: Test containing an anyOf object + properties: + requiredAnyOf: + $ref: '#/components/schemas/AnyOfObject' + optionalAnyOf: + $ref: '#/components/schemas/12345AnyOfObject' + required: + - requiredAnyOf + AnyOfObject: + anyOf: + - $ref: '#/components/schemas/AnyOfObject_anyOf' + - description: Alternate option + type: string + description: Test a model containing an anyOf + "12345AnyOfObject": + anyOf: + - $ref: '#/components/schemas/_12345AnyOfObject_anyOf' + - description: Alternate option + type: string + description: Test a model containing an anyOf that starts with a number EnumWithStarObject: description: Test a model containing a special character in the enum enum: @@ -607,6 +676,17 @@ components: foo: type: string type: object + AnyOfObject_anyOf: + enum: + - FOO + - BAR + type: string + _12345AnyOfObject_anyOf: + enum: + - FOO + - BAR + - '*' + type: string securitySchemes: authScheme: flows: diff --git a/samples/client/test/swift5/default/docs/StringEnum.md b/samples/server/petstore/rust-server/output/openapi-v3/docs/AnyOfObject.md similarity index 95% rename from samples/client/test/swift5/default/docs/StringEnum.md rename to samples/server/petstore/rust-server/output/openapi-v3/docs/AnyOfObject.md index b0009f7e826..36847cbf694 100644 --- a/samples/client/test/swift5/default/docs/StringEnum.md +++ b/samples/server/petstore/rust-server/output/openapi-v3/docs/AnyOfObject.md @@ -1,4 +1,4 @@ -# StringEnum +# AnyOfObject ## Properties Name | Type | Description | Notes diff --git a/samples/client/test/swift5/default/docs/ModelStringArray.md b/samples/server/petstore/rust-server/output/openapi-v3/docs/AnyOfObjectAnyOf.md similarity index 93% rename from samples/client/test/swift5/default/docs/ModelStringArray.md rename to samples/server/petstore/rust-server/output/openapi-v3/docs/AnyOfObjectAnyOf.md index a84e8f1d4bb..079256f1726 100644 --- a/samples/client/test/swift5/default/docs/ModelStringArray.md +++ b/samples/server/petstore/rust-server/output/openapi-v3/docs/AnyOfObjectAnyOf.md @@ -1,4 +1,4 @@ -# ModelStringArray +# AnyOfObjectAnyOf ## Properties Name | Type | Description | Notes diff --git a/samples/client/test/swift5/default/docs/ErrorInfo.md b/samples/server/petstore/rust-server/output/openapi-v3/docs/AnyOfProperty.md similarity index 57% rename from samples/client/test/swift5/default/docs/ErrorInfo.md rename to samples/server/petstore/rust-server/output/openapi-v3/docs/AnyOfProperty.md index 5cc21d73ae1..c4e69ef4caf 100644 --- a/samples/client/test/swift5/default/docs/ErrorInfo.md +++ b/samples/server/petstore/rust-server/output/openapi-v3/docs/AnyOfProperty.md @@ -1,11 +1,10 @@ -# ErrorInfo +# AnyOfProperty ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **Int** | | [optional] -**message** | **String** | | [optional] -**details** | **[String]** | | [optional] +**required_any_of** | [***models::AnyOfObject**](AnyOfObject.md) | | +**optional_any_of** | [***models::Model12345AnyOfObject**](12345AnyOfObject.md) | | [optional] [default to None] [[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/test/swift5/default/docs/ModelErrorInfoArray.md b/samples/server/petstore/rust-server/output/openapi-v3/docs/Model12345AnyOfObject.md similarity index 91% rename from samples/client/test/swift5/default/docs/ModelErrorInfoArray.md rename to samples/server/petstore/rust-server/output/openapi-v3/docs/Model12345AnyOfObject.md index 666ca4ccc0e..8999550d65e 100644 --- a/samples/client/test/swift5/default/docs/ModelErrorInfoArray.md +++ b/samples/server/petstore/rust-server/output/openapi-v3/docs/Model12345AnyOfObject.md @@ -1,4 +1,4 @@ -# ModelErrorInfoArray +# Model12345AnyOfObject ## Properties Name | Type | Description | Notes diff --git a/samples/client/test/swift5/default/docs/ModelDoubleArray.md b/samples/server/petstore/rust-server/output/openapi-v3/docs/Model12345AnyOfObjectAnyOf.md similarity index 90% rename from samples/client/test/swift5/default/docs/ModelDoubleArray.md rename to samples/server/petstore/rust-server/output/openapi-v3/docs/Model12345AnyOfObjectAnyOf.md index 46a1e87a9ce..096f40837fa 100644 --- a/samples/client/test/swift5/default/docs/ModelDoubleArray.md +++ b/samples/server/petstore/rust-server/output/openapi-v3/docs/Model12345AnyOfObjectAnyOf.md @@ -1,4 +1,4 @@ -# ModelDoubleArray +# Model12345AnyOfObjectAnyOf ## Properties Name | Type | Description | Notes diff --git a/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md b/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md index 42aa82f35d7..1358c8fb1b8 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md +++ b/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md @@ -4,6 +4,7 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +****](default_api.md#) | **GET** /any-of | ****](default_api.md#) | **POST** /callback-with-header | ****](default_api.md#) | **GET** /complex-query-param | ****](default_api.md#) | **GET** /enum_in_path/{path_param} | @@ -12,6 +13,7 @@ Method | HTTP request | Description ****](default_api.md#) | **GET** /merge-patch-json | ****](default_api.md#) | **GET** /multiget | Get some stuff. ****](default_api.md#) | **GET** /multiple_auth_scheme | +****](default_api.md#) | **GET** /one-of | ****](default_api.md#) | **GET** /override-server | ****](default_api.md#) | **GET** /paramget | Get some stuff with parameters. ****](default_api.md#) | **GET** /readonly_auth_scheme | @@ -28,6 +30,38 @@ Method | HTTP request | Description ****](default_api.md#) | **PUT** /xml | +# **** +> models::AnyOfObject (optional) + + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **any_of** | [**models::AnyOfObject**](models::AnyOfObject.md)| list of any of objects | + +### Return type + +[**models::AnyOfObject**](AnyOfObject.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **** > (url) @@ -233,6 +267,28 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **** +> swagger::OneOf2> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**swagger::OneOf2>**](swagger::OneOf2>.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **** > () diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/client/main.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/client/main.rs index 700e2ff2235..04b4e28dfde 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/examples/client/main.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/client/main.rs @@ -6,6 +6,7 @@ mod server; use futures::{future, Stream, stream}; #[allow(unused_imports)] use openapi_v3::{Api, ApiNoContext, Client, ContextWrapperExt, models, + AnyOfGetResponse, CallbackWithHeaderPostResponse, ComplexQueryParamGetResponse, EnumInPathPathParamGetResponse, @@ -14,6 +15,7 @@ use openapi_v3::{Api, ApiNoContext, Client, ContextWrapperExt, models, MergePatchJsonGetResponse, MultigetGetResponse, MultipleAuthSchemeGetResponse, + OneOfGetResponse, OverrideServerGetResponse, ParamgetGetResponse, ReadonlyAuthSchemeGetResponse, @@ -51,6 +53,7 @@ fn main() { .arg(Arg::with_name("operation") .help("Sets the operation to run") .possible_values(&[ + "AnyOfGet", "CallbackWithHeaderPost", "ComplexQueryParamGet", "JsonComplexQueryParamGet", @@ -58,6 +61,7 @@ fn main() { "MergePatchJsonGet", "MultigetGet", "MultipleAuthSchemeGet", + "OneOfGet", "OverrideServerGet", "ParamgetGet", "ReadonlyAuthSchemeGet", @@ -120,6 +124,12 @@ fn main() { rt.spawn(server::create("127.0.0.1:8081", false)); match matches.value_of("operation") { + Some("AnyOfGet") => { + let result = rt.block_on(client.any_of_get( + Some(&Vec::new()) + )); + info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); + }, Some("CallbackWithHeaderPost") => { let result = rt.block_on(client.callback_with_header_post( "url_example".to_string() @@ -167,6 +177,11 @@ fn main() { )); info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); }, + Some("OneOfGet") => { + let result = rt.block_on(client.one_of_get( + )); + info!("{:?} (X-Span-ID: {:?})", result, (client.context() as &dyn Has).get().clone()); + }, Some("OverrideServerGet") => { let result = rt.block_on(client.override_server_get( )); diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/server/server.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/server/server.rs index b5535b3ebd5..a40212742c5 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/examples/server/server.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/server/server.rs @@ -96,6 +96,7 @@ impl Server { use openapi_v3::{ Api, + AnyOfGetResponse, CallbackWithHeaderPostResponse, ComplexQueryParamGetResponse, EnumInPathPathParamGetResponse, @@ -104,6 +105,7 @@ use openapi_v3::{ MergePatchJsonGetResponse, MultigetGetResponse, MultipleAuthSchemeGetResponse, + OneOfGetResponse, OverrideServerGetResponse, ParamgetGetResponse, ReadonlyAuthSchemeGetResponse, @@ -128,6 +130,16 @@ use swagger::ApiError; #[async_trait] impl Api for Server where C: Has + Send + Sync { + async fn any_of_get( + &self, + any_of: Option<&Vec>, + context: &C) -> Result + { + let context = context.clone(); + info!("any_of_get({:?}) - X-Span-ID: {:?}", any_of, context.get().0.clone()); + Err("Generic failuare".into()) + } + async fn callback_with_header_post( &self, url: String, @@ -206,6 +218,15 @@ impl Api for Server where C: Has + Send + Sync Err("Generic failuare".into()) } + async fn one_of_get( + &self, + context: &C) -> Result + { + let context = context.clone(); + info!("one_of_get() - X-Span-ID: {:?}", context.get().0.clone()); + Err("Generic failuare".into()) + } + async fn override_server_get( &self, context: &C) -> Result diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs index 3817bd07555..396d05a98cb 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs @@ -36,6 +36,7 @@ const FRAGMENT_ENCODE_SET: &AsciiSet = &percent_encoding::CONTROLS const ID_ENCODE_SET: &AsciiSet = &FRAGMENT_ENCODE_SET.add(b'|'); use crate::{Api, + AnyOfGetResponse, CallbackWithHeaderPostResponse, ComplexQueryParamGetResponse, EnumInPathPathParamGetResponse, @@ -44,6 +45,7 @@ use crate::{Api, MergePatchJsonGetResponse, MultigetGetResponse, MultipleAuthSchemeGetResponse, + OneOfGetResponse, OverrideServerGetResponse, ParamgetGetResponse, ReadonlyAuthSchemeGetResponse, @@ -405,6 +407,110 @@ impl Api for Client where } } + async fn any_of_get( + &self, + param_any_of: Option<&Vec>, + context: &C) -> Result + { + let mut client_service = self.client_service.clone(); + let mut uri = format!( + "{}/any-of", + self.base_path + ); + + // Query parameters + let query_string = { + let mut query_string = form_urlencoded::Serializer::new("".to_owned()); + if let Some(param_any_of) = param_any_of { + query_string.append_pair("any-of", + ¶m_any_of.iter().map(ToString::to_string).collect::>().join(",")); + } + query_string.finish() + }; + if !query_string.is_empty() { + uri += "?"; + uri += &query_string; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Err(ApiError(format!("Unable to build URI: {}", err))), + }; + + let mut request = match Request::builder() + .method("GET") + .uri(uri) + .body(Body::empty()) { + Ok(req) => req, + Err(e) => return Err(ApiError(format!("Unable to create request: {}", e))) + }; + + let header = HeaderValue::from_str(Has::::get(context).0.clone().to_string().as_str()); + request.headers_mut().insert(HeaderName::from_static("x-span-id"), match header { + Ok(h) => h, + Err(e) => return Err(ApiError(format!("Unable to create X-Span ID header value: {}", e))) + }); + + let mut response = client_service.call((request, context.clone())) + .map_err(|e| ApiError(format!("No response received: {}", e))).await?; + + match response.status().as_u16() { + 200 => { + let body = response.into_body(); + let body = body + .to_raw() + .map_err(|e| ApiError(format!("Failed to read response: {}", e))).await?; + let body = str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(body)?; + Ok(AnyOfGetResponse::Success + (body) + ) + } + 201 => { + let body = response.into_body(); + let body = body + .to_raw() + .map_err(|e| ApiError(format!("Failed to read response: {}", e))).await?; + let body = str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::(body)?; + Ok(AnyOfGetResponse::AlternateSuccess + (body) + ) + } + 202 => { + let body = response.into_body(); + let body = body + .to_raw() + .map_err(|e| ApiError(format!("Failed to read response: {}", e))).await?; + let body = str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::>(body)?; + Ok(AnyOfGetResponse::AnyOfSuccess + (body) + ) + } + code => { + let headers = response.headers().clone(); + let body = response.into_body() + .take(100) + .to_raw().await; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(body) => match String::from_utf8(body) { + Ok(body) => body, + Err(e) => format!("", e), + }, + Err(e) => format!("", e), + } + ))) + } + } + } + async fn callback_with_header_post( &self, param_url: String, @@ -1089,6 +1195,81 @@ impl Api for Client where } } + async fn one_of_get( + &self, + context: &C) -> Result + { + let mut client_service = self.client_service.clone(); + let mut uri = format!( + "{}/one-of", + self.base_path + ); + + // Query parameters + let query_string = { + let mut query_string = form_urlencoded::Serializer::new("".to_owned()); + query_string.finish() + }; + if !query_string.is_empty() { + uri += "?"; + uri += &query_string; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Err(ApiError(format!("Unable to build URI: {}", err))), + }; + + let mut request = match Request::builder() + .method("GET") + .uri(uri) + .body(Body::empty()) { + Ok(req) => req, + Err(e) => return Err(ApiError(format!("Unable to create request: {}", e))) + }; + + let header = HeaderValue::from_str(Has::::get(context).0.clone().to_string().as_str()); + request.headers_mut().insert(HeaderName::from_static("x-span-id"), match header { + Ok(h) => h, + Err(e) => return Err(ApiError(format!("Unable to create X-Span ID header value: {}", e))) + }); + + let mut response = client_service.call((request, context.clone())) + .map_err(|e| ApiError(format!("No response received: {}", e))).await?; + + match response.status().as_u16() { + 200 => { + let body = response.into_body(); + let body = body + .to_raw() + .map_err(|e| ApiError(format!("Failed to read response: {}", e))).await?; + let body = str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::>>(body)?; + Ok(OneOfGetResponse::Success + (body) + ) + } + code => { + let headers = response.headers().clone(); + let body = response.into_body() + .take(100) + .to_raw().await; + Err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(body) => match String::from_utf8(body) { + Ok(body) => body, + Err(e) => format!("", e), + }, + Err(e) => format!("", e), + } + ))) + } + } + } + async fn override_server_get( &self, context: &C) -> Result diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs index 6a269c49f2a..458aa65a99a 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs @@ -11,6 +11,22 @@ type ServiceError = Box; pub const BASE_PATH: &'static str = ""; pub const API_VERSION: &'static str = "1.0.7"; +#[derive(Debug, PartialEq)] +#[must_use] +pub enum AnyOfGetResponse { + /// Success + Success + (models::AnyOfObject) + , + /// AlternateSuccess + AlternateSuccess + (models::Model12345AnyOfObject) + , + /// AnyOfSuccess + AnyOfSuccess + (swagger::AnyOf2) +} + #[derive(Debug, PartialEq)] pub enum CallbackWithHeaderPostResponse { /// OK @@ -86,6 +102,13 @@ pub enum MultipleAuthSchemeGetResponse { CheckThatLimitingToMultipleRequiredAuthSchemesWorks } +#[derive(Debug, PartialEq)] +pub enum OneOfGetResponse { + /// Success + Success + (swagger::OneOf2>) +} + #[derive(Debug, PartialEq)] pub enum OverrideServerGetResponse { /// Success. @@ -253,6 +276,11 @@ pub trait Api { Poll::Ready(Ok(())) } + async fn any_of_get( + &self, + any_of: Option<&Vec>, + context: &C) -> Result; + async fn callback_with_header_post( &self, url: String, @@ -291,6 +319,10 @@ pub trait Api { &self, context: &C) -> Result; + async fn one_of_get( + &self, + context: &C) -> Result; + async fn override_server_get( &self, context: &C) -> Result; @@ -380,6 +412,11 @@ pub trait ApiNoContext { fn context(&self) -> &C; + async fn any_of_get( + &self, + any_of: Option<&Vec>, + ) -> Result; + async fn callback_with_header_post( &self, url: String, @@ -418,6 +455,10 @@ pub trait ApiNoContext { &self, ) -> Result; + async fn one_of_get( + &self, + ) -> Result; + async fn override_server_get( &self, ) -> Result; @@ -522,6 +563,15 @@ impl + Send + Sync, C: Clone + Send + Sync> ApiNoContext for Contex ContextWrapper::context(self) } + async fn any_of_get( + &self, + any_of: Option<&Vec>, + ) -> Result + { + let context = self.context().clone(); + self.api().any_of_get(any_of, &context).await + } + async fn callback_with_header_post( &self, url: String, @@ -592,6 +642,14 @@ impl + Send + Sync, C: Clone + Send + Sync> ApiNoContext for Contex self.api().multiple_auth_scheme_get(&context).await } + async fn one_of_get( + &self, + ) -> Result + { + let context = self.context().clone(); + self.api().one_of_get(&context).await + } + async fn override_server_get( &self, ) -> Result diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs index 729d1279e63..68647720d26 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/models.rs @@ -4,7 +4,6 @@ use crate::models; #[cfg(any(feature = "client", feature = "server"))] use crate::header; - #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct AdditionalPropertiesWithList(std::collections::HashMap>); @@ -15,7 +14,6 @@ impl std::convert::From>> for Addi } } - impl std::convert::From for std::collections::HashMap> { fn from(x: AdditionalPropertiesWithList) -> Self { x.0 @@ -65,44 +63,6 @@ impl AdditionalPropertiesWithList { } } -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { - type Error = String; - - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { - let hdr_value = hdr_value.to_string(); - match hyper::header::HeaderValue::from_str(&hdr_value) { - std::result::Result::Ok(value) => std::result::Result::Ok(value), - std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for AnotherXmlArray - value: {} is invalid {}", - hdr_value, e)) - } - } -} - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { - type Error = String; - - fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { - match hdr_value.to_str() { - std::result::Result::Ok(value) => { - match ::from_str(value) { - std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), - std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into AnotherXmlArray - {}", - value, err)) - } - }, - std::result::Result::Err(e) => std::result::Result::Err( - format!("Unable to convert header: {:?} to string: {}", - hdr_value, e)) - } - } -} - // Utility function for wrapping list elements when serializing xml #[allow(non_snake_case)] fn wrap_in_snake_another_xml_inner(item: &Vec, serializer: S) -> std::result::Result @@ -203,6 +163,45 @@ impl std::str::FromStr for AnotherXmlArray { } +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for AnotherXmlArray - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into AnotherXmlArray - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} + + impl AnotherXmlArray { /// Helper function to allow us to convert this model to an XML string. /// Will panic if serialisation fails. @@ -266,45 +265,6 @@ impl AnotherXmlInner { } /// An XML object -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { - type Error = String; - - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { - let hdr_value = hdr_value.to_string(); - match hyper::header::HeaderValue::from_str(&hdr_value) { - std::result::Result::Ok(value) => std::result::Result::Ok(value), - std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for AnotherXmlObject - value: {} is invalid {}", - hdr_value, e)) - } - } -} - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { - type Error = String; - - fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { - match hdr_value.to_str() { - std::result::Result::Ok(value) => { - match ::from_str(value) { - std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), - std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into AnotherXmlObject - {}", - value, err)) - } - }, - std::result::Result::Err(e) => std::result::Result::Err( - format!("Unable to convert header: {:?} to string: {}", - hdr_value, e)) - } - } -} - - #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] #[serde(rename = "snake_another_xml_object")] @@ -366,7 +326,7 @@ impl std::str::FromStr for AnotherXmlObject { if let Some(key) = key_result { match key { - "inner_string" => intermediate_rep.inner_string.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "inner_string" => intermediate_rep.inner_string.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing AnotherXmlObject".to_string()) } } @@ -382,6 +342,44 @@ impl std::str::FromStr for AnotherXmlObject { } } +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for AnotherXmlObject - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into AnotherXmlObject - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} + impl AnotherXmlObject { /// Associated constant for this model's XML namespace. @@ -401,35 +399,97 @@ impl AnotherXmlObject { } } -/// An XML object -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +/// Test a model containing an anyOf +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] +#[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] +pub struct AnyOfObject { +} + +impl AnyOfObject { + pub fn new() -> AnyOfObject { + AnyOfObject { + } + } +} + +/// Converts the AnyOfObject value to the Query Parameters representation (style=form, explode=false) +/// specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde serializer +impl std::string::ToString for AnyOfObject { + fn to_string(&self) -> String { + let mut params: Vec = vec![]; + params.join(",").to_string() + } +} + +/// Converts Query Parameters representation (style=form, explode=false) to a AnyOfObject value +/// as specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde deserializer +impl std::str::FromStr for AnyOfObject { + type Err = String; + + fn from_str(s: &str) -> std::result::Result { + #[derive(Default)] + // An intermediate representation of the struct to use for parsing. + struct IntermediateRep { + } + + let mut intermediate_rep = IntermediateRep::default(); + + // Parse into intermediate representation + let mut string_iter = s.split(',').into_iter(); + let mut key_result = string_iter.next(); + + while key_result.is_some() { + let val = match string_iter.next() { + Some(x) => x, + None => return std::result::Result::Err("Missing value while parsing AnyOfObject".to_string()) + }; + + if let Some(key) = key_result { + match key { + _ => return std::result::Result::Err("Unexpected key while parsing AnyOfObject".to_string()) + } + } + + // Get the next key + key_result = string_iter.next(); + } + + // Use the intermediate representation to return the struct + std::result::Result::Ok(AnyOfObject { + }) + } +} + +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for DuplicateXmlObject - value: {} is invalid {}", + format!("Invalid header value for AnyOfObject - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into DuplicateXmlObject - {}", + format!("Unable to convert header value '{}' into AnyOfObject - {}", value, err)) } }, @@ -441,6 +501,190 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl AnyOfObject { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + +/// Enumeration of values. +/// Since this enum's variants do not hold data, we can easily define them them as `#[repr(C)]` +/// which helps with FFI. +#[allow(non_camel_case_types)] +#[repr(C)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, serde::Serialize, serde::Deserialize)] +#[cfg_attr(feature = "conversion", derive(frunk_enum_derive::LabelledGenericEnum))] +pub enum AnyOfObjectAnyOf { + #[serde(rename = "FOO")] + FOO, + #[serde(rename = "BAR")] + BAR, +} + +impl std::fmt::Display for AnyOfObjectAnyOf { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match *self { + AnyOfObjectAnyOf::FOO => write!(f, "{}", "FOO"), + AnyOfObjectAnyOf::BAR => write!(f, "{}", "BAR"), + } + } +} + +impl std::str::FromStr for AnyOfObjectAnyOf { + type Err = String; + + fn from_str(s: &str) -> std::result::Result { + match s { + "FOO" => std::result::Result::Ok(AnyOfObjectAnyOf::FOO), + "BAR" => std::result::Result::Ok(AnyOfObjectAnyOf::BAR), + _ => std::result::Result::Err(format!("Value not valid: {}", s)), + } + } +} + +impl AnyOfObjectAnyOf { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + +/// Test containing an anyOf object +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] +#[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] +pub struct AnyOfProperty { + #[serde(rename = "requiredAnyOf")] + pub required_any_of: models::AnyOfObject, + + #[serde(rename = "optionalAnyOf")] + #[serde(skip_serializing_if="Option::is_none")] + pub optional_any_of: Option, + +} + +impl AnyOfProperty { + pub fn new(required_any_of: models::AnyOfObject, ) -> AnyOfProperty { + AnyOfProperty { + required_any_of: required_any_of, + optional_any_of: None, + } + } +} + +/// Converts the AnyOfProperty value to the Query Parameters representation (style=form, explode=false) +/// specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde serializer +impl std::string::ToString for AnyOfProperty { + fn to_string(&self) -> String { + let mut params: Vec = vec![]; + // Skipping requiredAnyOf in query parameter serialization + + // Skipping optionalAnyOf in query parameter serialization + + params.join(",").to_string() + } +} + +/// Converts Query Parameters representation (style=form, explode=false) to a AnyOfProperty value +/// as specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde deserializer +impl std::str::FromStr for AnyOfProperty { + type Err = String; + + fn from_str(s: &str) -> std::result::Result { + #[derive(Default)] + // An intermediate representation of the struct to use for parsing. + struct IntermediateRep { + pub required_any_of: Vec, + pub optional_any_of: Vec, + } + + let mut intermediate_rep = IntermediateRep::default(); + + // Parse into intermediate representation + let mut string_iter = s.split(',').into_iter(); + let mut key_result = string_iter.next(); + + while key_result.is_some() { + let val = match string_iter.next() { + Some(x) => x, + None => return std::result::Result::Err("Missing value while parsing AnyOfProperty".to_string()) + }; + + if let Some(key) = key_result { + match key { + "requiredAnyOf" => intermediate_rep.required_any_of.push(::from_str(val).map_err(|x| format!("{}", x))?), + "optionalAnyOf" => intermediate_rep.optional_any_of.push(::from_str(val).map_err(|x| format!("{}", x))?), + _ => return std::result::Result::Err("Unexpected key while parsing AnyOfProperty".to_string()) + } + } + + // Get the next key + key_result = string_iter.next(); + } + + // Use the intermediate representation to return the struct + std::result::Result::Ok(AnyOfProperty { + required_any_of: intermediate_rep.required_any_of.into_iter().next().ok_or("requiredAnyOf missing in AnyOfProperty".to_string())?, + optional_any_of: intermediate_rep.optional_any_of.into_iter().next(), + }) + } +} + +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for AnyOfProperty - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into AnyOfProperty - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} + + +impl AnyOfProperty { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + +/// An XML object #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] #[serde(rename = "camelDuplicateXmlObject")] @@ -510,8 +754,8 @@ impl std::str::FromStr for DuplicateXmlObject { if let Some(key) = key_result { match key { - "inner_string" => intermediate_rep.inner_string.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "inner_array" => intermediate_rep.inner_array.push(models::XmlArray::from_str(val).map_err(|x| format!("{}", x))?), + "inner_string" => intermediate_rep.inner_string.push(::from_str(val).map_err(|x| format!("{}", x))?), + "inner_array" => intermediate_rep.inner_array.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing DuplicateXmlObject".to_string()) } } @@ -528,6 +772,44 @@ impl std::str::FromStr for DuplicateXmlObject { } } +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for DuplicateXmlObject - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into DuplicateXmlObject - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} + impl DuplicateXmlObject { /// Associated constant for this model's XML namespace. @@ -555,7 +837,7 @@ impl DuplicateXmlObject { #[repr(C)] #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk_enum_derive::LabelledGenericEnum))] -pub enum EnumWithStarObject { +pub enum EnumWithStarObject { #[serde(rename = "FOO")] FOO, #[serde(rename = "BAR")] @@ -566,7 +848,7 @@ pub enum EnumWithStarObject { impl std::fmt::Display for EnumWithStarObject { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match *self { + match *self { EnumWithStarObject::FOO => write!(f, "{}", "FOO"), EnumWithStarObject::BAR => write!(f, "{}", "BAR"), EnumWithStarObject::STAR => write!(f, "{}", "*"), @@ -700,45 +982,6 @@ impl Error { } } -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { - type Error = String; - - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { - let hdr_value = hdr_value.to_string(); - match hyper::header::HeaderValue::from_str(&hdr_value) { - std::result::Result::Ok(value) => std::result::Result::Ok(value), - std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for InlineResponse201 - value: {} is invalid {}", - hdr_value, e)) - } - } -} - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { - type Error = String; - - fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { - match hdr_value.to_str() { - std::result::Result::Ok(value) => { - match ::from_str(value) { - std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), - std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into InlineResponse201 - {}", - value, err)) - } - }, - std::result::Result::Err(e) => std::result::Result::Err( - format!("Unable to convert header: {:?} to string: {}", - hdr_value, e)) - } - } -} - - #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct InlineResponse201 { @@ -799,7 +1042,7 @@ impl std::str::FromStr for InlineResponse201 { if let Some(key) = key_result { match key { - "foo" => intermediate_rep.foo.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "foo" => intermediate_rep.foo.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing InlineResponse201".to_string()) } } @@ -815,6 +1058,44 @@ impl std::str::FromStr for InlineResponse201 { } } +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for InlineResponse201 - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into InlineResponse201 - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} + impl InlineResponse201 { /// Helper function to allow us to convert this model to an XML string. @@ -825,6 +1106,165 @@ impl InlineResponse201 { } } +/// Test a model containing an anyOf that starts with a number +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] +#[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] +pub struct Model12345AnyOfObject { +} + +impl Model12345AnyOfObject { + pub fn new() -> Model12345AnyOfObject { + Model12345AnyOfObject { + } + } +} + +/// Converts the Model12345AnyOfObject value to the Query Parameters representation (style=form, explode=false) +/// specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde serializer +impl std::string::ToString for Model12345AnyOfObject { + fn to_string(&self) -> String { + let mut params: Vec = vec![]; + params.join(",").to_string() + } +} + +/// Converts Query Parameters representation (style=form, explode=false) to a Model12345AnyOfObject value +/// as specified in https://swagger.io/docs/specification/serialization/ +/// Should be implemented in a serde deserializer +impl std::str::FromStr for Model12345AnyOfObject { + type Err = String; + + fn from_str(s: &str) -> std::result::Result { + #[derive(Default)] + // An intermediate representation of the struct to use for parsing. + struct IntermediateRep { + } + + let mut intermediate_rep = IntermediateRep::default(); + + // Parse into intermediate representation + let mut string_iter = s.split(',').into_iter(); + let mut key_result = string_iter.next(); + + while key_result.is_some() { + let val = match string_iter.next() { + Some(x) => x, + None => return std::result::Result::Err("Missing value while parsing Model12345AnyOfObject".to_string()) + }; + + if let Some(key) = key_result { + match key { + _ => return std::result::Result::Err("Unexpected key while parsing Model12345AnyOfObject".to_string()) + } + } + + // Get the next key + key_result = string_iter.next(); + } + + // Use the intermediate representation to return the struct + std::result::Result::Ok(Model12345AnyOfObject { + }) + } +} + +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for Model12345AnyOfObject - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into Model12345AnyOfObject - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} + + +impl Model12345AnyOfObject { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + +/// Enumeration of values. +/// Since this enum's variants do not hold data, we can easily define them them as `#[repr(C)]` +/// which helps with FFI. +#[allow(non_camel_case_types)] +#[repr(C)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, serde::Serialize, serde::Deserialize)] +#[cfg_attr(feature = "conversion", derive(frunk_enum_derive::LabelledGenericEnum))] +pub enum Model12345AnyOfObjectAnyOf { + #[serde(rename = "FOO")] + FOO, + #[serde(rename = "BAR")] + BAR, + #[serde(rename = "*")] + STAR, +} + +impl std::fmt::Display for Model12345AnyOfObjectAnyOf { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match *self { + Model12345AnyOfObjectAnyOf::FOO => write!(f, "{}", "FOO"), + Model12345AnyOfObjectAnyOf::BAR => write!(f, "{}", "BAR"), + Model12345AnyOfObjectAnyOf::STAR => write!(f, "{}", "*"), + } + } +} + +impl std::str::FromStr for Model12345AnyOfObjectAnyOf { + type Err = String; + + fn from_str(s: &str) -> std::result::Result { + match s { + "FOO" => std::result::Result::Ok(Model12345AnyOfObjectAnyOf::FOO), + "BAR" => std::result::Result::Ok(Model12345AnyOfObjectAnyOf::BAR), + "*" => std::result::Result::Ok(Model12345AnyOfObjectAnyOf::STAR), + _ => std::result::Result::Err(format!("Value not valid: {}", s)), + } + } +} + +impl Model12345AnyOfObjectAnyOf { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, PartialOrd, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct MyId(i32); @@ -835,7 +1275,6 @@ impl std::convert::From for MyId { } } - impl std::convert::From for i32 { fn from(x: MyId) -> Self { x.0 @@ -865,44 +1304,6 @@ impl MyId { } } -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { - type Error = String; - - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { - let hdr_value = hdr_value.to_string(); - match hyper::header::HeaderValue::from_str(&hdr_value) { - std::result::Result::Ok(value) => std::result::Result::Ok(value), - std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for MyIdList - value: {} is invalid {}", - hdr_value, e)) - } - } -} - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { - type Error = String; - - fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { - match hdr_value.to_str() { - std::result::Result::Ok(value) => { - match ::from_str(value) { - std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), - std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into MyIdList - {}", - value, err)) - } - }, - std::result::Result::Err(e) => std::result::Result::Err( - format!("Unable to convert header: {:?} to string: {}", - hdr_value, e)) - } - } -} - #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct MyIdList( @@ -993,43 +1394,34 @@ impl std::str::FromStr for MyIdList { } -impl MyIdList { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for NullableTest - value: {} is invalid {}", + format!("Invalid header value for MyIdList - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into NullableTest - {}", + format!("Unable to convert header value '{}' into MyIdList - {}", value, err)) } }, @@ -1041,6 +1433,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl MyIdList { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct NullableTest { @@ -1178,44 +1579,34 @@ impl std::str::FromStr for NullableTest { } } - -impl NullableTest { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for ObjectHeader - value: {} is invalid {}", + format!("Invalid header value for NullableTest - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into ObjectHeader - {}", + format!("Unable to convert header value '{}' into NullableTest - {}", value, err)) } }, @@ -1227,6 +1618,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl NullableTest { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct ObjectHeader { @@ -1296,8 +1696,8 @@ impl std::str::FromStr for ObjectHeader { if let Some(key) = key_result { match key { - "requiredObjectHeader" => intermediate_rep.required_object_header.push(bool::from_str(val).map_err(|x| format!("{}", x))?), - "optionalObjectHeader" => intermediate_rep.optional_object_header.push(isize::from_str(val).map_err(|x| format!("{}", x))?), + "requiredObjectHeader" => intermediate_rep.required_object_header.push(::from_str(val).map_err(|x| format!("{}", x))?), + "optionalObjectHeader" => intermediate_rep.optional_object_header.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing ObjectHeader".to_string()) } } @@ -1314,44 +1714,34 @@ impl std::str::FromStr for ObjectHeader { } } - -impl ObjectHeader { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for ObjectParam - value: {} is invalid {}", + format!("Invalid header value for ObjectHeader - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into ObjectParam - {}", + format!("Unable to convert header value '{}' into ObjectHeader - {}", value, err)) } }, @@ -1363,6 +1753,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl ObjectHeader { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct ObjectParam { @@ -1432,8 +1831,8 @@ impl std::str::FromStr for ObjectParam { if let Some(key) = key_result { match key { - "requiredParam" => intermediate_rep.required_param.push(bool::from_str(val).map_err(|x| format!("{}", x))?), - "optionalParam" => intermediate_rep.optional_param.push(isize::from_str(val).map_err(|x| format!("{}", x))?), + "requiredParam" => intermediate_rep.required_param.push(::from_str(val).map_err(|x| format!("{}", x))?), + "optionalParam" => intermediate_rep.optional_param.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing ObjectParam".to_string()) } } @@ -1450,44 +1849,34 @@ impl std::str::FromStr for ObjectParam { } } - -impl ObjectParam { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for ObjectUntypedProps - value: {} is invalid {}", + format!("Invalid header value for ObjectParam - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into ObjectUntypedProps - {}", + format!("Unable to convert header value '{}' into ObjectParam - {}", value, err)) } }, @@ -1499,6 +1888,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl ObjectParam { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct ObjectUntypedProps { @@ -1577,10 +1975,10 @@ impl std::str::FromStr for ObjectUntypedProps { if let Some(key) = key_result { match key { - "required_untyped" => intermediate_rep.required_untyped.push(serde_json::Value::from_str(val).map_err(|x| format!("{}", x))?), + "required_untyped" => intermediate_rep.required_untyped.push(::from_str(val).map_err(|x| format!("{}", x))?), "required_untyped_nullable" => return std::result::Result::Err("Parsing a nullable type in this style is not supported in ObjectUntypedProps".to_string()), - "not_required_untyped" => intermediate_rep.not_required_untyped.push(serde_json::Value::from_str(val).map_err(|x| format!("{}", x))?), - "not_required_untyped_nullable" => intermediate_rep.not_required_untyped_nullable.push(serde_json::Value::from_str(val).map_err(|x| format!("{}", x))?), + "not_required_untyped" => intermediate_rep.not_required_untyped.push(::from_str(val).map_err(|x| format!("{}", x))?), + "not_required_untyped_nullable" => intermediate_rep.not_required_untyped_nullable.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing ObjectUntypedProps".to_string()) } } @@ -1599,44 +1997,34 @@ impl std::str::FromStr for ObjectUntypedProps { } } - -impl ObjectUntypedProps { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for ObjectWithArrayOfObjects - value: {} is invalid {}", + format!("Invalid header value for ObjectUntypedProps - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into ObjectWithArrayOfObjects - {}", + format!("Unable to convert header value '{}' into ObjectUntypedProps - {}", value, err)) } }, @@ -1648,6 +2036,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl ObjectUntypedProps { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct ObjectWithArrayOfObjects { @@ -1724,6 +2121,44 @@ impl std::str::FromStr for ObjectWithArrayOfObjects { } } +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for ObjectWithArrayOfObjects - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into ObjectWithArrayOfObjects - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} + impl ObjectWithArrayOfObjects { /// Helper function to allow us to convert this model to an XML string. @@ -1796,7 +2231,6 @@ impl std::convert::From for OptionalObjectHeader { } } - impl std::convert::From for i32 { fn from(x: OptionalObjectHeader) -> Self { x.0 @@ -1836,7 +2270,6 @@ impl std::convert::From for RequiredObjectHeader { } } - impl std::convert::From for bool { fn from(x: RequiredObjectHeader) -> Self { x.0 @@ -1925,7 +2358,7 @@ impl Result { #[repr(C)] #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk_enum_derive::LabelledGenericEnum))] -pub enum StringEnum { +pub enum StringEnum { #[serde(rename = "FOO")] FOO, #[serde(rename = "BAR")] @@ -1934,7 +2367,7 @@ pub enum StringEnum { impl std::fmt::Display for StringEnum { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match *self { + match *self { StringEnum::FOO => write!(f, "{}", "FOO"), StringEnum::BAR => write!(f, "{}", "BAR"), } @@ -2025,7 +2458,6 @@ impl std::convert::From for UuidObject { } } - impl std::convert::From for uuid::Uuid { fn from(x: UuidObject) -> Self { x.0 @@ -2055,44 +2487,6 @@ impl UuidObject { } } -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { - type Error = String; - - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { - let hdr_value = hdr_value.to_string(); - match hyper::header::HeaderValue::from_str(&hdr_value) { - std::result::Result::Ok(value) => std::result::Result::Ok(value), - std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for XmlArray - value: {} is invalid {}", - hdr_value, e)) - } - } -} - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { - type Error = String; - - fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { - match hdr_value.to_str() { - std::result::Result::Ok(value) => { - match ::from_str(value) { - std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), - std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into XmlArray - {}", - value, err)) - } - }, - std::result::Result::Err(e) => std::result::Result::Err( - format!("Unable to convert header: {:?} to string: {}", - hdr_value, e)) - } - } -} - // Utility function for wrapping list elements when serializing xml #[allow(non_snake_case)] fn wrap_in_camelXmlInner(item: &Vec, serializer: S) -> std::result::Result @@ -2193,6 +2587,45 @@ impl std::str::FromStr for XmlArray { } +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for XmlArray - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into XmlArray - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} + + impl XmlArray { /// Helper function to allow us to convert this model to an XML string. /// Will panic if serialisation fails. @@ -2256,45 +2689,6 @@ impl XmlInner { } /// An XML object -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { - type Error = String; - - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { - let hdr_value = hdr_value.to_string(); - match hyper::header::HeaderValue::from_str(&hdr_value) { - std::result::Result::Ok(value) => std::result::Result::Ok(value), - std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for XmlObject - value: {} is invalid {}", - hdr_value, e)) - } - } -} - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { - type Error = String; - - fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { - match hdr_value.to_str() { - std::result::Result::Ok(value) => { - match ::from_str(value) { - std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), - std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into XmlObject - {}", - value, err)) - } - }, - std::result::Result::Err(e) => std::result::Result::Err( - format!("Unable to convert header: {:?} to string: {}", - hdr_value, e)) - } - } -} - - #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] #[serde(rename = "camelXmlObject")] @@ -2368,8 +2762,8 @@ impl std::str::FromStr for XmlObject { if let Some(key) = key_result { match key { - "innerString" => intermediate_rep.inner_string.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "other_inner_rename" => intermediate_rep.other_inner_rename.push(isize::from_str(val).map_err(|x| format!("{}", x))?), + "innerString" => intermediate_rep.inner_string.push(::from_str(val).map_err(|x| format!("{}", x))?), + "other_inner_rename" => intermediate_rep.other_inner_rename.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing XmlObject".to_string()) } } @@ -2386,6 +2780,44 @@ impl std::str::FromStr for XmlObject { } } +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for XmlObject - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into XmlObject - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} + impl XmlObject { /// Associated constant for this model's XML namespace. diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs index eb6ca983932..ec6863b8bd3 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs @@ -22,6 +22,7 @@ pub use crate::context; type ServiceFuture = BoxFuture<'static, Result, crate::ServiceError>>; use crate::{Api, + AnyOfGetResponse, CallbackWithHeaderPostResponse, ComplexQueryParamGetResponse, EnumInPathPathParamGetResponse, @@ -30,6 +31,7 @@ use crate::{Api, MergePatchJsonGetResponse, MultigetGetResponse, MultipleAuthSchemeGetResponse, + OneOfGetResponse, OverrideServerGetResponse, ParamgetGetResponse, ReadonlyAuthSchemeGetResponse, @@ -55,6 +57,7 @@ mod paths { lazy_static! { pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(vec![ + r"^/any-of$", r"^/callback-with-header$", r"^/complex-query-param$", r"^/enum_in_path/(?P[^/?#]*)$", @@ -63,6 +66,7 @@ mod paths { r"^/merge-patch-json$", r"^/multiget$", r"^/multiple_auth_scheme$", + r"^/one-of$", r"^/override-server$", r"^/paramget$", r"^/readonly_auth_scheme$", @@ -80,38 +84,40 @@ mod paths { ]) .expect("Unable to create global regex set"); } - pub(crate) static ID_CALLBACK_WITH_HEADER: usize = 0; - pub(crate) static ID_COMPLEX_QUERY_PARAM: usize = 1; - pub(crate) static ID_ENUM_IN_PATH_PATH_PARAM: usize = 2; + pub(crate) static ID_ANY_OF: usize = 0; + pub(crate) static ID_CALLBACK_WITH_HEADER: usize = 1; + pub(crate) static ID_COMPLEX_QUERY_PARAM: usize = 2; + pub(crate) static ID_ENUM_IN_PATH_PATH_PARAM: usize = 3; lazy_static! { pub static ref REGEX_ENUM_IN_PATH_PATH_PARAM: regex::Regex = regex::Regex::new(r"^/enum_in_path/(?P[^/?#]*)$") .expect("Unable to create regex for ENUM_IN_PATH_PATH_PARAM"); } - pub(crate) static ID_JSON_COMPLEX_QUERY_PARAM: usize = 3; - pub(crate) static ID_MANDATORY_REQUEST_HEADER: usize = 4; - pub(crate) static ID_MERGE_PATCH_JSON: usize = 5; - pub(crate) static ID_MULTIGET: usize = 6; - pub(crate) static ID_MULTIPLE_AUTH_SCHEME: usize = 7; - pub(crate) static ID_OVERRIDE_SERVER: usize = 8; - pub(crate) static ID_PARAMGET: usize = 9; - pub(crate) static ID_READONLY_AUTH_SCHEME: usize = 10; - pub(crate) static ID_REGISTER_CALLBACK: usize = 11; - pub(crate) static ID_REPOS: usize = 12; - pub(crate) static ID_REPOS_REPOID: usize = 13; + pub(crate) static ID_JSON_COMPLEX_QUERY_PARAM: usize = 4; + pub(crate) static ID_MANDATORY_REQUEST_HEADER: usize = 5; + pub(crate) static ID_MERGE_PATCH_JSON: usize = 6; + pub(crate) static ID_MULTIGET: usize = 7; + pub(crate) static ID_MULTIPLE_AUTH_SCHEME: usize = 8; + pub(crate) static ID_ONE_OF: usize = 9; + pub(crate) static ID_OVERRIDE_SERVER: usize = 10; + pub(crate) static ID_PARAMGET: usize = 11; + pub(crate) static ID_READONLY_AUTH_SCHEME: usize = 12; + pub(crate) static ID_REGISTER_CALLBACK: usize = 13; + pub(crate) static ID_REPOS: usize = 14; + pub(crate) static ID_REPOS_REPOID: usize = 15; lazy_static! { pub static ref REGEX_REPOS_REPOID: regex::Regex = regex::Regex::new(r"^/repos/(?P[^/?#]*)$") .expect("Unable to create regex for REPOS_REPOID"); } - pub(crate) static ID_REQUIRED_OCTET_STREAM: usize = 14; - pub(crate) static ID_RESPONSES_WITH_HEADERS: usize = 15; - pub(crate) static ID_RFC7807: usize = 16; - pub(crate) static ID_UNTYPED_PROPERTY: usize = 17; - pub(crate) static ID_UUID: usize = 18; - pub(crate) static ID_XML: usize = 19; - pub(crate) static ID_XML_EXTRA: usize = 20; - pub(crate) static ID_XML_OTHER: usize = 21; + pub(crate) static ID_REQUIRED_OCTET_STREAM: usize = 16; + pub(crate) static ID_RESPONSES_WITH_HEADERS: usize = 17; + pub(crate) static ID_RFC7807: usize = 18; + pub(crate) static ID_UNTYPED_PROPERTY: usize = 19; + pub(crate) static ID_UUID: usize = 20; + pub(crate) static ID_XML: usize = 21; + pub(crate) static ID_XML_EXTRA: usize = 22; + pub(crate) static ID_XML_OTHER: usize = 23; } pub struct MakeService where @@ -216,6 +222,76 @@ impl hyper::service::Service<(Request, C)> for Service where match &method { + // AnyOfGet - GET /any-of + &hyper::Method::GET if path.matched(paths::ID_ANY_OF) => { + // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) + let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); + let param_any_of = query_params.iter().filter(|e| e.0 == "any-of").map(|e| e.1.to_owned()) + .filter_map(|param_any_of| param_any_of.parse().ok()) + .collect::>(); + let param_any_of = if !param_any_of.is_empty() { + Some(param_any_of) + } else { + None + }; + + let result = api_impl.any_of_get( + param_any_of.as_ref(), + &context + ).await; + let mut response = Response::new(Body::empty()); + response.headers_mut().insert( + HeaderName::from_static("x-span-id"), + HeaderValue::from_str((&context as &dyn Has).get().0.clone().to_string().as_str()) + .expect("Unable to create X-Span-ID header value")); + + match result { + Ok(rsp) => match rsp { + AnyOfGetResponse::Success + (body) + => { + *response.status_mut() = StatusCode::from_u16(200).expect("Unable to turn 200 into a StatusCode"); + response.headers_mut().insert( + CONTENT_TYPE, + HeaderValue::from_str("application/json") + .expect("Unable to create Content-Type header for ANY_OF_GET_SUCCESS")); + let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); + *response.body_mut() = Body::from(body); + }, + AnyOfGetResponse::AlternateSuccess + (body) + => { + *response.status_mut() = StatusCode::from_u16(201).expect("Unable to turn 201 into a StatusCode"); + response.headers_mut().insert( + CONTENT_TYPE, + HeaderValue::from_str("application/json") + .expect("Unable to create Content-Type header for ANY_OF_GET_ALTERNATE_SUCCESS")); + let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); + *response.body_mut() = Body::from(body); + }, + AnyOfGetResponse::AnyOfSuccess + (body) + => { + *response.status_mut() = StatusCode::from_u16(202).expect("Unable to turn 202 into a StatusCode"); + response.headers_mut().insert( + CONTENT_TYPE, + HeaderValue::from_str("application/json") + .expect("Unable to create Content-Type header for ANY_OF_GET_ANY_OF_SUCCESS")); + let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); + *response.body_mut() = Body::from(body); + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + *response.status_mut() = StatusCode::INTERNAL_SERVER_ERROR; + *response.body_mut() = Body::from("An internal error occurred"); + }, + } + + Ok(response) + }, + // CallbackWithHeaderPost - POST /callback-with-header &hyper::Method::POST if path.matched(paths::ID_CALLBACK_WITH_HEADER) => { // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) @@ -667,6 +743,42 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(response) }, + // OneOfGet - GET /one-of + &hyper::Method::GET if path.matched(paths::ID_ONE_OF) => { + let result = api_impl.one_of_get( + &context + ).await; + let mut response = Response::new(Body::empty()); + response.headers_mut().insert( + HeaderName::from_static("x-span-id"), + HeaderValue::from_str((&context as &dyn Has).get().0.clone().to_string().as_str()) + .expect("Unable to create X-Span-ID header value")); + + match result { + Ok(rsp) => match rsp { + OneOfGetResponse::Success + (body) + => { + *response.status_mut() = StatusCode::from_u16(200).expect("Unable to turn 200 into a StatusCode"); + response.headers_mut().insert( + CONTENT_TYPE, + HeaderValue::from_str("application/json") + .expect("Unable to create Content-Type header for ONE_OF_GET_SUCCESS")); + let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); + *response.body_mut() = Body::from(body); + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + *response.status_mut() = StatusCode::INTERNAL_SERVER_ERROR; + *response.body_mut() = Body::from("An internal error occurred"); + }, + } + + Ok(response) + }, + // OverrideServerGet - GET /override-server &hyper::Method::GET if path.matched(paths::ID_OVERRIDE_SERVER) => { let result = api_impl.override_server_get( @@ -1722,6 +1834,7 @@ impl hyper::service::Service<(Request, C)> for Service where Ok(response) }, + _ if path.matched(paths::ID_ANY_OF) => method_not_allowed(), _ if path.matched(paths::ID_CALLBACK_WITH_HEADER) => method_not_allowed(), _ if path.matched(paths::ID_COMPLEX_QUERY_PARAM) => method_not_allowed(), _ if path.matched(paths::ID_ENUM_IN_PATH_PATH_PARAM) => method_not_allowed(), @@ -1730,6 +1843,7 @@ impl hyper::service::Service<(Request, C)> for Service where _ if path.matched(paths::ID_MERGE_PATCH_JSON) => method_not_allowed(), _ if path.matched(paths::ID_MULTIGET) => method_not_allowed(), _ if path.matched(paths::ID_MULTIPLE_AUTH_SCHEME) => method_not_allowed(), + _ if path.matched(paths::ID_ONE_OF) => method_not_allowed(), _ if path.matched(paths::ID_OVERRIDE_SERVER) => method_not_allowed(), _ if path.matched(paths::ID_PARAMGET) => method_not_allowed(), _ if path.matched(paths::ID_READONLY_AUTH_SCHEME) => method_not_allowed(), @@ -1757,6 +1871,8 @@ impl RequestParser for ApiRequestParser { fn parse_operation_id(request: &Request) -> Result<&'static str, ()> { let path = paths::GLOBAL_REGEX_SET.matches(request.uri().path()); match request.method() { + // AnyOfGet - GET /any-of + &hyper::Method::GET if path.matched(paths::ID_ANY_OF) => Ok("AnyOfGet"), // CallbackWithHeaderPost - POST /callback-with-header &hyper::Method::POST if path.matched(paths::ID_CALLBACK_WITH_HEADER) => Ok("CallbackWithHeaderPost"), // ComplexQueryParamGet - GET /complex-query-param @@ -1773,6 +1889,8 @@ impl RequestParser for ApiRequestParser { &hyper::Method::GET if path.matched(paths::ID_MULTIGET) => Ok("MultigetGet"), // MultipleAuthSchemeGet - GET /multiple_auth_scheme &hyper::Method::GET if path.matched(paths::ID_MULTIPLE_AUTH_SCHEME) => Ok("MultipleAuthSchemeGet"), + // OneOfGet - GET /one-of + &hyper::Method::GET if path.matched(paths::ID_ONE_OF) => Ok("OneOfGet"), // OverrideServerGet - GET /override-server &hyper::Method::GET if path.matched(paths::ID_OVERRIDE_SERVER) => Ok("OverrideServerGet"), // ParamgetGet - GET /paramget 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 793ffbb6c00..5410fb3d3cf 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml +++ b/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml @@ -29,7 +29,7 @@ openssl = {version = "0.10", optional = true } async-trait = "0.1.24" chrono = { version = "0.4", features = ["serde"] } futures = "0.3" -swagger = "5.0.0-alpha-1" +swagger = "5.0.2" log = "0.4.0" mime = "0.3" diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/models.rs b/samples/server/petstore/rust-server/output/ops-v3/src/models.rs index aaf4182a33e..cf82e33947d 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/src/models.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/src/models.rs @@ -3,4 +3,3 @@ use crate::models; #[cfg(any(feature = "client", feature = "server"))] use crate::header; - 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 869f0b722d7..fb344637445 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 @@ -10,7 +10,7 @@ edition = "2018" default = ["client", "server"] client = [ "mime_0_2", - "multipart", "multipart/client", "swagger/multipart", + "multipart", "multipart/client", "swagger/multipart_form", "serde_urlencoded", "hyper", "hyper-openssl", "hyper-tls", "native-tls", "openssl", "url" ] @@ -34,7 +34,7 @@ openssl = {version = "0.10", optional = true } async-trait = "0.1.24" chrono = { version = "0.4", features = ["serde"] } futures = "0.3" -swagger = "5.0.0-alpha-1" +swagger = "5.0.2" log = "0.4.0" mime = "0.3" diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs index 12dd045e216..1c4d90d71d8 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs @@ -4,46 +4,6 @@ use crate::models; #[cfg(any(feature = "client", feature = "server"))] use crate::header; - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { - type Error = String; - - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { - let hdr_value = hdr_value.to_string(); - match hyper::header::HeaderValue::from_str(&hdr_value) { - std::result::Result::Ok(value) => std::result::Result::Ok(value), - std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for AdditionalPropertiesClass - value: {} is invalid {}", - hdr_value, e)) - } - } -} - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { - type Error = String; - - fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { - match hdr_value.to_str() { - std::result::Result::Ok(value) => { - match ::from_str(value) { - std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), - std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into AdditionalPropertiesClass - {}", - value, err)) - } - }, - std::result::Result::Err(e) => std::result::Result::Err( - format!("Unable to convert header: {:?} to string: {}", - hdr_value, e)) - } - } -} - - #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct AdditionalPropertiesClass { @@ -127,44 +87,34 @@ impl std::str::FromStr for AdditionalPropertiesClass { } } - -impl AdditionalPropertiesClass { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for Animal - value: {} is invalid {}", + format!("Invalid header value for AdditionalPropertiesClass - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into Animal - {}", + format!("Unable to convert header value '{}' into AdditionalPropertiesClass - {}", value, err)) } }, @@ -176,6 +126,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl AdditionalPropertiesClass { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct Animal { @@ -245,8 +204,8 @@ impl std::str::FromStr for Animal { if let Some(key) = key_result { match key { - "className" => intermediate_rep.class_name.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "color" => intermediate_rep.color.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "className" => intermediate_rep.class_name.push(::from_str(val).map_err(|x| format!("{}", x))?), + "color" => intermediate_rep.color.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing Animal".to_string()) } } @@ -263,44 +222,34 @@ impl std::str::FromStr for Animal { } } - -impl Animal { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for AnimalFarm - value: {} is invalid {}", + format!("Invalid header value for Animal - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into AnimalFarm - {}", + format!("Unable to convert header value '{}' into Animal - {}", value, err)) } }, @@ -311,6 +260,16 @@ impl std::convert::TryFrom for header::IntoHeaderVal } } + +impl Animal { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct AnimalFarm( @@ -401,43 +360,34 @@ impl std::str::FromStr for AnimalFarm { } -impl AnimalFarm { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for ApiResponse - value: {} is invalid {}", + format!("Invalid header value for AnimalFarm - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into ApiResponse - {}", + format!("Unable to convert header value '{}' into AnimalFarm - {}", value, err)) } }, @@ -449,6 +399,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl AnimalFarm { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct ApiResponse { @@ -533,9 +492,9 @@ impl std::str::FromStr for ApiResponse { if let Some(key) = key_result { match key { - "code" => intermediate_rep.code.push(i32::from_str(val).map_err(|x| format!("{}", x))?), - "type" => intermediate_rep.type_.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "message" => intermediate_rep.message.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "code" => intermediate_rep.code.push(::from_str(val).map_err(|x| format!("{}", x))?), + "type" => intermediate_rep.type_.push(::from_str(val).map_err(|x| format!("{}", x))?), + "message" => intermediate_rep.message.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing ApiResponse".to_string()) } } @@ -553,44 +512,34 @@ impl std::str::FromStr for ApiResponse { } } - -impl ApiResponse { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for ArrayOfArrayOfNumberOnly - value: {} is invalid {}", + format!("Invalid header value for ApiResponse - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into ArrayOfArrayOfNumberOnly - {}", + format!("Unable to convert header value '{}' into ApiResponse - {}", value, err)) } }, @@ -602,6 +551,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl ApiResponse { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct ArrayOfArrayOfNumberOnly { @@ -674,44 +632,34 @@ impl std::str::FromStr for ArrayOfArrayOfNumberOnly { } } - -impl ArrayOfArrayOfNumberOnly { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for ArrayOfNumberOnly - value: {} is invalid {}", + format!("Invalid header value for ArrayOfArrayOfNumberOnly - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into ArrayOfNumberOnly - {}", + format!("Unable to convert header value '{}' into ArrayOfArrayOfNumberOnly - {}", value, err)) } }, @@ -723,6 +671,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl ArrayOfArrayOfNumberOnly { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct ArrayOfNumberOnly { @@ -799,44 +756,34 @@ impl std::str::FromStr for ArrayOfNumberOnly { } } - -impl ArrayOfNumberOnly { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for ArrayTest - value: {} is invalid {}", + format!("Invalid header value for ArrayOfNumberOnly - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into ArrayTest - {}", + format!("Unable to convert header value '{}' into ArrayOfNumberOnly - {}", value, err)) } }, @@ -848,6 +795,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl ArrayOfNumberOnly { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct ArrayTest { @@ -959,44 +915,34 @@ impl std::str::FromStr for ArrayTest { } } - -impl ArrayTest { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for Capitalization - value: {} is invalid {}", + format!("Invalid header value for ArrayTest - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into Capitalization - {}", + format!("Unable to convert header value '{}' into ArrayTest - {}", value, err)) } }, @@ -1008,6 +954,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl ArrayTest { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct Capitalization { @@ -1129,12 +1084,12 @@ impl std::str::FromStr for Capitalization { if let Some(key) = key_result { match key { - "smallCamel" => intermediate_rep.small_camel.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "CapitalCamel" => intermediate_rep.capital_camel.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "small_Snake" => intermediate_rep.small_snake.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "Capital_Snake" => intermediate_rep.capital_snake.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "SCA_ETH_Flow_Points" => intermediate_rep.sca_eth_flow_points.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "ATT_NAME" => intermediate_rep.att_name.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "smallCamel" => intermediate_rep.small_camel.push(::from_str(val).map_err(|x| format!("{}", x))?), + "CapitalCamel" => intermediate_rep.capital_camel.push(::from_str(val).map_err(|x| format!("{}", x))?), + "small_Snake" => intermediate_rep.small_snake.push(::from_str(val).map_err(|x| format!("{}", x))?), + "Capital_Snake" => intermediate_rep.capital_snake.push(::from_str(val).map_err(|x| format!("{}", x))?), + "SCA_ETH_Flow_Points" => intermediate_rep.sca_eth_flow_points.push(::from_str(val).map_err(|x| format!("{}", x))?), + "ATT_NAME" => intermediate_rep.att_name.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing Capitalization".to_string()) } } @@ -1155,44 +1110,34 @@ impl std::str::FromStr for Capitalization { } } - -impl Capitalization { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for Cat - value: {} is invalid {}", + format!("Invalid header value for Capitalization - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into Cat - {}", + format!("Unable to convert header value '{}' into Capitalization - {}", value, err)) } }, @@ -1204,6 +1149,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl Capitalization { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct Cat { @@ -1285,9 +1239,9 @@ impl std::str::FromStr for Cat { if let Some(key) = key_result { match key { - "className" => intermediate_rep.class_name.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "color" => intermediate_rep.color.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "declawed" => intermediate_rep.declawed.push(bool::from_str(val).map_err(|x| format!("{}", x))?), + "className" => intermediate_rep.class_name.push(::from_str(val).map_err(|x| format!("{}", x))?), + "color" => intermediate_rep.color.push(::from_str(val).map_err(|x| format!("{}", x))?), + "declawed" => intermediate_rep.declawed.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing Cat".to_string()) } } @@ -1305,44 +1259,34 @@ impl std::str::FromStr for Cat { } } - -impl Cat { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for CatAllOf - value: {} is invalid {}", + format!("Invalid header value for Cat - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into CatAllOf - {}", + format!("Unable to convert header value '{}' into Cat - {}", value, err)) } }, @@ -1354,6 +1298,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl Cat { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct CatAllOf { @@ -1414,7 +1367,7 @@ impl std::str::FromStr for CatAllOf { if let Some(key) = key_result { match key { - "declawed" => intermediate_rep.declawed.push(bool::from_str(val).map_err(|x| format!("{}", x))?), + "declawed" => intermediate_rep.declawed.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing CatAllOf".to_string()) } } @@ -1430,44 +1383,34 @@ impl std::str::FromStr for CatAllOf { } } - -impl CatAllOf { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for Category - value: {} is invalid {}", + format!("Invalid header value for CatAllOf - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into Category - {}", + format!("Unable to convert header value '{}' into CatAllOf - {}", value, err)) } }, @@ -1479,6 +1422,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl CatAllOf { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] #[serde(rename = "Category")] @@ -1552,8 +1504,8 @@ impl std::str::FromStr for Category { if let Some(key) = key_result { match key { - "id" => intermediate_rep.id.push(i64::from_str(val).map_err(|x| format!("{}", x))?), - "name" => intermediate_rep.name.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "id" => intermediate_rep.id.push(::from_str(val).map_err(|x| format!("{}", x))?), + "name" => intermediate_rep.name.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing Category".to_string()) } } @@ -1570,45 +1522,34 @@ impl std::str::FromStr for Category { } } - -impl Category { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -/// Model for testing model with \"_class\" property -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for ClassModel - value: {} is invalid {}", + format!("Invalid header value for Category - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into ClassModel - {}", + format!("Unable to convert header value '{}' into Category - {}", value, err)) } }, @@ -1620,6 +1561,16 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl Category { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + +/// Model for testing model with \"_class\" property #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct ClassModel { @@ -1680,7 +1631,7 @@ impl std::str::FromStr for ClassModel { if let Some(key) = key_result { match key { - "_class" => intermediate_rep._class.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "_class" => intermediate_rep._class.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing ClassModel".to_string()) } } @@ -1696,44 +1647,34 @@ impl std::str::FromStr for ClassModel { } } - -impl ClassModel { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for Client - value: {} is invalid {}", + format!("Invalid header value for ClassModel - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into Client - {}", + format!("Unable to convert header value '{}' into ClassModel - {}", value, err)) } }, @@ -1745,6 +1686,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl ClassModel { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct Client { @@ -1805,7 +1755,7 @@ impl std::str::FromStr for Client { if let Some(key) = key_result { match key { - "client" => intermediate_rep.client.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "client" => intermediate_rep.client.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing Client".to_string()) } } @@ -1821,44 +1771,34 @@ impl std::str::FromStr for Client { } } - -impl Client { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for Dog - value: {} is invalid {}", + format!("Invalid header value for Client - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into Dog - {}", + format!("Unable to convert header value '{}' into Client - {}", value, err)) } }, @@ -1870,6 +1810,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl Client { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct Dog { @@ -1951,9 +1900,9 @@ impl std::str::FromStr for Dog { if let Some(key) = key_result { match key { - "className" => intermediate_rep.class_name.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "color" => intermediate_rep.color.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "breed" => intermediate_rep.breed.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "className" => intermediate_rep.class_name.push(::from_str(val).map_err(|x| format!("{}", x))?), + "color" => intermediate_rep.color.push(::from_str(val).map_err(|x| format!("{}", x))?), + "breed" => intermediate_rep.breed.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing Dog".to_string()) } } @@ -1971,44 +1920,34 @@ impl std::str::FromStr for Dog { } } - -impl Dog { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for DogAllOf - value: {} is invalid {}", + format!("Invalid header value for Dog - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into DogAllOf - {}", + format!("Unable to convert header value '{}' into Dog - {}", value, err)) } }, @@ -2020,6 +1959,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl Dog { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct DogAllOf { @@ -2080,7 +2028,7 @@ impl std::str::FromStr for DogAllOf { if let Some(key) = key_result { match key { - "breed" => intermediate_rep.breed.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "breed" => intermediate_rep.breed.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing DogAllOf".to_string()) } } @@ -2096,44 +2044,34 @@ impl std::str::FromStr for DogAllOf { } } - -impl DogAllOf { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for EnumArrays - value: {} is invalid {}", + format!("Invalid header value for DogAllOf - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into EnumArrays - {}", + format!("Unable to convert header value '{}' into DogAllOf - {}", value, err)) } }, @@ -2145,6 +2083,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl DogAllOf { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct EnumArrays { @@ -2228,7 +2175,7 @@ impl std::str::FromStr for EnumArrays { if let Some(key) = key_result { match key { - "just_symbol" => intermediate_rep.just_symbol.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "just_symbol" => intermediate_rep.just_symbol.push(::from_str(val).map_err(|x| format!("{}", x))?), "array_enum" => return std::result::Result::Err("Parsing a container in this style is not supported in EnumArrays".to_string()), "array_array_enum" => return std::result::Result::Err("Parsing a container in this style is not supported in EnumArrays".to_string()), _ => return std::result::Result::Err("Unexpected key while parsing EnumArrays".to_string()) @@ -2248,6 +2195,44 @@ impl std::str::FromStr for EnumArrays { } } +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for EnumArrays - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into EnumArrays - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} + impl EnumArrays { /// Helper function to allow us to convert this model to an XML string. @@ -2265,7 +2250,7 @@ impl EnumArrays { #[repr(C)] #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk_enum_derive::LabelledGenericEnum))] -pub enum EnumClass { +pub enum EnumClass { #[serde(rename = "_abc")] _ABC, #[serde(rename = "-efg")] @@ -2276,7 +2261,7 @@ pub enum EnumClass { impl std::fmt::Display for EnumClass { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match *self { + match *self { EnumClass::_ABC => write!(f, "{}", "_abc"), EnumClass::_EFG => write!(f, "{}", "-efg"), EnumClass::_XYZ_ => write!(f, "{}", "(xyz)"), @@ -2306,45 +2291,6 @@ impl EnumClass { } } -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { - type Error = String; - - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { - let hdr_value = hdr_value.to_string(); - match hyper::header::HeaderValue::from_str(&hdr_value) { - std::result::Result::Ok(value) => std::result::Result::Ok(value), - std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for EnumTest - value: {} is invalid {}", - hdr_value, e)) - } - } -} - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { - type Error = String; - - fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { - match hdr_value.to_str() { - std::result::Result::Ok(value) => { - match ::from_str(value) { - std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), - std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into EnumTest - {}", - value, err)) - } - }, - std::result::Result::Err(e) => std::result::Result::Err( - format!("Unable to convert header: {:?} to string: {}", - hdr_value, e)) - } - } -} - - #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct EnumTest { @@ -2450,11 +2396,11 @@ impl std::str::FromStr for EnumTest { if let Some(key) = key_result { match key { - "enum_string" => intermediate_rep.enum_string.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "enum_string_required" => intermediate_rep.enum_string_required.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "enum_integer" => intermediate_rep.enum_integer.push(i32::from_str(val).map_err(|x| format!("{}", x))?), - "enum_number" => intermediate_rep.enum_number.push(f64::from_str(val).map_err(|x| format!("{}", x))?), - "outerEnum" => intermediate_rep.outer_enum.push(models::OuterEnum::from_str(val).map_err(|x| format!("{}", x))?), + "enum_string" => intermediate_rep.enum_string.push(::from_str(val).map_err(|x| format!("{}", x))?), + "enum_string_required" => intermediate_rep.enum_string_required.push(::from_str(val).map_err(|x| format!("{}", x))?), + "enum_integer" => intermediate_rep.enum_integer.push(::from_str(val).map_err(|x| format!("{}", x))?), + "enum_number" => intermediate_rep.enum_number.push(::from_str(val).map_err(|x| format!("{}", x))?), + "outerEnum" => intermediate_rep.outer_enum.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing EnumTest".to_string()) } } @@ -2474,44 +2420,34 @@ impl std::str::FromStr for EnumTest { } } - -impl EnumTest { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for FormatTest - value: {} is invalid {}", + format!("Invalid header value for EnumTest - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into FormatTest - {}", + format!("Unable to convert header value '{}' into EnumTest - {}", value, err)) } }, @@ -2523,6 +2459,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl EnumTest { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct FormatTest { @@ -2701,19 +2646,19 @@ impl std::str::FromStr for FormatTest { if let Some(key) = key_result { match key { - "integer" => intermediate_rep.integer.push(u8::from_str(val).map_err(|x| format!("{}", x))?), - "int32" => intermediate_rep.int32.push(u32::from_str(val).map_err(|x| format!("{}", x))?), - "int64" => intermediate_rep.int64.push(i64::from_str(val).map_err(|x| format!("{}", x))?), - "number" => intermediate_rep.number.push(f64::from_str(val).map_err(|x| format!("{}", x))?), - "float" => intermediate_rep.float.push(f32::from_str(val).map_err(|x| format!("{}", x))?), - "double" => intermediate_rep.double.push(f64::from_str(val).map_err(|x| format!("{}", x))?), - "string" => intermediate_rep.string.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "integer" => intermediate_rep.integer.push(::from_str(val).map_err(|x| format!("{}", x))?), + "int32" => intermediate_rep.int32.push(::from_str(val).map_err(|x| format!("{}", x))?), + "int64" => intermediate_rep.int64.push(::from_str(val).map_err(|x| format!("{}", x))?), + "number" => intermediate_rep.number.push(::from_str(val).map_err(|x| format!("{}", x))?), + "float" => intermediate_rep.float.push(::from_str(val).map_err(|x| format!("{}", x))?), + "double" => intermediate_rep.double.push(::from_str(val).map_err(|x| format!("{}", x))?), + "string" => intermediate_rep.string.push(::from_str(val).map_err(|x| format!("{}", x))?), "byte" => return std::result::Result::Err("Parsing binary data in this style is not supported in FormatTest".to_string()), "binary" => return std::result::Result::Err("Parsing binary data in this style is not supported in FormatTest".to_string()), - "date" => intermediate_rep.date.push(chrono::DateTime::::from_str(val).map_err(|x| format!("{}", x))?), - "dateTime" => intermediate_rep.date_time.push(chrono::DateTime::::from_str(val).map_err(|x| format!("{}", x))?), - "uuid" => intermediate_rep.uuid.push(uuid::Uuid::from_str(val).map_err(|x| format!("{}", x))?), - "password" => intermediate_rep.password.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "date" => intermediate_rep.date.push( as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?), + "dateTime" => intermediate_rep.date_time.push( as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?), + "uuid" => intermediate_rep.uuid.push(::from_str(val).map_err(|x| format!("{}", x))?), + "password" => intermediate_rep.password.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing FormatTest".to_string()) } } @@ -2741,44 +2686,34 @@ impl std::str::FromStr for FormatTest { } } - -impl FormatTest { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for HasOnlyReadOnly - value: {} is invalid {}", + format!("Invalid header value for FormatTest - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into HasOnlyReadOnly - {}", + format!("Unable to convert header value '{}' into FormatTest - {}", value, err)) } }, @@ -2790,6 +2725,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl FormatTest { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct HasOnlyReadOnly { @@ -2862,8 +2806,8 @@ impl std::str::FromStr for HasOnlyReadOnly { if let Some(key) = key_result { match key { - "bar" => intermediate_rep.bar.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "foo" => intermediate_rep.foo.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "bar" => intermediate_rep.bar.push(::from_str(val).map_err(|x| format!("{}", x))?), + "foo" => intermediate_rep.foo.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing HasOnlyReadOnly".to_string()) } } @@ -2880,44 +2824,34 @@ impl std::str::FromStr for HasOnlyReadOnly { } } - -impl HasOnlyReadOnly { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for List - value: {} is invalid {}", + format!("Invalid header value for HasOnlyReadOnly - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into List - {}", + format!("Unable to convert header value '{}' into HasOnlyReadOnly - {}", value, err)) } }, @@ -2929,6 +2863,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl HasOnlyReadOnly { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct List { @@ -2989,7 +2932,7 @@ impl std::str::FromStr for List { if let Some(key) = key_result { match key { - "123-list" => intermediate_rep.param_123_list.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "123-list" => intermediate_rep.param_123_list.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing List".to_string()) } } @@ -3005,44 +2948,34 @@ impl std::str::FromStr for List { } } - -impl List { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for MapTest - value: {} is invalid {}", + format!("Invalid header value for List - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into MapTest - {}", + format!("Unable to convert header value '{}' into List - {}", value, err)) } }, @@ -3054,6 +2987,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl List { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct MapTest { @@ -3150,44 +3092,34 @@ impl std::str::FromStr for MapTest { } } - -impl MapTest { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for MixedPropertiesAndAdditionalPropertiesClass - value: {} is invalid {}", + format!("Invalid header value for MapTest - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into MixedPropertiesAndAdditionalPropertiesClass - {}", + format!("Unable to convert header value '{}' into MapTest - {}", value, err)) } }, @@ -3199,6 +3131,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl MapTest { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct MixedPropertiesAndAdditionalPropertiesClass { @@ -3272,8 +3213,8 @@ impl std::str::FromStr for MixedPropertiesAndAdditionalPropertiesClass { if let Some(key) = key_result { match key { - "uuid" => intermediate_rep.uuid.push(uuid::Uuid::from_str(val).map_err(|x| format!("{}", x))?), - "dateTime" => intermediate_rep.date_time.push(chrono::DateTime::::from_str(val).map_err(|x| format!("{}", x))?), + "uuid" => intermediate_rep.uuid.push(::from_str(val).map_err(|x| format!("{}", x))?), + "dateTime" => intermediate_rep.date_time.push( as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?), "map" => return std::result::Result::Err("Parsing a container in this style is not supported in MixedPropertiesAndAdditionalPropertiesClass".to_string()), _ => return std::result::Result::Err("Unexpected key while parsing MixedPropertiesAndAdditionalPropertiesClass".to_string()) } @@ -3292,45 +3233,34 @@ impl std::str::FromStr for MixedPropertiesAndAdditionalPropertiesClass { } } - -impl MixedPropertiesAndAdditionalPropertiesClass { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -/// Model for testing model name starting with number -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for Model200Response - value: {} is invalid {}", + format!("Invalid header value for MixedPropertiesAndAdditionalPropertiesClass - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into Model200Response - {}", + format!("Unable to convert header value '{}' into MixedPropertiesAndAdditionalPropertiesClass - {}", value, err)) } }, @@ -3342,6 +3272,16 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl MixedPropertiesAndAdditionalPropertiesClass { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + +/// Model for testing model name starting with number #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] #[serde(rename = "Name")] @@ -3415,8 +3355,8 @@ impl std::str::FromStr for Model200Response { if let Some(key) = key_result { match key { - "name" => intermediate_rep.name.push(i32::from_str(val).map_err(|x| format!("{}", x))?), - "class" => intermediate_rep.class.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "name" => intermediate_rep.name.push(::from_str(val).map_err(|x| format!("{}", x))?), + "class" => intermediate_rep.class.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing Model200Response".to_string()) } } @@ -3433,45 +3373,34 @@ impl std::str::FromStr for Model200Response { } } - -impl Model200Response { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -/// Model for testing reserved words -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for ModelReturn - value: {} is invalid {}", + format!("Invalid header value for Model200Response - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into ModelReturn - {}", + format!("Unable to convert header value '{}' into Model200Response - {}", value, err)) } }, @@ -3483,6 +3412,16 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl Model200Response { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + +/// Model for testing reserved words #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] #[serde(rename = "Return")] @@ -3544,7 +3483,7 @@ impl std::str::FromStr for ModelReturn { if let Some(key) = key_result { match key { - "return" => intermediate_rep.return_.push(i32::from_str(val).map_err(|x| format!("{}", x))?), + "return" => intermediate_rep.return_.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing ModelReturn".to_string()) } } @@ -3560,45 +3499,34 @@ impl std::str::FromStr for ModelReturn { } } - -impl ModelReturn { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -/// Model for testing model name same as property name -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for Name - value: {} is invalid {}", + format!("Invalid header value for ModelReturn - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into Name - {}", + format!("Unable to convert header value '{}' into ModelReturn - {}", value, err)) } }, @@ -3610,6 +3538,16 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl ModelReturn { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + +/// Model for testing model name same as property name #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] #[serde(rename = "Name")] @@ -3704,10 +3642,10 @@ impl std::str::FromStr for Name { if let Some(key) = key_result { match key { - "name" => intermediate_rep.name.push(i32::from_str(val).map_err(|x| format!("{}", x))?), - "snake_case" => intermediate_rep.snake_case.push(i32::from_str(val).map_err(|x| format!("{}", x))?), - "property" => intermediate_rep.property.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "123Number" => intermediate_rep.param_123_number.push(isize::from_str(val).map_err(|x| format!("{}", x))?), + "name" => intermediate_rep.name.push(::from_str(val).map_err(|x| format!("{}", x))?), + "snake_case" => intermediate_rep.snake_case.push(::from_str(val).map_err(|x| format!("{}", x))?), + "property" => intermediate_rep.property.push(::from_str(val).map_err(|x| format!("{}", x))?), + "123Number" => intermediate_rep.param_123_number.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing Name".to_string()) } } @@ -3726,44 +3664,34 @@ impl std::str::FromStr for Name { } } - -impl Name { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for NumberOnly - value: {} is invalid {}", + format!("Invalid header value for Name - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into NumberOnly - {}", + format!("Unable to convert header value '{}' into Name - {}", value, err)) } }, @@ -3775,6 +3703,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl Name { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct NumberOnly { @@ -3835,7 +3772,7 @@ impl std::str::FromStr for NumberOnly { if let Some(key) = key_result { match key { - "JustNumber" => intermediate_rep.just_number.push(f64::from_str(val).map_err(|x| format!("{}", x))?), + "JustNumber" => intermediate_rep.just_number.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing NumberOnly".to_string()) } } @@ -3851,44 +3788,34 @@ impl std::str::FromStr for NumberOnly { } } - -impl NumberOnly { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for ObjectContainingObjectWithOnlyAdditionalProperties - value: {} is invalid {}", + format!("Invalid header value for NumberOnly - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into ObjectContainingObjectWithOnlyAdditionalProperties - {}", + format!("Unable to convert header value '{}' into NumberOnly - {}", value, err)) } }, @@ -3900,6 +3827,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl NumberOnly { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct ObjectContainingObjectWithOnlyAdditionalProperties { @@ -3956,7 +3892,7 @@ impl std::str::FromStr for ObjectContainingObjectWithOnlyAdditionalProperties { if let Some(key) = key_result { match key { - "inner" => intermediate_rep.inner.push(models::ObjectWithOnlyAdditionalProperties::from_str(val).map_err(|x| format!("{}", x))?), + "inner" => intermediate_rep.inner.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing ObjectContainingObjectWithOnlyAdditionalProperties".to_string()) } } @@ -3972,6 +3908,44 @@ impl std::str::FromStr for ObjectContainingObjectWithOnlyAdditionalProperties { } } +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for ObjectContainingObjectWithOnlyAdditionalProperties - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into ObjectContainingObjectWithOnlyAdditionalProperties - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} + impl ObjectContainingObjectWithOnlyAdditionalProperties { /// Helper function to allow us to convert this model to an XML string. @@ -3992,7 +3966,6 @@ impl std::convert::From> for ObjectWit } } - impl std::convert::From for std::collections::HashMap { fn from(x: ObjectWithOnlyAdditionalProperties) -> Self { x.0 @@ -4042,45 +4015,6 @@ impl ObjectWithOnlyAdditionalProperties { } } -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { - type Error = String; - - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { - let hdr_value = hdr_value.to_string(); - match hyper::header::HeaderValue::from_str(&hdr_value) { - std::result::Result::Ok(value) => std::result::Result::Ok(value), - std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for Order - value: {} is invalid {}", - hdr_value, e)) - } - } -} - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { - type Error = String; - - fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { - match hdr_value.to_str() { - std::result::Result::Ok(value) => { - match ::from_str(value) { - std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), - std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into Order - {}", - value, err)) - } - }, - std::result::Result::Err(e) => std::result::Result::Err( - format!("Unable to convert header: {:?} to string: {}", - hdr_value, e)) - } - } -} - - #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] #[serde(rename = "Order")] @@ -4200,12 +4134,12 @@ impl std::str::FromStr for Order { if let Some(key) = key_result { match key { - "id" => intermediate_rep.id.push(i64::from_str(val).map_err(|x| format!("{}", x))?), - "petId" => intermediate_rep.pet_id.push(i64::from_str(val).map_err(|x| format!("{}", x))?), - "quantity" => intermediate_rep.quantity.push(i32::from_str(val).map_err(|x| format!("{}", x))?), - "shipDate" => intermediate_rep.ship_date.push(chrono::DateTime::::from_str(val).map_err(|x| format!("{}", x))?), - "status" => intermediate_rep.status.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "complete" => intermediate_rep.complete.push(bool::from_str(val).map_err(|x| format!("{}", x))?), + "id" => intermediate_rep.id.push(::from_str(val).map_err(|x| format!("{}", x))?), + "petId" => intermediate_rep.pet_id.push(::from_str(val).map_err(|x| format!("{}", x))?), + "quantity" => intermediate_rep.quantity.push(::from_str(val).map_err(|x| format!("{}", x))?), + "shipDate" => intermediate_rep.ship_date.push( as std::str::FromStr>::from_str(val).map_err(|x| format!("{}", x))?), + "status" => intermediate_rep.status.push(::from_str(val).map_err(|x| format!("{}", x))?), + "complete" => intermediate_rep.complete.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing Order".to_string()) } } @@ -4226,6 +4160,44 @@ impl std::str::FromStr for Order { } } +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for Order - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into Order - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} + impl Order { /// Helper function to allow us to convert this model to an XML string. @@ -4246,7 +4218,6 @@ impl std::convert::From for OuterBoolean { } } - impl std::convert::From for bool { fn from(x: OuterBoolean) -> Self { x.0 @@ -4276,45 +4247,6 @@ impl OuterBoolean { } } -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { - type Error = String; - - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { - let hdr_value = hdr_value.to_string(); - match hyper::header::HeaderValue::from_str(&hdr_value) { - std::result::Result::Ok(value) => std::result::Result::Ok(value), - std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for OuterComposite - value: {} is invalid {}", - hdr_value, e)) - } - } -} - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { - type Error = String; - - fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { - match hdr_value.to_str() { - std::result::Result::Ok(value) => { - match ::from_str(value) { - std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), - std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into OuterComposite - {}", - value, err)) - } - }, - std::result::Result::Err(e) => std::result::Result::Err( - format!("Unable to convert header: {:?} to string: {}", - hdr_value, e)) - } - } -} - - #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct OuterComposite { @@ -4399,9 +4331,9 @@ impl std::str::FromStr for OuterComposite { if let Some(key) = key_result { match key { - "my_number" => intermediate_rep.my_number.push(f64::from_str(val).map_err(|x| format!("{}", x))?), - "my_string" => intermediate_rep.my_string.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "my_boolean" => intermediate_rep.my_boolean.push(bool::from_str(val).map_err(|x| format!("{}", x))?), + "my_number" => intermediate_rep.my_number.push(::from_str(val).map_err(|x| format!("{}", x))?), + "my_string" => intermediate_rep.my_string.push(::from_str(val).map_err(|x| format!("{}", x))?), + "my_boolean" => intermediate_rep.my_boolean.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing OuterComposite".to_string()) } } @@ -4419,6 +4351,44 @@ impl std::str::FromStr for OuterComposite { } } +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for OuterComposite - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into OuterComposite - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} + impl OuterComposite { /// Helper function to allow us to convert this model to an XML string. @@ -4436,7 +4406,7 @@ impl OuterComposite { #[repr(C)] #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk_enum_derive::LabelledGenericEnum))] -pub enum OuterEnum { +pub enum OuterEnum { #[serde(rename = "placed")] PLACED, #[serde(rename = "approved")] @@ -4447,7 +4417,7 @@ pub enum OuterEnum { impl std::fmt::Display for OuterEnum { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match *self { + match *self { OuterEnum::PLACED => write!(f, "{}", "placed"), OuterEnum::APPROVED => write!(f, "{}", "approved"), OuterEnum::DELIVERED => write!(f, "{}", "delivered"), @@ -4487,7 +4457,6 @@ impl std::convert::From for OuterNumber { } } - impl std::convert::From for f64 { fn from(x: OuterNumber) -> Self { x.0 @@ -4569,45 +4538,6 @@ impl OuterString { } } -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { - type Error = String; - - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { - let hdr_value = hdr_value.to_string(); - match hyper::header::HeaderValue::from_str(&hdr_value) { - std::result::Result::Ok(value) => std::result::Result::Ok(value), - std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for Pet - value: {} is invalid {}", - hdr_value, e)) - } - } -} - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { - type Error = String; - - fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { - match hdr_value.to_str() { - std::result::Result::Ok(value) => { - match ::from_str(value) { - std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), - std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into Pet - {}", - value, err)) - } - }, - std::result::Result::Err(e) => std::result::Result::Err( - format!("Unable to convert header: {:?} to string: {}", - hdr_value, e)) - } - } -} - - #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] #[serde(rename = "Pet")] @@ -4717,12 +4647,12 @@ impl std::str::FromStr for Pet { if let Some(key) = key_result { match key { - "id" => intermediate_rep.id.push(i64::from_str(val).map_err(|x| format!("{}", x))?), - "category" => intermediate_rep.category.push(models::Category::from_str(val).map_err(|x| format!("{}", x))?), - "name" => intermediate_rep.name.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "id" => intermediate_rep.id.push(::from_str(val).map_err(|x| format!("{}", x))?), + "category" => intermediate_rep.category.push(::from_str(val).map_err(|x| format!("{}", x))?), + "name" => intermediate_rep.name.push(::from_str(val).map_err(|x| format!("{}", x))?), "photoUrls" => return std::result::Result::Err("Parsing a container in this style is not supported in Pet".to_string()), "tags" => return std::result::Result::Err("Parsing a container in this style is not supported in Pet".to_string()), - "status" => intermediate_rep.status.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "status" => intermediate_rep.status.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing Pet".to_string()) } } @@ -4743,44 +4673,34 @@ impl std::str::FromStr for Pet { } } - -impl Pet { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for ReadOnlyFirst - value: {} is invalid {}", + format!("Invalid header value for Pet - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into ReadOnlyFirst - {}", + format!("Unable to convert header value '{}' into Pet - {}", value, err)) } }, @@ -4792,6 +4712,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl Pet { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct ReadOnlyFirst { @@ -4864,8 +4793,8 @@ impl std::str::FromStr for ReadOnlyFirst { if let Some(key) = key_result { match key { - "bar" => intermediate_rep.bar.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "baz" => intermediate_rep.baz.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "bar" => intermediate_rep.bar.push(::from_str(val).map_err(|x| format!("{}", x))?), + "baz" => intermediate_rep.baz.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing ReadOnlyFirst".to_string()) } } @@ -4882,44 +4811,34 @@ impl std::str::FromStr for ReadOnlyFirst { } } - -impl ReadOnlyFirst { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for SpecialModelName - value: {} is invalid {}", + format!("Invalid header value for ReadOnlyFirst - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into SpecialModelName - {}", + format!("Unable to convert header value '{}' into ReadOnlyFirst - {}", value, err)) } }, @@ -4931,6 +4850,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl ReadOnlyFirst { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] #[serde(rename = "$special[model.name]")] @@ -4992,7 +4920,7 @@ impl std::str::FromStr for SpecialModelName { if let Some(key) = key_result { match key { - "$special[property.name]" => intermediate_rep.special_property_name.push(i64::from_str(val).map_err(|x| format!("{}", x))?), + "$special[property.name]" => intermediate_rep.special_property_name.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing SpecialModelName".to_string()) } } @@ -5008,44 +4936,34 @@ impl std::str::FromStr for SpecialModelName { } } - -impl SpecialModelName { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for Tag - value: {} is invalid {}", + format!("Invalid header value for SpecialModelName - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into Tag - {}", + format!("Unable to convert header value '{}' into SpecialModelName - {}", value, err)) } }, @@ -5057,6 +4975,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl SpecialModelName { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] #[serde(rename = "Tag")] @@ -5130,8 +5057,8 @@ impl std::str::FromStr for Tag { if let Some(key) = key_result { match key { - "id" => intermediate_rep.id.push(i64::from_str(val).map_err(|x| format!("{}", x))?), - "name" => intermediate_rep.name.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "id" => intermediate_rep.id.push(::from_str(val).map_err(|x| format!("{}", x))?), + "name" => intermediate_rep.name.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing Tag".to_string()) } } @@ -5148,44 +5075,34 @@ impl std::str::FromStr for Tag { } } - -impl Tag { - /// Helper function to allow us to convert this model to an XML string. - /// Will panic if serialisation fails. - #[allow(dead_code)] - pub(crate) fn to_xml(&self) -> String { - serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") - } -} - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for User - value: {} is invalid {}", + format!("Invalid header value for Tag - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into User - {}", + format!("Unable to convert header value '{}' into Tag - {}", value, err)) } }, @@ -5197,6 +5114,15 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +impl Tag { + /// Helper function to allow us to convert this model to an XML string. + /// Will panic if serialisation fails. + #[allow(dead_code)] + pub(crate) fn to_xml(&self) -> String { + serde_xml_rs::to_string(&self).expect("impossible to fail to serialize") + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] #[serde(rename = "User")] @@ -5343,14 +5269,14 @@ impl std::str::FromStr for User { if let Some(key) = key_result { match key { - "id" => intermediate_rep.id.push(i64::from_str(val).map_err(|x| format!("{}", x))?), - "username" => intermediate_rep.username.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "firstName" => intermediate_rep.first_name.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "lastName" => intermediate_rep.last_name.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "email" => intermediate_rep.email.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "password" => intermediate_rep.password.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "phone" => intermediate_rep.phone.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "userStatus" => intermediate_rep.user_status.push(i32::from_str(val).map_err(|x| format!("{}", x))?), + "id" => intermediate_rep.id.push(::from_str(val).map_err(|x| format!("{}", x))?), + "username" => intermediate_rep.username.push(::from_str(val).map_err(|x| format!("{}", x))?), + "firstName" => intermediate_rep.first_name.push(::from_str(val).map_err(|x| format!("{}", x))?), + "lastName" => intermediate_rep.last_name.push(::from_str(val).map_err(|x| format!("{}", x))?), + "email" => intermediate_rep.email.push(::from_str(val).map_err(|x| format!("{}", x))?), + "password" => intermediate_rep.password.push(::from_str(val).map_err(|x| format!("{}", x))?), + "phone" => intermediate_rep.phone.push(::from_str(val).map_err(|x| format!("{}", x))?), + "userStatus" => intermediate_rep.user_status.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing User".to_string()) } } @@ -5373,6 +5299,44 @@ impl std::str::FromStr for User { } } +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for User - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into User - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} + impl User { /// Helper function to allow us to convert this model to an XML string. diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs index a4ea1843810..9803b110d86 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs @@ -1989,7 +1989,7 @@ impl hyper::service::Service<(Request, C)> for Service where } } - let boundary = match swagger::multipart::boundary(&headers) { + let boundary = match swagger::multipart::form::boundary(&headers) { Some(boundary) => boundary.to_string(), None => return Ok(Response::builder() .status(StatusCode::BAD_REQUEST) 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 adb71498607..929cb2bf04b 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 @@ -29,7 +29,7 @@ openssl = {version = "0.10", optional = true } async-trait = "0.1.24" chrono = { version = "0.4", features = ["serde"] } futures = "0.3" -swagger = "5.0.0-alpha-1" +swagger = "5.0.2" log = "0.4.0" mime = "0.3" diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs index b8085bcd85a..5bb9c13acba 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs @@ -4,46 +4,6 @@ use crate::models; #[cfg(any(feature = "client", feature = "server"))] use crate::header; - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { - type Error = String; - - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { - let hdr_value = hdr_value.to_string(); - match hyper::header::HeaderValue::from_str(&hdr_value) { - std::result::Result::Ok(value) => std::result::Result::Ok(value), - std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for ANullableContainer - value: {} is invalid {}", - hdr_value, e)) - } - } -} - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { - type Error = String; - - fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { - match hdr_value.to_str() { - std::result::Result::Ok(value) => { - match ::from_str(value) { - std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), - std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into ANullableContainer - {}", - value, err)) - } - }, - std::result::Result::Err(e) => std::result::Result::Err( - format!("Unable to convert header: {:?} to string: {}", - hdr_value, e)) - } - } -} - - #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct ANullableContainer { @@ -133,6 +93,43 @@ impl std::str::FromStr for ANullableContainer { } } +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for ANullableContainer - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into ANullableContainer - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} /// An additionalPropertiesObject @@ -146,7 +143,6 @@ impl std::convert::From> for Additiona } } - impl std::convert::From for std::collections::HashMap { fn from(x: AdditionalPropertiesObject) -> Self { x.0 @@ -187,46 +183,6 @@ impl ::std::str::FromStr for AdditionalPropertiesObject { } } - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { - type Error = String; - - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { - let hdr_value = hdr_value.to_string(); - match hyper::header::HeaderValue::from_str(&hdr_value) { - std::result::Result::Ok(value) => std::result::Result::Ok(value), - std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for AllOfObject - value: {} is invalid {}", - hdr_value, e)) - } - } -} - -#[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { - type Error = String; - - fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { - match hdr_value.to_str() { - std::result::Result::Ok(value) => { - match ::from_str(value) { - std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), - std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into AllOfObject - {}", - value, err)) - } - }, - std::result::Result::Err(e) => std::result::Result::Err( - format!("Unable to convert header: {:?} to string: {}", - hdr_value, e)) - } - } -} - - #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct AllOfObject { @@ -299,8 +255,8 @@ impl std::str::FromStr for AllOfObject { if let Some(key) = key_result { match key { - "sampleProperty" => intermediate_rep.sample_property.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "sampleBasePropery" => intermediate_rep.sample_base_propery.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "sampleProperty" => intermediate_rep.sample_property.push(::from_str(val).map_err(|x| format!("{}", x))?), + "sampleBasePropery" => intermediate_rep.sample_base_propery.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing AllOfObject".to_string()) } } @@ -317,36 +273,34 @@ impl std::str::FromStr for AllOfObject { } } - - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for BaseAllOf - value: {} is invalid {}", + format!("Invalid header value for AllOfObject - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into BaseAllOf - {}", + format!("Unable to convert header value '{}' into AllOfObject - {}", value, err)) } }, @@ -418,7 +372,7 @@ impl std::str::FromStr for BaseAllOf { if let Some(key) = key_result { match key { - "sampleBasePropery" => intermediate_rep.sample_base_propery.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "sampleBasePropery" => intermediate_rep.sample_base_propery.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing BaseAllOf".to_string()) } } @@ -434,37 +388,34 @@ impl std::str::FromStr for BaseAllOf { } } - - -/// structured response -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for GetYamlResponse - value: {} is invalid {}", + format!("Invalid header value for BaseAllOf - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into GetYamlResponse - {}", + format!("Unable to convert header value '{}' into BaseAllOf - {}", value, err)) } }, @@ -476,6 +427,7 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +/// structured response #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct GetYamlResponse { @@ -537,7 +489,7 @@ impl std::str::FromStr for GetYamlResponse { if let Some(key) = key_result { match key { - "value" => intermediate_rep.value.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "value" => intermediate_rep.value.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing GetYamlResponse".to_string()) } } @@ -553,36 +505,34 @@ impl std::str::FromStr for GetYamlResponse { } } - - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for InlineObject - value: {} is invalid {}", + format!("Invalid header value for GetYamlResponse - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into InlineObject - {}", + format!("Unable to convert header value '{}' into GetYamlResponse - {}", value, err)) } }, @@ -663,8 +613,8 @@ impl std::str::FromStr for InlineObject { if let Some(key) = key_result { match key { - "id" => intermediate_rep.id.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "password" => intermediate_rep.password.push(String::from_str(val).map_err(|x| format!("{}", x))?), + "id" => intermediate_rep.id.push(::from_str(val).map_err(|x| format!("{}", x))?), + "password" => intermediate_rep.password.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing InlineObject".to_string()) } } @@ -681,37 +631,34 @@ impl std::str::FromStr for InlineObject { } } - - -/// An object of objects -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for ObjectOfObjects - value: {} is invalid {}", + format!("Invalid header value for InlineObject - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into ObjectOfObjects - {}", + format!("Unable to convert header value '{}' into InlineObject - {}", value, err)) } }, @@ -723,6 +670,7 @@ impl std::convert::TryFrom for header::IntoHeaderVal } +/// An object of objects #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct ObjectOfObjects { @@ -779,7 +727,7 @@ impl std::str::FromStr for ObjectOfObjects { if let Some(key) = key_result { match key { - "inner" => intermediate_rep.inner.push(models::ObjectOfObjectsInner::from_str(val).map_err(|x| format!("{}", x))?), + "inner" => intermediate_rep.inner.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing ObjectOfObjects".to_string()) } } @@ -795,36 +743,34 @@ impl std::str::FromStr for ObjectOfObjects { } } - - -// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom> for hyper::header::HeaderValue { +impl std::convert::TryFrom> for hyper::header::HeaderValue { type Error = String; - fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { let hdr_value = hdr_value.to_string(); match hyper::header::HeaderValue::from_str(&hdr_value) { std::result::Result::Ok(value) => std::result::Result::Ok(value), std::result::Result::Err(e) => std::result::Result::Err( - format!("Invalid header value for ObjectOfObjectsInner - value: {} is invalid {}", + format!("Invalid header value for ObjectOfObjects - value: {} is invalid {}", hdr_value, e)) } } } #[cfg(any(feature = "client", feature = "server"))] -impl std::convert::TryFrom for header::IntoHeaderValue { +impl std::convert::TryFrom for header::IntoHeaderValue { type Error = String; fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { match hdr_value.to_str() { std::result::Result::Ok(value) => { - match ::from_str(value) { + match ::from_str(value) { std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), std::result::Result::Err(err) => std::result::Result::Err( - format!("Unable to convert header value '{}' into ObjectOfObjectsInner - {}", + format!("Unable to convert header value '{}' into ObjectOfObjects - {}", value, err)) } }, @@ -905,8 +851,8 @@ impl std::str::FromStr for ObjectOfObjectsInner { if let Some(key) = key_result { match key { - "required_thing" => intermediate_rep.required_thing.push(String::from_str(val).map_err(|x| format!("{}", x))?), - "optional_thing" => intermediate_rep.optional_thing.push(isize::from_str(val).map_err(|x| format!("{}", x))?), + "required_thing" => intermediate_rep.required_thing.push(::from_str(val).map_err(|x| format!("{}", x))?), + "optional_thing" => intermediate_rep.optional_thing.push(::from_str(val).map_err(|x| format!("{}", x))?), _ => return std::result::Result::Err("Unexpected key while parsing ObjectOfObjectsInner".to_string()) } } @@ -923,4 +869,41 @@ impl std::str::FromStr for ObjectOfObjectsInner { } } +// Methods for converting between header::IntoHeaderValue and hyper::header::HeaderValue + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom> for hyper::header::HeaderValue { + type Error = String; + + fn try_from(hdr_value: header::IntoHeaderValue) -> std::result::Result { + let hdr_value = hdr_value.to_string(); + match hyper::header::HeaderValue::from_str(&hdr_value) { + std::result::Result::Ok(value) => std::result::Result::Ok(value), + std::result::Result::Err(e) => std::result::Result::Err( + format!("Invalid header value for ObjectOfObjectsInner - value: {} is invalid {}", + hdr_value, e)) + } + } +} + +#[cfg(any(feature = "client", feature = "server"))] +impl std::convert::TryFrom for header::IntoHeaderValue { + type Error = String; + + fn try_from(hdr_value: hyper::header::HeaderValue) -> std::result::Result { + match hdr_value.to_str() { + std::result::Result::Ok(value) => { + match ::from_str(value) { + std::result::Result::Ok(value) => std::result::Result::Ok(header::IntoHeaderValue(value)), + std::result::Result::Err(err) => std::result::Result::Err( + format!("Unable to convert header value '{}' into ObjectOfObjectsInner - {}", + value, err)) + } + }, + std::result::Result::Err(e) => std::result::Result::Err( + format!("Unable to convert header: {:?} to string: {}", + hdr_value, e)) + } + } +} diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java index 405b557aa80..e894f561fc6 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -379,7 +380,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -390,7 +391,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java index 6d17fb8c2c7..04e164b1c52 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; +import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -379,7 +380,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -390,7 +391,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index 05758282250..0962957d79f 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.Arrays; import java.util.UUID; import javax.validation.Valid; import javax.validation.constraints.*; @@ -378,7 +379,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -389,7 +390,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java index 405b557aa80..e894f561fc6 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -379,7 +380,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -390,7 +391,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java index 60f5bd280ce..80ea59cef11 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -381,7 +382,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -392,7 +393,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index 36a1cc3cd73..60247deff4c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.Arrays; import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; @@ -378,7 +379,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -389,7 +390,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java index 405b557aa80..e894f561fc6 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -379,7 +380,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -390,7 +391,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java index 405b557aa80..e894f561fc6 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -379,7 +380,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -390,7 +391,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java index 405b557aa80..e894f561fc6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -379,7 +380,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -390,7 +391,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java index 405b557aa80..e894f561fc6 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -379,7 +380,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -390,7 +391,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java index 405b557aa80..e894f561fc6 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -379,7 +380,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -390,7 +391,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java index 86a469d40a2..dedb11fe758 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.Arrays; import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; @@ -379,7 +380,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -390,7 +391,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java index 405b557aa80..e894f561fc6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -379,7 +380,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -390,7 +391,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java index 86a469d40a2..dedb11fe758 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.Arrays; import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; @@ -379,7 +380,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -390,7 +391,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java index 405b557aa80..e894f561fc6 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -379,7 +380,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -390,7 +391,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java index 405b557aa80..e894f561fc6 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -379,7 +380,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -390,7 +391,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java index d107fa6819c..d58e787c368 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -379,7 +380,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -390,7 +391,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java index 405b557aa80..e894f561fc6 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.Arrays; import java.util.UUID; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; @@ -379,7 +380,7 @@ public class FormatTest { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && + Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && @@ -390,7 +391,7 @@ public class FormatTest { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); } @Override diff --git a/website/src/dynamic/sponsors.yml b/website/src/dynamic/sponsors.yml index 68bcf586a17..6da3f67caf0 100644 --- a/website/src/dynamic/sponsors.yml +++ b/website/src/dynamic/sponsors.yml @@ -23,3 +23,8 @@ image: "img/companies/thales.jpg" infoLink: "https://cpl.thalesgroup.com/?utm_source=openapi_generator&utm_medium=official_website&utm_campaign=sponsor" bronze: true +- + caption: "Apideck" + image: "img/companies/apideck.jpg" + infoLink: "https://www.apideck.com/?utm_source=openapi_generator&utm_medium=official_website&utm_campaign=sponsor" + bronze: true diff --git a/website/static/img/companies/apideck.jpg b/website/static/img/companies/apideck.jpg new file mode 100644 index 00000000000..d0e2604c01c Binary files /dev/null and b/website/static/img/companies/apideck.jpg differ