From 2416fc0c7637db11058d8fa5938f95487a33b6da Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 20 Jan 2020 18:24:11 +0800 Subject: [PATCH 01/85] Add a link to a blog post in dev.to (#5052) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2804326fba8..dd5eb4ea2e3 100644 --- a/README.md +++ b/README.md @@ -721,6 +721,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2019-12-17 - [OpenAPI Generator で OAuth2 アクセストークン発行のコードまで生成してみる](https://www.techscore.com/blog/2019/12/17/openapi-generator-oauth2-accesstoken/) by [TECHSCORE](https://www.techscore.com/blog/) - 2019-12-23 - [Use Ada for Your Web Development](https://www.electronicdesign.com/technologies/embedded-revolution/article/21119177/use-ada-for-your-web-development) by [Stephane Carrez](https://github.com/stcarrez) - 2019-01-17 - [OpenAPI demo for Pulp 3.0 GA](https://www.youtube.com/watch?v=mFBP-M0ZPfw&t=178s) by [Pulp](https://www.youtube.com/channel/UCI43Ffs4VPDv7awXvvBJfRQ) at [Youtube](https://www.youtube.com/) +- 2019-01-19 - [Why document a REST API as code?](https://dev.to/rolfstreefkerk/why-document-a-rest-api-as-code-5e7p) by [Rolf Streefkerk](https://github.com/rpstreef) at [DEV Community](https://dev.to) ## [6 - About Us](#table-of-contents) From 7599531960a873022c78a998b2eea8749865fb4e Mon Sep 17 00:00:00 2001 From: Liam Martens Date: Mon, 20 Jan 2020 16:59:16 +0100 Subject: [PATCH 02/85] Fixed call of toISOString on a string type when using string type-mapping (#5057) --- .../src/main/resources/typescript-axios/apiInner.mustache | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 3f625aca23d..dc839d57cf7 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -115,7 +115,9 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur {{^isListContainer}} if ({{paramName}} !== undefined) { {{#isDateTime}} - localVarQueryParameter['{{baseName}}'] = ({{paramName}} as any).toISOString(); + localVarQueryParameter['{{baseName}}'] = ({{paramName}} as any instanceof Date) ? + ({{paramName}} as any).toISOString() : + {{paramName}}; {{/isDateTime}} {{^isDateTime}} {{#isDate}} From 2bc3c196e8e43d14cfc4e845b35c0c56df42326d Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Mon, 20 Jan 2020 16:37:15 -0500 Subject: [PATCH 03/85] [aspnetcore] Fix duplicate enums (#5059) * [aspnetcore] Fix duplicate generation of enums Fixes template issue where enums defined within a class were generated regardless of whether they were a complexType (externally defined "model") or an inlined enum. --- .../main/resources/aspnetcore/2.0/model.mustache | 16 +++++++++++++++- .../main/resources/aspnetcore/2.1/model.mustache | 16 +++++++++++++++- .../src/Org.OpenAPITools/Models/ApiResponse.cs | 2 +- .../src/Org.OpenAPITools/Models/Category.cs | 2 +- .../src/Org.OpenAPITools/Models/Order.cs | 3 ++- .../src/Org.OpenAPITools/Models/Pet.cs | 3 ++- .../src/Org.OpenAPITools/Models/Tag.cs | 2 +- .../src/Org.OpenAPITools/Models/User.cs | 2 +- 8 files changed, 38 insertions(+), 8 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache index 101e95cbfc4..44218b0a889 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache @@ -16,7 +16,20 @@ namespace {{packageName}}.Models /// [DataContract] public partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}> - { {{#vars}}{{#isEnum}}{{>enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}}{{>enumClass}}{{/items}}{{/items.isEnum}} + { + {{#vars}} + {{#items.isEnum}} + {{#items}} + {{^complexType}} +{{>enumClass}} + {{/complexType}} + {{/items}} + {{/items.isEnum}} + {{#isEnum}} + {{^complexType}} +{{>enumClass}} + {{/complexType}} + {{/isEnum}} /// /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} /// @@ -34,6 +47,7 @@ namespace {{packageName}}.Models public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} {{/isEnum}} {{#hasMore}} + {{/hasMore}} {{/vars}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache index fcb2200d5b7..899ccf61d9d 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache @@ -18,7 +18,20 @@ namespace {{modelPackage}} /// [DataContract] public {{#modelClassModifier}}{{modelClassModifier}} {{/modelClassModifier}}class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}> - { {{#vars}}{{#isEnum}}{{^isModel}}{{>enumClass}}{{/isModel}}{{/isEnum}}{{#items.isEnum}}{{^isModel}}{{#items}}{{>enumClass}}{{/items}}{{/isModel}}{{/items.isEnum}} + { + {{#vars}} + {{#items.isEnum}} + {{#items}} + {{^complexType}} +{{>enumClass}} + {{/complexType}} + {{/items}} + {{/items.isEnum}} + {{#isEnum}} + {{^complexType}} +{{>enumClass}} + {{/complexType}} + {{/isEnum}} /// /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} /// {{#description}} @@ -37,6 +50,7 @@ namespace {{modelPackage}} public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} {{/isEnum}} {{#hasMore}} + {{/hasMore}} {{/vars}} diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/ApiResponse.cs index 5aa1a66468d..ef3413980ea 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/ApiResponse.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -25,7 +25,7 @@ namespace Org.OpenAPITools.Models /// [DataContract] public partial class ApiResponse : IEquatable - { + { /// /// Gets or Sets Code /// diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Category.cs index 79229996094..6ac6a181baf 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Category.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Category.cs @@ -25,7 +25,7 @@ namespace Org.OpenAPITools.Models /// [DataContract] public partial class Category : IEquatable - { + { /// /// Gets or Sets Id /// diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs index a1715221ba2..77a4c75a1b1 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs @@ -25,7 +25,7 @@ namespace Org.OpenAPITools.Models /// [DataContract] public partial class Order : IEquatable - { + { /// /// Gets or Sets Id /// @@ -50,6 +50,7 @@ namespace Org.OpenAPITools.Models [DataMember(Name="shipDate", EmitDefaultValue=false)] public DateTime ShipDate { get; set; } + /// /// Order Status /// diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs index cb8a2001f17..a814c6e1edf 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs @@ -25,7 +25,7 @@ namespace Org.OpenAPITools.Models /// [DataContract] public partial class Pet : IEquatable - { + { /// /// Gets or Sets Id /// @@ -58,6 +58,7 @@ namespace Org.OpenAPITools.Models [DataMember(Name="tags", EmitDefaultValue=false)] public List Tags { get; set; } + /// /// pet status in the store /// diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Tag.cs index 223b3ac3af5..f0a131f617c 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Tag.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Tag.cs @@ -25,7 +25,7 @@ namespace Org.OpenAPITools.Models /// [DataContract] public partial class Tag : IEquatable - { + { /// /// Gets or Sets Id /// diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/User.cs index dc5595815cd..3c8a18d63cf 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/User.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/User.cs @@ -25,7 +25,7 @@ namespace Org.OpenAPITools.Models /// [DataContract] public partial class User : IEquatable - { + { /// /// Gets or Sets Id /// From 6af27d52caf8f61351ac761c8dc5f69d6fc7bc91 Mon Sep 17 00:00:00 2001 From: "Mateusz Szychowski (Muttley)" Date: Tue, 21 Jan 2020 00:47:26 +0100 Subject: [PATCH 04/85] [C++][Pistache] Rename value holder to lower chance of collision with parameter name (#4948) * [C++][Pistache] Rename value holder to lower chance of collision with parameter name * [C++][Pistache] Update Petstore sample --- .../cpp-pistache-server/api-source.mustache | 6 +++--- .../petstore/cpp-pistache/.openapi-generator/VERSION | 2 +- samples/server/petstore/cpp-pistache/api/PetApi.cpp | 12 ++++++------ samples/server/petstore/cpp-pistache/api/UserApi.cpp | 12 ++++++------ 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache index 31afee650ff..71069bbf80a 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache @@ -54,9 +54,9 @@ void {{classname}}::{{operationIdSnakeCase}}_handler(const Pistache::Rest::Reque auto {{paramName}}Query = request.query().get("{{baseName}}"); Pistache::Optional<{{^isContainer}}{{dataType}}{{/isContainer}}{{#isListContainer}}std::vector<{{items.baseType}}>{{/isListContainer}}> {{paramName}}; if(!{{paramName}}Query.isEmpty()){ - {{^isContainer}}{{dataType}}{{/isContainer}}{{#isListContainer}}std::vector<{{items.baseType}}>{{/isListContainer}} value; - if(fromStringValue({{paramName}}Query.get(), value)){ - {{paramName}} = Pistache::Some(value); + {{^isContainer}}{{dataType}}{{/isContainer}}{{#isListContainer}}std::vector<{{items.baseType}}>{{/isListContainer}} valueQuery_instance; + if(fromStringValue({{paramName}}Query.get(), valueQuery_instance)){ + {{paramName}} = Pistache::Some(valueQuery_instance); } } {{/queryParams}} diff --git a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION index e4955748d3e..58592f031f6 100644 --- a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.2-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-pistache/api/PetApi.cpp b/samples/server/petstore/cpp-pistache/api/PetApi.cpp index 32d47377c65..e7a00ca6515 100644 --- a/samples/server/petstore/cpp-pistache/api/PetApi.cpp +++ b/samples/server/petstore/cpp-pistache/api/PetApi.cpp @@ -91,9 +91,9 @@ void PetApi::find_pets_by_status_handler(const Pistache::Rest::Request &request, auto statusQuery = request.query().get("status"); Pistache::Optional> status; if(!statusQuery.isEmpty()){ - std::vector value; - if(fromStringValue(statusQuery.get(), value)){ - status = Pistache::Some(value); + std::vector valueQuery_instance; + if(fromStringValue(statusQuery.get(), valueQuery_instance)){ + status = Pistache::Some(valueQuery_instance); } } @@ -116,9 +116,9 @@ void PetApi::find_pets_by_tags_handler(const Pistache::Rest::Request &request, P auto tagsQuery = request.query().get("tags"); Pistache::Optional> tags; if(!tagsQuery.isEmpty()){ - std::vector value; - if(fromStringValue(tagsQuery.get(), value)){ - tags = Pistache::Some(value); + std::vector valueQuery_instance; + if(fromStringValue(tagsQuery.get(), valueQuery_instance)){ + tags = Pistache::Some(valueQuery_instance); } } diff --git a/samples/server/petstore/cpp-pistache/api/UserApi.cpp b/samples/server/petstore/cpp-pistache/api/UserApi.cpp index 51889d55043..d0cf8924244 100644 --- a/samples/server/petstore/cpp-pistache/api/UserApi.cpp +++ b/samples/server/petstore/cpp-pistache/api/UserApi.cpp @@ -143,17 +143,17 @@ void UserApi::login_user_handler(const Pistache::Rest::Request &request, Pistach auto usernameQuery = request.query().get("username"); Pistache::Optional username; if(!usernameQuery.isEmpty()){ - std::string value; - if(fromStringValue(usernameQuery.get(), value)){ - username = Pistache::Some(value); + std::string valueQuery_instance; + if(fromStringValue(usernameQuery.get(), valueQuery_instance)){ + username = Pistache::Some(valueQuery_instance); } } auto passwordQuery = request.query().get("password"); Pistache::Optional password; if(!passwordQuery.isEmpty()){ - std::string value; - if(fromStringValue(passwordQuery.get(), value)){ - password = Pistache::Some(value); + std::string valueQuery_instance; + if(fromStringValue(passwordQuery.get(), valueQuery_instance)){ + password = Pistache::Some(valueQuery_instance); } } From ad009180dda867f37e6809c779ae829c167c4425 Mon Sep 17 00:00:00 2001 From: Sai Giridhar P Date: Tue, 21 Jan 2020 08:17:05 +0530 Subject: [PATCH 05/85] fix(r): Adding repository url (#5056) --- .../openapi-generator/src/main/resources/r/description.mustache | 2 ++ samples/client/petstore/R/DESCRIPTION | 2 ++ 2 files changed, 4 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/r/description.mustache b/modules/openapi-generator/src/main/resources/r/description.mustache index 129c6fc828e..3bd9db79ee4 100644 --- a/modules/openapi-generator/src/main/resources/r/description.mustache +++ b/modules/openapi-generator/src/main/resources/r/description.mustache @@ -3,6 +3,8 @@ Title: R Package Client for {{{appName}}} Version: {{packageVersion}} Authors@R: person("{{#infoName}}{{infoName}}{{/infoName}}{{^infoName}}OpenAPI Generator community{{/infoName}}", email = "{{#infoEmail}}{{infoEmail}}{{/infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}", role = c("aut", "cre")) Description: {{{appDescription}}}{{^appDescription}}R Package Client for {{{appName}}}{{/appDescription}} +URL: https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}} +BugReports: https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}/issues Depends: R (>= 3.3) Encoding: UTF-8 License: {{#licenseInfo}}{{licenseInfo}}{{/licenseInfo}}{{^licenseInfo}}Unlicense{{/licenseInfo}} diff --git a/samples/client/petstore/R/DESCRIPTION b/samples/client/petstore/R/DESCRIPTION index 3f8ad457487..481820f8457 100644 --- a/samples/client/petstore/R/DESCRIPTION +++ b/samples/client/petstore/R/DESCRIPTION @@ -3,6 +3,8 @@ Title: R Package Client for OpenAPI Petstore Version: 1.0.0 Authors@R: person("OpenAPI Generator community", email = "team@openapitools.org", role = c("aut", "cre")) Description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +URL: https://github.com/GIT_USER_ID/GIT_REPO_ID +BugReports: https://github.com/GIT_USER_ID/GIT_REPO_ID/issues Depends: R (>= 3.3) Encoding: UTF-8 License: Apache-2.0 From 6f5f16aaee594654f835a71d0bd6b2cb2033c064 Mon Sep 17 00:00:00 2001 From: Bruno Clermont Date: Tue, 21 Jan 2020 13:40:32 +0800 Subject: [PATCH 06/85] Add company using generator (#5064) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index dd5eb4ea2e3..6a5a81e8966 100644 --- a/README.md +++ b/README.md @@ -622,6 +622,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [RedHat](https://www.redhat.com) - [RepreZen API Studio](https://www.reprezen.com/swagger-openapi-code-generation-api-first-microservices-enterprise-development) - [REST United](https://restunited.com) +- [Robotinfra](https://www.robotinfra.com) - [Sony Interactive Entertainment](https://www.sie.com/en/index.html) - [Stingray](http://www.stingray.com) - [Suva](https://www.suva.ch/) From ff7203875f33a86f5e623cf79dec9079100fedef Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Tue, 21 Jan 2020 01:32:38 -0800 Subject: [PATCH 07/85] fix compilation error in generated go code (#5061) --- .../main/resources/go-experimental/api.mustache | 16 +++++++++------- .../go-experimental/go-petstore/api_fake.go | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/go-experimental/api.mustache b/modules/openapi-generator/src/main/resources/go-experimental/api.mustache index 7d9baf079c2..c053e99c0d8 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/api.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/api.mustache @@ -127,14 +127,16 @@ func (r api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnT {{#queryParams}} {{#required}} {{#isCollectionFormatMulti}} - t := *r.{{paramName}} - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + { + t := *r.{{paramName}} + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + } + } else { + localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) } - } else { - localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) } {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} diff --git a/samples/client/petstore/go-experimental/go-petstore/api_fake.go b/samples/client/petstore/go-experimental/go-petstore/api_fake.go index 0a9b9b5f743..6a39cfa04ce 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_fake.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_fake.go @@ -1757,14 +1757,16 @@ func (r apiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Respo localVarQueryParams.Add("ioutil", parameterToString(*r.ioutil, "csv")) localVarQueryParams.Add("http", parameterToString(*r.http, "space")) localVarQueryParams.Add("url", parameterToString(*r.url, "csv")) - t := *r.context - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + { + t := *r.context + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("context", parameterToString(t, "multi")) } - } else { - localVarQueryParams.Add("context", parameterToString(t, "multi")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} From a1d21f6d3aed561145a2cbe41ed07e03eec208a4 Mon Sep 17 00:00:00 2001 From: sunn <33183834+etherealjoy@users.noreply.github.com> Date: Tue, 21 Jan 2020 12:11:43 +0100 Subject: [PATCH 08/85] =?UTF-8?q?[C++]=20[Qt5]Add=20support=20for=20respon?= =?UTF-8?q?se=20compression=20and=20add=20response=20body=20to=20error=20s?= =?UTF-8?q?=E2=80=A6=20(#5060)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add support for response compression and add response body to error string * Improve robustness while parsing quality and compression levels --- docs/generators/cpp-qt5-client.md | 1 + docs/generators/cpp-qt5-qhttpengine-server.md | 1 + .../languages/CppQt5AbstractCodegen.java | 13 ++++ .../cpp-qt5-client/CMakeLists.txt.mustache | 5 +- .../cpp-qt5-client/HttpRequest.cpp.mustache | 61 +++++++++++++++++-- .../cpp-qt5-client/HttpRequest.h.mustache | 5 +- .../resources/cpp-qt5-client/Project.mustache | 2 +- .../cpp-qt5-client/api-body.mustache | 9 ++- .../cpp-qt5-client/api-header.mustache | 2 + .../cpp-qt5/.openapi-generator/VERSION | 2 +- .../cpp-qt5/client/PFXHttpRequest.cpp | 34 +++++++++-- .../petstore/cpp-qt5/client/PFXHttpRequest.h | 5 +- .../petstore/cpp-qt5/client/PFXPetApi.cpp | 23 ++++++- .../petstore/cpp-qt5/client/PFXPetApi.h | 2 + .../petstore/cpp-qt5/client/PFXStoreApi.cpp | 15 ++++- .../petstore/cpp-qt5/client/PFXStoreApi.h | 2 + .../petstore/cpp-qt5/client/PFXUserApi.cpp | 23 ++++++- .../petstore/cpp-qt5/client/PFXUserApi.h | 2 + .../petstore/cpp-qt5/client/PFXclient.pri | 2 +- 19 files changed, 189 insertions(+), 20 deletions(-) diff --git a/docs/generators/cpp-qt5-client.md b/docs/generators/cpp-qt5-client.md index 5a5ec0f7896..5677ef13d08 100644 --- a/docs/generators/cpp-qt5-client.md +++ b/docs/generators/cpp-qt5-client.md @@ -6,6 +6,7 @@ sidebar_label: cpp-qt5-client | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|contentCompression|Enable Compressed Content Encoding for requests and responses| |false| |cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |modelNamePrefix|Prefix that will be prepended to all model names.| |OAI| diff --git a/docs/generators/cpp-qt5-qhttpengine-server.md b/docs/generators/cpp-qt5-qhttpengine-server.md index fd32082fad7..4d9518c2bea 100644 --- a/docs/generators/cpp-qt5-qhttpengine-server.md +++ b/docs/generators/cpp-qt5-qhttpengine-server.md @@ -6,6 +6,7 @@ sidebar_label: cpp-qt5-qhttpengine-server | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|contentCompression|Enable Compressed Content Encoding for requests and responses| |false| |cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |modelNamePrefix|Prefix that will be prepended to all model names.| |OAI| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5AbstractCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5AbstractCodegen.java index 22150b58bfd..292a41fdc3e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5AbstractCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5AbstractCodegen.java @@ -21,10 +21,13 @@ public class CppQt5AbstractCodegen extends AbstractCppCodegen implements Codegen protected String apiVersion = "1.0.0"; protected static final String CPP_NAMESPACE = "cppNamespace"; protected static final String CPP_NAMESPACE_DESC = "C++ namespace (convention: name::space::for::api)."; + protected static final String CONTENT_COMPRESSION_ENABLED = "contentCompression"; + protected static final String CONTENT_COMPRESSION_ENABLED_DESC = "Enable Compressed Content Encoding for requests and responses"; protected Set foundationClasses = new HashSet(); protected String cppNamespace = "OpenAPI"; protected Map namespaces = new HashMap(); protected Set systemIncludes = new HashSet(); + protected boolean isContentCompressionEnabled = false; protected Set nonFrameworkPrimitives = new HashSet(); @@ -56,6 +59,7 @@ public class CppQt5AbstractCodegen extends AbstractCppCodegen implements Codegen // CLI options addOption(CPP_NAMESPACE, CPP_NAMESPACE_DESC, this.cppNamespace); addOption(CodegenConstants.MODEL_NAME_PREFIX, CodegenConstants.MODEL_NAME_PREFIX_DESC, this.modelNamePrefix); + addSwitch(CONTENT_COMPRESSION_ENABLED, CONTENT_COMPRESSION_ENABLED_DESC, this.isContentCompressionEnabled); /* * Additional Properties. These values can be passed to the templates and @@ -137,6 +141,11 @@ public class CppQt5AbstractCodegen extends AbstractCppCodegen implements Codegen typeMapping.put("object", modelNamePrefix + "Object"); additionalProperties().put("prefix", modelNamePrefix); } + if (additionalProperties.containsKey(CONTENT_COMPRESSION_ENABLED)) { + setContentCompressionEnabled(convertPropertyToBooleanAndWriteBack(CONTENT_COMPRESSION_ENABLED)); + } else { + additionalProperties.put(CONTENT_COMPRESSION_ENABLED, isContentCompressionEnabled); + } } @Override @@ -379,4 +388,8 @@ public class CppQt5AbstractCodegen extends AbstractCppCodegen implements Codegen } return included; } + + public void setContentCompressionEnabled(boolean flag) { + this.isContentCompressionEnabled = flag; + } } diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/CMakeLists.txt.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/CMakeLists.txt.mustache index c53100cca69..74125fc936e 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/CMakeLists.txt.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/CMakeLists.txt.mustache @@ -8,14 +8,15 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wno-unused-variable") find_package(Qt5Core REQUIRED) -find_package(Qt5Network REQUIRED) +find_package(Qt5Network REQUIRED){{#contentCompression}} +find_package(ZLIB REQUIRED){{/contentCompression}} file(GLOB SRCS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ) add_library(${PROJECT_NAME} ${SRCS}) -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network ssl crypto) +target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network ssl crypto{{#contentCompression}} ${ZLIB_LIBRARIES}{{/contentCompression}}) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) 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 a28bbad0018..933bb0c1698 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,8 @@ #include #include #include -#include +#include {{#contentCompression}} +#include {{/contentCompression}} #include "{{prefix}}HttpRequest.h" @@ -95,6 +96,10 @@ void {{prefix}}HttpRequestWorker::setWorkingDirectory(const QString &path) { } } +void {{prefix}}HttpRequestWorker::setCompressionEnabled(bool enable) { + isCompressionEnabled = enable; +} + QString {{prefix}}HttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) { // result structure follows RFC 5987 bool need_utf_encoding = false; @@ -303,6 +308,10 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) { request.setHeader(QNetworkRequest::ContentTypeHeader, "multipart/form-data; boundary=" + boundary); } + if(isCompressionEnabled){ + request.setRawHeader("Accept-Encoding", "deflate, gzip"); + } + if (input->http_method == "GET") { reply = manager->get(request); } else if (input->http_method == "POST") { @@ -332,15 +341,14 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) { void {{prefix}}HttpRequestWorker::on_manager_finished(QNetworkReply *reply) { error_type = reply->error(); - response = reply->readAll(); error_str = reply->errorString(); if (reply->rawHeaderPairs().count() > 0) { for (const auto &item : reply->rawHeaderPairs()) { headers.insert(item.first, item.second); } } + process_response(reply); reply->deleteLater(); - process_form_response(); emit on_execution_finished(this); } @@ -354,7 +362,7 @@ void {{prefix}}HttpRequestWorker::on_manager_timeout(QNetworkReply *reply) { emit on_execution_finished(this); } -void {{prefix}}HttpRequestWorker::process_form_response() { +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 contentType = @@ -368,18 +376,61 @@ void {{prefix}}HttpRequestWorker::process_form_response() { } } {{prefix}}HttpFileElement felement; - felement.saveToFile(QString(), workingDirectory + QDir::separator() + filename, filename, contentType, response.data()); + felement.saveToFile(QString(), workingDirectory + QDir::separator() + filename, filename, contentType, reply->readAll()); files.insert(filename, felement); } } else if (getResponseHeaders().contains(QString("Content-Type"))) { auto contentType = getResponseHeaders().value(QString("Content-Type").toUtf8()).split(QString(";"), QString::SkipEmptyParts); if ((contentType.count() > 0) && (contentType.first() == QString("multipart/form-data"))) { + // TODO : Handle Multipart responses } else { + if(headers.contains("Content-Encoding")){ + auto encoding = headers.value("Content-Encoding").split(QString(";"), QString::SkipEmptyParts); + if(encoding.count() > 0){ + auto compressionTypes = encoding.first().split(',', QString::SkipEmptyParts); + if(compressionTypes.contains("gzip", Qt::CaseInsensitive) || compressionTypes.contains("deflate", Qt::CaseInsensitive)){ + response = decompress(reply->readAll()); + } + } + } + else { + response = reply->readAll(); + } } } } +QByteArray {{prefix}}HttpRequestWorker::decompress(const QByteArray& data){ + QByteArray result; + bool sts = false;{{#contentCompression}} + do{ + z_stream strm{}; + static const int CHUNK_SIZE = 2048; + char out[CHUNK_SIZE]; + if (data.size() <= 4) { + break; + } + strm.avail_in = data.size(); + strm.next_in = (Bytef*)(data.data()); + if(Z_OK != inflateInit2(&strm, 15 + 32)){ + break; + } + do { + sts = false; + strm.avail_out = CHUNK_SIZE; + strm.next_out = (Bytef*)(out); + if(inflate(&strm, Z_NO_FLUSH) < Z_OK){ + break; + } + result.append(out, CHUNK_SIZE - strm.avail_out); + sts = true; + } while (strm.avail_out == 0); + inflateEnd(&strm); + } while(false);{{/contentCompression}} + return sts ? result : QByteArray(); +} + QSslConfiguration *{{prefix}}HttpRequestWorker::sslDefaultConfiguration; {{#cppNamespaceDeclarations}} 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 32ee8a2145d..9df29d4f24b 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 @@ -63,6 +63,7 @@ public: void setWorkingDirectory(const QString &path); {{prefix}}HttpFileElement getHttpFileElement(const QString &fieldname = QString()); QByteArray *getMultiPartField(const QString &fieldname = QString()); + void setCompressionEnabled(bool enable); signals: void on_execution_finished({{prefix}}HttpRequestWorker *worker); @@ -73,8 +74,10 @@ private: QMap multiPartFields; QString workingDirectory; int _timeOut; + bool isCompressionEnabled; void on_manager_timeout(QNetworkReply *reply); - void process_form_response(); + void process_response(QNetworkReply *reply); + QByteArray decompress(const QByteArray& data); private slots: void on_manager_finished(QNetworkReply *reply); }; diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/Project.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/Project.mustache index 854841518e2..6b989b8c00e 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/Project.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/Project.mustache @@ -40,5 +40,5 @@ SOURCES += \ # Others $${PWD}/{{prefix}}Helpers.cpp \ $${PWD}/{{prefix}}HttpRequest.cpp \ - $${PWD}/{{prefix}}HttpFileElement.cpp + $${PWD}/{{prefix}}HttpFileElement.cpp diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache index 7f24ba64a82..451e05b6a18 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 @@ -14,7 +14,8 @@ namespace {{this}} { _host(host), _port(port), _basePath(basePath), - _timeOut(timeOut) {} + _timeOut(timeOut), + _compress(false) {} {{classname}}::~{{classname}}() { } @@ -47,6 +48,10 @@ void {{classname}}::addHeaders(const QString &key, const QString &value) { defaultHeaders.insert(key, value); } +void {{classname}}::enableContentCompression() { + _compress = true; +} + {{#operations}} {{#operation}} void {{classname}}::{{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { @@ -109,6 +114,7 @@ void {{classname}}::{{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName {{prefix}}HttpRequestWorker *worker = new {{prefix}}HttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); {{prefix}}HttpRequestInput input(fullPath, "{{httpMethod}}"); {{#formParams}}{{^isFile}} input.add_var("{{baseName}}", ::{{cppNamespace}}::toStringValue({{paramName}}));{{/isFile}}{{#isFile}} @@ -144,6 +150,7 @@ void {{classname}}::{{nickname}}Callback({{prefix}}HttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } {{#returnType}} {{#isListContainer}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache index 8c877912e17..07a33698b58 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache @@ -27,6 +27,7 @@ public: void setTimeOut(const int timeOut); void setWorkingDirectory(const QString &path); void addHeaders(const QString &key, const QString &value); + void enableContentCompression(); {{#operations}}{{#operation}} void {{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/operation}}{{/operations}} @@ -37,6 +38,7 @@ private: int _timeOut; QString _workingDirectory; QMap defaultHeaders; + bool _compress; {{#operations}}{{#operation}} void {{nickname}}Callback({{prefix}}HttpRequestWorker *worker);{{/operation}}{{/operations}} diff --git a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION index e4955748d3e..58592f031f6 100644 --- a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.2-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp index 30f1c04800c..27152077769 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp @@ -103,6 +103,10 @@ void PFXHttpRequestWorker::setWorkingDirectory(const QString &path) { } } +void PFXHttpRequestWorker::setCompressionEnabled(bool enable) { + isCompressionEnabled = enable; +} + QString PFXHttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) { // result structure follows RFC 5987 bool need_utf_encoding = false; @@ -311,6 +315,10 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) { request.setHeader(QNetworkRequest::ContentTypeHeader, "multipart/form-data; boundary=" + boundary); } + if(isCompressionEnabled){ + request.setRawHeader("Accept-Encoding", "deflate, gzip"); + } + if (input->http_method == "GET") { reply = manager->get(request); } else if (input->http_method == "POST") { @@ -340,15 +348,14 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) { void PFXHttpRequestWorker::on_manager_finished(QNetworkReply *reply) { error_type = reply->error(); - response = reply->readAll(); error_str = reply->errorString(); if (reply->rawHeaderPairs().count() > 0) { for (const auto &item : reply->rawHeaderPairs()) { headers.insert(item.first, item.second); } } + process_response(reply); reply->deleteLater(); - process_form_response(); emit on_execution_finished(this); } @@ -362,7 +369,7 @@ void PFXHttpRequestWorker::on_manager_timeout(QNetworkReply *reply) { emit on_execution_finished(this); } -void PFXHttpRequestWorker::process_form_response() { +void PFXHttpRequestWorker::process_response(QNetworkReply *reply) { if (getResponseHeaders().contains(QString("Content-Disposition"))) { auto contentDisposition = getResponseHeaders().value(QString("Content-Disposition").toUtf8()).split(QString(";"), QString::SkipEmptyParts); auto contentType = @@ -376,18 +383,37 @@ void PFXHttpRequestWorker::process_form_response() { } } PFXHttpFileElement felement; - felement.saveToFile(QString(), workingDirectory + QDir::separator() + filename, filename, contentType, response.data()); + felement.saveToFile(QString(), workingDirectory + QDir::separator() + filename, filename, contentType, reply->readAll()); files.insert(filename, felement); } } else if (getResponseHeaders().contains(QString("Content-Type"))) { auto contentType = getResponseHeaders().value(QString("Content-Type").toUtf8()).split(QString(";"), QString::SkipEmptyParts); if ((contentType.count() > 0) && (contentType.first() == QString("multipart/form-data"))) { + // TODO : Handle Multipart responses } else { + if(headers.contains("Content-Encoding")){ + auto encoding = headers.value("Content-Encoding").split(QString(";"), QString::SkipEmptyParts); + if(encoding.count() > 0){ + auto compressionTypes = encoding.first().split(',', QString::SkipEmptyParts); + if(compressionTypes.contains("gzip", Qt::CaseInsensitive) || compressionTypes.contains("deflate", Qt::CaseInsensitive)){ + response = decompress(reply->readAll()); + } + } + } + else { + response = reply->readAll(); + } } } } +QByteArray PFXHttpRequestWorker::decompress(const QByteArray& data){ + QByteArray result; + bool sts = false; + return sts ? result : QByteArray(); +} + QSslConfiguration *PFXHttpRequestWorker::sslDefaultConfiguration; } // namespace test_namespace diff --git a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h index 6b354142d28..c7f4c2a7f0b 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h +++ b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h @@ -71,6 +71,7 @@ public: void setWorkingDirectory(const QString &path); PFXHttpFileElement getHttpFileElement(const QString &fieldname = QString()); QByteArray *getMultiPartField(const QString &fieldname = QString()); + void setCompressionEnabled(bool enable); signals: void on_execution_finished(PFXHttpRequestWorker *worker); @@ -81,8 +82,10 @@ private: QMap multiPartFields; QString workingDirectory; int _timeOut; + bool isCompressionEnabled; void on_manager_timeout(QNetworkReply *reply); - void process_form_response(); + void process_response(QNetworkReply *reply); + QByteArray decompress(const QByteArray& data); private slots: void on_manager_finished(QNetworkReply *reply); }; diff --git a/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp index 9ac2f626458..9230379520c 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp @@ -22,7 +22,8 @@ PFXPetApi::PFXPetApi(const QString &scheme, const QString &host, int port, const _host(host), _port(port), _basePath(basePath), - _timeOut(timeOut) {} + _timeOut(timeOut), + _compress(false) {} PFXPetApi::~PFXPetApi() { } @@ -55,6 +56,10 @@ void PFXPetApi::addHeaders(const QString &key, const QString &value) { defaultHeaders.insert(key, value); } +void PFXPetApi::enableContentCompression() { + _compress = true; +} + void PFXPetApi::addPet(const PFXPet &body) { QString fullPath = QString("%1://%2%3%4%5") .arg(_scheme) @@ -66,6 +71,7 @@ void PFXPetApi::addPet(const PFXPet &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); QString output = body.asJson(); @@ -87,6 +93,7 @@ void PFXPetApi::addPetCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -113,6 +120,7 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const QString &api_key) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "DELETE"); if (api_key != nullptr) { @@ -135,6 +143,7 @@ void PFXPetApi::deletePetCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -196,6 +205,7 @@ void PFXPetApi::findPetsByStatus(const QList &status) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -214,6 +224,7 @@ void PFXPetApi::findPetsByStatusCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } QList output; QString json(worker->response); @@ -285,6 +296,7 @@ void PFXPetApi::findPetsByTags(const QList &tags) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -303,6 +315,7 @@ void PFXPetApi::findPetsByTagsCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } QList output; QString json(worker->response); @@ -339,6 +352,7 @@ void PFXPetApi::getPetById(const qint64 &pet_id) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -357,6 +371,7 @@ void PFXPetApi::getPetByIdCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } PFXPet output(QString(worker->response)); worker->deleteLater(); @@ -381,6 +396,7 @@ void PFXPetApi::updatePet(const PFXPet &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "PUT"); QString output = body.asJson(); @@ -402,6 +418,7 @@ void PFXPetApi::updatePetCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -428,6 +445,7 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const QString &name, con PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); input.add_var("name", ::test_namespace::toStringValue(name)); @@ -448,6 +466,7 @@ void PFXPetApi::updatePetWithFormCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -474,6 +493,7 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const QString &additional_metad PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); input.add_var("additionalMetadata", ::test_namespace::toStringValue(additional_metadata)); @@ -494,6 +514,7 @@ void PFXPetApi::uploadFileCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } PFXApiResponse output(QString(worker->response)); worker->deleteLater(); diff --git a/samples/client/petstore/cpp-qt5/client/PFXPetApi.h b/samples/client/petstore/cpp-qt5/client/PFXPetApi.h index f55675845c1..7d2c00175c5 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXPetApi.h +++ b/samples/client/petstore/cpp-qt5/client/PFXPetApi.h @@ -37,6 +37,7 @@ public: void setTimeOut(const int timeOut); void setWorkingDirectory(const QString &path); void addHeaders(const QString &key, const QString &value); + void enableContentCompression(); void addPet(const PFXPet &body); void deletePet(const qint64 &pet_id, const QString &api_key); @@ -54,6 +55,7 @@ private: int _timeOut; QString _workingDirectory; QMap defaultHeaders; + bool _compress; void addPetCallback(PFXHttpRequestWorker *worker); void deletePetCallback(PFXHttpRequestWorker *worker); diff --git a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp index f16902079de..05ee1622f0b 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp @@ -22,7 +22,8 @@ PFXStoreApi::PFXStoreApi(const QString &scheme, const QString &host, int port, c _host(host), _port(port), _basePath(basePath), - _timeOut(timeOut) {} + _timeOut(timeOut), + _compress(false) {} PFXStoreApi::~PFXStoreApi() { } @@ -55,6 +56,10 @@ void PFXStoreApi::addHeaders(const QString &key, const QString &value) { defaultHeaders.insert(key, value); } +void PFXStoreApi::enableContentCompression() { + _compress = true; +} + void PFXStoreApi::deleteOrder(const QString &order_id) { QString fullPath = QString("%1://%2%3%4%5") .arg(_scheme) @@ -69,6 +74,7 @@ void PFXStoreApi::deleteOrder(const QString &order_id) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "DELETE"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -87,6 +93,7 @@ void PFXStoreApi::deleteOrderCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -110,6 +117,7 @@ void PFXStoreApi::getInventory() { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -128,6 +136,7 @@ void PFXStoreApi::getInventoryCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } QMap output; QString json(worker->response); @@ -164,6 +173,7 @@ void PFXStoreApi::getOrderById(const qint64 &order_id) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -182,6 +192,7 @@ void PFXStoreApi::getOrderByIdCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } PFXOrder output(QString(worker->response)); worker->deleteLater(); @@ -206,6 +217,7 @@ void PFXStoreApi::placeOrder(const PFXOrder &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); QString output = body.asJson(); @@ -227,6 +239,7 @@ void PFXStoreApi::placeOrderCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } PFXOrder output(QString(worker->response)); worker->deleteLater(); diff --git a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h index d0dec36dad0..b61fc684b28 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h +++ b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h @@ -36,6 +36,7 @@ public: void setTimeOut(const int timeOut); void setWorkingDirectory(const QString &path); void addHeaders(const QString &key, const QString &value); + void enableContentCompression(); void deleteOrder(const QString &order_id); void getInventory(); @@ -49,6 +50,7 @@ private: int _timeOut; QString _workingDirectory; QMap defaultHeaders; + bool _compress; void deleteOrderCallback(PFXHttpRequestWorker *worker); void getInventoryCallback(PFXHttpRequestWorker *worker); diff --git a/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp index b2d2b6aa2fe..44d8c2dee1f 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp @@ -22,7 +22,8 @@ PFXUserApi::PFXUserApi(const QString &scheme, const QString &host, int port, con _host(host), _port(port), _basePath(basePath), - _timeOut(timeOut) {} + _timeOut(timeOut), + _compress(false) {} PFXUserApi::~PFXUserApi() { } @@ -55,6 +56,10 @@ void PFXUserApi::addHeaders(const QString &key, const QString &value) { defaultHeaders.insert(key, value); } +void PFXUserApi::enableContentCompression() { + _compress = true; +} + void PFXUserApi::createUser(const PFXUser &body) { QString fullPath = QString("%1://%2%3%4%5") .arg(_scheme) @@ -66,6 +71,7 @@ void PFXUserApi::createUser(const PFXUser &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); QString output = body.asJson(); @@ -87,6 +93,7 @@ void PFXUserApi::createUserCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -110,6 +117,7 @@ void PFXUserApi::createUsersWithArrayInput(const QList &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); QJsonDocument doc(::test_namespace::toJsonValue(body).toArray()); @@ -132,6 +140,7 @@ void PFXUserApi::createUsersWithArrayInputCallback(PFXHttpRequestWorker *worker) msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -155,6 +164,7 @@ void PFXUserApi::createUsersWithListInput(const QList &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); QJsonDocument doc(::test_namespace::toJsonValue(body).toArray()); @@ -177,6 +187,7 @@ void PFXUserApi::createUsersWithListInputCallback(PFXHttpRequestWorker *worker) msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -203,6 +214,7 @@ void PFXUserApi::deleteUser(const QString &username) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "DELETE"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -221,6 +233,7 @@ void PFXUserApi::deleteUserCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -247,6 +260,7 @@ void PFXUserApi::getUserByName(const QString &username) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -265,6 +279,7 @@ void PFXUserApi::getUserByNameCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } PFXUser output(QString(worker->response)); worker->deleteLater(); @@ -301,6 +316,7 @@ void PFXUserApi::loginUser(const QString &username, const QString &password) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -319,6 +335,7 @@ void PFXUserApi::loginUserCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } QString output; ::test_namespace::fromStringValue(QString(worker->response), output); @@ -344,6 +361,7 @@ void PFXUserApi::logoutUser() { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -362,6 +380,7 @@ void PFXUserApi::logoutUserCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -388,6 +407,7 @@ void PFXUserApi::updateUser(const QString &username, const PFXUser &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "PUT"); QString output = body.asJson(); @@ -409,6 +429,7 @@ void PFXUserApi::updateUserCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); diff --git a/samples/client/petstore/cpp-qt5/client/PFXUserApi.h b/samples/client/petstore/cpp-qt5/client/PFXUserApi.h index 417c5a8d879..4ca836a7895 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXUserApi.h +++ b/samples/client/petstore/cpp-qt5/client/PFXUserApi.h @@ -36,6 +36,7 @@ public: void setTimeOut(const int timeOut); void setWorkingDirectory(const QString &path); void addHeaders(const QString &key, const QString &value); + void enableContentCompression(); void createUser(const PFXUser &body); void createUsersWithArrayInput(const QList &body); @@ -53,6 +54,7 @@ private: int _timeOut; QString _workingDirectory; QMap defaultHeaders; + bool _compress; void createUserCallback(PFXHttpRequestWorker *worker); void createUsersWithArrayInputCallback(PFXHttpRequestWorker *worker); diff --git a/samples/client/petstore/cpp-qt5/client/PFXclient.pri b/samples/client/petstore/cpp-qt5/client/PFXclient.pri index e86f90006a1..c09a32bdf4f 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXclient.pri +++ b/samples/client/petstore/cpp-qt5/client/PFXclient.pri @@ -34,5 +34,5 @@ SOURCES += \ # Others $${PWD}/PFXHelpers.cpp \ $${PWD}/PFXHttpRequest.cpp \ - $${PWD}/PFXHttpFileElement.cpp + $${PWD}/PFXHttpFileElement.cpp From 6a228e80060709dde0f26c0a602d259dda747894 Mon Sep 17 00:00:00 2001 From: Sai Giridhar P Date: Tue, 21 Jan 2020 19:40:33 +0530 Subject: [PATCH 09/85] [csharp-netcore] Adding additional package metadata (#5065) * fix(csharp-netcore): Adding license expression * fix(csharp-netcore): Adding license expression * fix(csharp-netcore): Adding license expression * fix(csharp-netcore): Adding license expression * fix(csharp-netcore): Adding license expression * fix(csharp-netcore): Adding other package metadata fields * fix(csharp-netcore): Adding other package metadata fields * fix(csharp-netcore): Adding other package metadata fields * fix(csharp-netcore): Minor fixes * fix(csharp-netcore): Updating example projects * fix(csharp-netcore): Removed carriage return * fix(csharp-netcore): Removed carriage return --- docs/generators/csharp-netcore.md | 3 +++ .../codegen/CodegenConstants.java | 6 +++++ .../languages/CSharpNetCoreClientCodegen.java | 27 +++++++++++++++++++ .../resources/csharp-netcore/Project.mustache | 9 ++++++- .../csharp-netcore/netcore_project.mustache | 7 ++++- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 5 ++++ .../Org.OpenAPITools/Org.OpenAPITools.csproj | 3 +++ 7 files changed, 58 insertions(+), 2 deletions(-) diff --git a/docs/generators/csharp-netcore.md b/docs/generators/csharp-netcore.md index fb09d3a1ff8..7b67601f3d3 100644 --- a/docs/generators/csharp-netcore.md +++ b/docs/generators/csharp-netcore.md @@ -9,6 +9,7 @@ sidebar_label: csharp-netcore |caseInsensitiveResponseHeaders|Make API response's headers case-insensitive| |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| |I| +|licenseId|The identifier of the license| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase| |netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false| |nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false| @@ -18,7 +19,9 @@ sidebar_label: csharp-netcore |optionalProjectFile|Generate {PackageName}.csproj.| |true| |packageGuid|The GUID that will be associated with the C# project| |null| |packageName|C# package name (convention: Title.Case).| |Org.OpenAPITools| +|packageTags|Tags to identify the package| |null| |packageVersion|C# package version.| |1.0.0| +|releaseNote|Release note, default to 'Minor update'.| |Minor update| |returnICollection|Return ICollection<T> instead of the concrete type.| |false| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src| 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 7bdbad35edd..5a039966b2c 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 @@ -114,6 +114,9 @@ public class CodegenConstants { public static final String LICENSE_NAME = "licenseName"; public static final String LICENSE_NAME_DESC = "The name of the license"; + public static final String LICENSE_ID = "licenseId"; + public static final String LICENSE_ID_DESC = "The identifier of the license"; + public static final String LICENSE_URL = "licenseUrl"; public static final String LICENSE_URL_DESC = "The URL of the license"; @@ -336,4 +339,7 @@ public class CodegenConstants { public static final String ENUM_CLASS_PREFIX = "enumClassPrefix"; public static final String ENUM_CLASS_PREFIX_DESC = "Prefix enum with class name"; + + public static final String PACKAGE_TAGS = "packageTags"; + public static final String PACKAGE_TAGS_DESC = "Tags to identify the package"; } 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 d97c2d800b9..f17168d19d7 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 @@ -80,6 +80,9 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { protected boolean nonPublicApi = Boolean.FALSE; protected boolean caseInsensitiveResponseHeaders = Boolean.FALSE; + protected String releaseNote = "Minor update"; + protected String licenseId; + protected String packageTags; public CSharpNetCoreClientCodegen() { super(); @@ -163,6 +166,18 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { CodegenConstants.INTERFACE_PREFIX_DESC, interfacePrefix); + addOption(CodegenConstants.LICENSE_ID, + CodegenConstants.LICENSE_ID_DESC, + this.licenseId); + + addOption(CodegenConstants.RELEASE_NOTE, + CodegenConstants.RELEASE_NOTE_DESC, + this.releaseNote); + + addOption(CodegenConstants.PACKAGE_TAGS, + CodegenConstants.PACKAGE_TAGS_DESC, + this.packageTags); + CliOption framework = new CliOption( CodegenConstants.DOTNET_FRAMEWORK, CodegenConstants.DOTNET_FRAMEWORK_DESC @@ -699,6 +714,18 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders; } + public void setLicenseId(String licenseId) { + this.licenseId = licenseId; + } + + public void setReleaseNote(String releaseNote) { + this.releaseNote = releaseNote; + } + + public void setPackageTags(String packageTags) { + this.packageTags = packageTags; + } + @Override public String toEnumVarName(String value, String datatype) { if (value.length() == 0) { diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache index a3fec02b66b..59a3460326b 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache @@ -22,10 +22,17 @@ Properties {{packageName}} {{packageName}} + {{packageDescription}} {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} {{targetFramework}} 512 - bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml + bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml{{#licenseId}} + {{licenseId}}{{/licenseId}} + https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}.git + git + https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}{{#releaseNote}} + {{releaseNote}}{{/releaseNote}}{{#packageTags}} + {{{packageTags}}}{{/packageTags}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache index f68d4c29a2c..56c95a5e32b 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache @@ -16,7 +16,12 @@ true {{packageName}} {{packageVersion}} - bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml + bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml{{#licenseId}} + {{licenseId}}{{/licenseId}} + https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}.git + git{{#releaseNote}} + {{releaseNote}}{{/releaseNote}}{{#packageTags}} + {{{packageTags}}}{{/packageTags}} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 5b4ebc2f06a..20e88d0d9b4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -18,10 +18,15 @@ The version of the OpenAPI document: 1.0.0 Properties Org.OpenAPITools Org.OpenAPITools + A library generated from a OpenAPI doc {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} netstandard2.0 512 bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + https://github.com/GIT_USER_ID/GIT_REPO_ID + Minor update diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj index fbf4cc7af1a..8d7243e6d1e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -17,6 +17,9 @@ Org.OpenAPITools 1.0.0 bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update From 95bd32d4746d11bd69a368a5e5ba2de1edcc67f3 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Tue, 21 Jan 2020 14:32:31 +0000 Subject: [PATCH 10/85] [swift5][client] return ErrorResponse.error when network parsing error (#5068) --- .../libraries/alamofire/AlamofireImplementations.mustache | 2 +- .../urlsession/URLSessionImplementations.mustache | 3 ++- .../PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +++--- .../Classes/OpenAPIs/AlamofireImplementations.swift | 2 +- samples/client/petstore/swift5/alamofireLibrary/README.md | 2 +- .../petstore/swift5/alamofireLibrary/docs/FakeAPI.md | 8 ++++---- .../PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +++--- .../Classes/OpenAPIs/URLSessionImplementations.swift | 3 ++- samples/client/petstore/swift5/combineLibrary/README.md | 2 +- .../client/petstore/swift5/combineLibrary/docs/FakeAPI.md | 8 ++++---- .../PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +++--- .../Classes/OpenAPIs/URLSessionImplementations.swift | 3 ++- samples/client/petstore/swift5/default/README.md | 2 +- samples/client/petstore/swift5/default/docs/FakeAPI.md | 8 ++++---- .../PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +++--- .../Classes/OpenAPIs/URLSessionImplementations.swift | 3 ++- samples/client/petstore/swift5/nonPublicApi/README.md | 2 +- .../client/petstore/swift5/nonPublicApi/docs/FakeAPI.md | 8 ++++---- .../PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +++--- .../Classes/OpenAPIs/URLSessionImplementations.swift | 3 ++- samples/client/petstore/swift5/objcCompatible/README.md | 2 +- .../client/petstore/swift5/objcCompatible/docs/FakeAPI.md | 8 ++++---- .../PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +++--- .../Classes/OpenAPIs/URLSessionImplementations.swift | 3 ++- .../client/petstore/swift5/promisekitLibrary/README.md | 2 +- .../petstore/swift5/promisekitLibrary/docs/FakeAPI.md | 8 ++++---- .../PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +++--- .../Classes/OpenAPIs/URLSessionImplementations.swift | 3 ++- samples/client/petstore/swift5/resultLibrary/README.md | 2 +- .../client/petstore/swift5/resultLibrary/docs/FakeAPI.md | 8 ++++---- .../PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +++--- .../Classes/OpenAPIs/URLSessionImplementations.swift | 3 ++- samples/client/petstore/swift5/rxswiftLibrary/README.md | 2 +- .../client/petstore/swift5/rxswiftLibrary/docs/FakeAPI.md | 6 +++--- .../PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +++--- .../Classes/OpenAPIs/URLSessionImplementations.swift | 3 ++- .../client/petstore/swift5/urlsessionLibrary/README.md | 2 +- .../petstore/swift5/urlsessionLibrary/docs/FakeAPI.md | 8 ++++---- .../Classes/OpenAPIs/URLSessionImplementations.swift | 3 ++- 39 files changed, 93 insertions(+), 83 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache index 675d55a4fa6..9b5389031e9 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache @@ -348,7 +348,7 @@ private var managerStore = SynchronizedDictionary() observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ private var urlSessionStore = SynchronizedDictionary() case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index dfbb6b02243..134d6aea416 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -260,7 +260,7 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None @@ -291,9 +291,9 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test 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 001eede9413..368b4edffb9 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -347,7 +347,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } }) diff --git a/samples/client/petstore/swift5/alamofireLibrary/README.md b/samples/client/petstore/swift5/alamofireLibrary/README.md index 2a7b47d57c0..4829f29f6af 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/README.md +++ b/samples/client/petstore/swift5/alamofireLibrary/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/alamofireLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/alamofireLibrary/docs/FakeAPI.md index 49d4d3fb6a1..0e9325f77e9 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/alamofireLibrary/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -367,9 +367,9 @@ No authorization required 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, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift @@ -391,7 +391,7 @@ let dateTime = Date() // Date | None (optional) let password = "password_example" // String | None (optional) let callback = "callback_example" // String | None (optional) -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in guard error == nil else { print(error) 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 442dd29191b..47510b7781a 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 @@ -282,7 +282,7 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None @@ -316,9 +316,9 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test 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 9e552cce099..6084a18be72 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ open class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/client/petstore/swift5/combineLibrary/README.md b/samples/client/petstore/swift5/combineLibrary/README.md index 2a7b47d57c0..4829f29f6af 100644 --- a/samples/client/petstore/swift5/combineLibrary/README.md +++ b/samples/client/petstore/swift5/combineLibrary/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/combineLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/combineLibrary/docs/FakeAPI.md index 49d4d3fb6a1..0e9325f77e9 100644 --- a/samples/client/petstore/swift5/combineLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/combineLibrary/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -367,9 +367,9 @@ No authorization required 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, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift @@ -391,7 +391,7 @@ let dateTime = Date() // Date | None (optional) let password = "password_example" // String | None (optional) let callback = "callback_example" // String | None (optional) -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in guard error == nil else { print(error) diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index dfbb6b02243..134d6aea416 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -260,7 +260,7 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None @@ -291,9 +291,9 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test 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 9e552cce099..6084a18be72 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ open class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/client/petstore/swift5/default/README.md b/samples/client/petstore/swift5/default/README.md index 2a7b47d57c0..4829f29f6af 100644 --- a/samples/client/petstore/swift5/default/README.md +++ b/samples/client/petstore/swift5/default/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/default/docs/FakeAPI.md b/samples/client/petstore/swift5/default/docs/FakeAPI.md index 49d4d3fb6a1..0e9325f77e9 100644 --- a/samples/client/petstore/swift5/default/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/default/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -367,9 +367,9 @@ No authorization required 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, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift @@ -391,7 +391,7 @@ let dateTime = Date() // Date | None (optional) let password = "password_example" // String | None (optional) let callback = "callback_example" // String | None (optional) -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in guard error == nil else { print(error) diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 93a7c43079e..ab1b8f09247 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -260,7 +260,7 @@ internal class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter integer: (form) None (optional) - parameter int32: (form) None (optional) @@ -291,9 +291,9 @@ internal class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test 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 2f430c08e26..876ba9195b1 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ internal class URLSessionDecodableRequestBuilder: URLSessionReques case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/client/petstore/swift5/nonPublicApi/README.md b/samples/client/petstore/swift5/nonPublicApi/README.md index 2a7b47d57c0..4829f29f6af 100644 --- a/samples/client/petstore/swift5/nonPublicApi/README.md +++ b/samples/client/petstore/swift5/nonPublicApi/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/nonPublicApi/docs/FakeAPI.md b/samples/client/petstore/swift5/nonPublicApi/docs/FakeAPI.md index f8e42ac4df8..6a16d54b005 100644 --- a/samples/client/petstore/swift5/nonPublicApi/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/nonPublicApi/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -367,9 +367,9 @@ No authorization required internal class func testEndpointParameters(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double, string: String? = nil, patternWithoutDelimiter: String, byte: Data, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift @@ -391,7 +391,7 @@ let dateTime = Date() // Date | None (optional) let password = "password_example" // String | None (optional) let callback = "callback_example" // String | None (optional) -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 FakeAPI.testEndpointParameters(integer: integer, int32: int32, int64: int64, number: number, float: float, double: double, string: string, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in guard error == nil else { print(error) diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index dfbb6b02243..134d6aea416 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -260,7 +260,7 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None @@ -291,9 +291,9 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test 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 9e552cce099..6084a18be72 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ open class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/client/petstore/swift5/objcCompatible/README.md b/samples/client/petstore/swift5/objcCompatible/README.md index 2a7b47d57c0..4829f29f6af 100644 --- a/samples/client/petstore/swift5/objcCompatible/README.md +++ b/samples/client/petstore/swift5/objcCompatible/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/objcCompatible/docs/FakeAPI.md b/samples/client/petstore/swift5/objcCompatible/docs/FakeAPI.md index c7e27b881fd..63b00fcbfa5 100644 --- a/samples/client/petstore/swift5/objcCompatible/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/objcCompatible/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -367,9 +367,9 @@ No authorization required 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, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift @@ -391,7 +391,7 @@ let dateTime = Date() // Date | None (optional) let password = "password_example" // String | None (optional) let callback = "callback_example" // String | None (optional) -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in guard error == nil else { print(error) diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 1a37c8113c2..80153ba634d 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -275,7 +275,7 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None @@ -308,9 +308,9 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test 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 9e552cce099..6084a18be72 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ open class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/client/petstore/swift5/promisekitLibrary/README.md b/samples/client/petstore/swift5/promisekitLibrary/README.md index 2a7b47d57c0..4829f29f6af 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/README.md +++ b/samples/client/petstore/swift5/promisekitLibrary/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/promisekitLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/promisekitLibrary/docs/FakeAPI.md index bf8e514f03d..72c908dd589 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/promisekitLibrary/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -346,9 +346,9 @@ No authorization required 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) -> Promise ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift @@ -370,7 +370,7 @@ let dateTime = Date() // Date | None (optional) let password = "password_example" // String | None (optional) let callback = "callback_example" // String | None (optional) -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).then { // when the promise is fulfilled }.always { diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 02d14692f94..2764fb314ab 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -260,7 +260,7 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None @@ -291,9 +291,9 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test 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 9e552cce099..6084a18be72 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ open class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/client/petstore/swift5/resultLibrary/README.md b/samples/client/petstore/swift5/resultLibrary/README.md index 2a7b47d57c0..4829f29f6af 100644 --- a/samples/client/petstore/swift5/resultLibrary/README.md +++ b/samples/client/petstore/swift5/resultLibrary/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/resultLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/resultLibrary/docs/FakeAPI.md index 49d4d3fb6a1..0e9325f77e9 100644 --- a/samples/client/petstore/swift5/resultLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/resultLibrary/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -367,9 +367,9 @@ No authorization required 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, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift @@ -391,7 +391,7 @@ let dateTime = Date() // Date | None (optional) let password = "password_example" // String | None (optional) let callback = "callback_example" // String | None (optional) -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in guard error == nil else { print(error) diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index cad139a00ba..3e9b32438c8 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -289,7 +289,7 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None @@ -324,9 +324,9 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test 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 9e552cce099..6084a18be72 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ open class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/README.md b/samples/client/petstore/swift5/rxswiftLibrary/README.md index 2a7b47d57c0..4829f29f6af 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/README.md +++ b/samples/client/petstore/swift5/rxswiftLibrary/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/rxswiftLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/rxswiftLibrary/docs/FakeAPI.md index a9a6c32c98b..872c0359f04 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/rxswiftLibrary/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -303,9 +303,9 @@ No authorization required 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) -> Observable ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index dfbb6b02243..134d6aea416 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -260,7 +260,7 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None @@ -291,9 +291,9 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test 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 9e552cce099..6084a18be72 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ open class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/README.md b/samples/client/petstore/swift5/urlsessionLibrary/README.md index 2a7b47d57c0..4829f29f6af 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/README.md +++ b/samples/client/petstore/swift5/urlsessionLibrary/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/urlsessionLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/urlsessionLibrary/docs/FakeAPI.md index 49d4d3fb6a1..0e9325f77e9 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/urlsessionLibrary/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -367,9 +367,9 @@ No authorization required 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, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift @@ -391,7 +391,7 @@ let dateTime = Date() // Date | None (optional) let password = "password_example" // String | None (optional) let callback = "callback_example" // String | None (optional) -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in guard error == nil else { print(error) diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift index bfcda0b6485..bcc49ecc7ca 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ open class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } From 63859d6d51ee807ae266212acef0e65b70729cd0 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Tue, 21 Jan 2020 07:19:07 -0800 Subject: [PATCH 11/85] Add python-experimental-openapiv3-sample (#4992) Add python-experimental-openapiv3-sample Add missing files for the Python samples Add python-experimental-petstore.bat for openapi v3 Add python-experimental samples openapi v3 Add python-experimental samples openapi v3 Add python-experimental samples openapi v3. Address review comments add missing files for test purpose fix python formatting issues fix python formatting issues fix python formatting issues Fix unit tests fix python formatting issues fix python formatting issues fix python formatting issues fix 'line too long' pep8 error address PR comments for pep8 'line too long' problem regenerate samples execute samples scripts dummy commit to retrigger circleci Revert dummy commit, it didn't help. --- bin/openapi3/python-experimental-petstore.sh | 32 + .../windows/python-experimental-petstore.bat | 10 + bin/utils/ensure-up-to-date | 1 + .../PythonClientExperimentalCodegen.java | 4 +- .../python/python-experimental/api.mustache | 6 +- pom.xml | 1 + .../petstore_api/api/another_fake_api.py | 6 +- .../petstore_api/api/fake_api.py | 198 +- .../api/fake_classname_tags_123_api.py | 6 +- .../petstore_api/api/pet_api.py | 81 +- .../petstore_api/api/store_api.py | 18 +- .../petstore_api/api/user_api.py | 54 +- .../petstore_api/models/animal.py | 6 +- .../petstore_api/models/array_test.py | 3 +- .../petstore_api/models/cat.py | 6 +- .../petstore_api/models/child.py | 6 +- .../petstore_api/models/child_cat.py | 6 +- .../petstore_api/models/child_dog.py | 6 +- .../petstore_api/models/child_lizard.py | 6 +- .../petstore_api/models/dog.py | 6 +- .../petstore_api/models/enum_test.py | 3 +- .../models/file_schema_test_class.py | 3 +- .../petstore_api/models/map_test.py | 3 +- ...perties_and_additional_properties_class.py | 3 +- .../petstore_api/models/outer_composite.py | 3 +- .../petstore_api/models/parent.py | 6 +- .../petstore_api/models/parent_pet.py | 12 +- .../petstore_api/models/pet.py | 6 +- .../petstore/python-experimental/.gitignore | 66 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/VERSION | 1 + .../petstore/python-experimental/.travis.yml | 15 + .../petstore/python-experimental/Makefile | 19 + .../petstore/python-experimental/README.md | 210 ++ .../python-experimental/dev-requirements.txt | 2 + .../docs/AdditionalPropertiesClass.md | 11 + .../python-experimental/docs/Animal.md | 11 + .../docs/AnotherFakeApi.md | 63 + .../python-experimental/docs/ApiResponse.md | 12 + .../docs/ArrayOfArrayOfNumberOnly.md | 10 + .../docs/ArrayOfNumberOnly.md | 10 + .../python-experimental/docs/ArrayTest.md | 12 + .../docs/Capitalization.md | 15 + .../petstore/python-experimental/docs/Cat.md | 12 + .../python-experimental/docs/CatAllOf.md | 10 + .../python-experimental/docs/Category.md | 11 + .../python-experimental/docs/ClassModel.md | 11 + .../python-experimental/docs/Client.md | 10 + .../python-experimental/docs/DefaultApi.md | 56 + .../petstore/python-experimental/docs/Dog.md | 12 + .../python-experimental/docs/DogAllOf.md | 10 + .../python-experimental/docs/EnumArrays.md | 11 + .../python-experimental/docs/EnumClass.md | 10 + .../python-experimental/docs/EnumTest.md | 17 + .../python-experimental/docs/FakeApi.md | 849 +++++++ .../docs/FakeClassnameTags123Api.md | 71 + .../petstore/python-experimental/docs/File.md | 11 + .../docs/FileSchemaTestClass.md | 11 + .../petstore/python-experimental/docs/Foo.md | 10 + .../python-experimental/docs/FormatTest.md | 24 + .../docs/HasOnlyReadOnly.md | 11 + .../docs/HealthCheckResult.md | 11 + .../python-experimental/docs/InlineObject.md | 11 + .../python-experimental/docs/InlineObject1.md | 11 + .../python-experimental/docs/InlineObject2.md | 11 + .../python-experimental/docs/InlineObject3.md | 23 + .../python-experimental/docs/InlineObject4.md | 11 + .../python-experimental/docs/InlineObject5.md | 11 + .../docs/InlineResponseDefault.md | 10 + .../petstore/python-experimental/docs/List.md | 10 + .../python-experimental/docs/MapTest.md | 13 + ...dPropertiesAndAdditionalPropertiesClass.md | 12 + .../docs/Model200Response.md | 12 + .../python-experimental/docs/ModelReturn.md | 11 + .../petstore/python-experimental/docs/Name.md | 14 + .../python-experimental/docs/NullableClass.md | 22 + .../python-experimental/docs/NumberOnly.md | 10 + .../python-experimental/docs/Order.md | 15 + .../docs/OuterComposite.md | 12 + .../python-experimental/docs/OuterEnum.md | 10 + .../docs/OuterEnumDefaultValue.md | 10 + .../docs/OuterEnumInteger.md | 10 + .../docs/OuterEnumIntegerDefaultValue.md | 10 + .../petstore/python-experimental/docs/Pet.md | 15 + .../python-experimental/docs/PetApi.md | 597 +++++ .../python-experimental/docs/ReadOnlyFirst.md | 11 + .../docs/SpecialModelName.md | 10 + .../python-experimental/docs/StoreApi.md | 233 ++ .../docs/StringBooleanMap.md | 10 + .../petstore/python-experimental/docs/Tag.md | 11 + .../petstore/python-experimental/docs/User.md | 17 + .../python-experimental/docs/UserApi.md | 437 ++++ .../petstore/python-experimental/git_push.sh | 58 + .../petstore_api/__init__.py | 91 + .../petstore_api/api/__init__.py | 12 + .../petstore_api/api/another_fake_api.py | 378 +++ .../petstore_api/api/default_api.py | 366 +++ .../petstore_api/api/fake_api.py | 2080 +++++++++++++++++ .../api/fake_classname_tags_123_api.py | 380 +++ .../petstore_api/api/pet_api.py | 1319 +++++++++++ .../petstore_api/api/store_api.py | 699 ++++++ .../petstore_api/api/user_api.py | 1130 +++++++++ .../petstore_api/api_client.py | 535 +++++ .../petstore_api/configuration.py | 406 ++++ .../petstore_api/exceptions.py | 120 + .../petstore_api/model_utils.py | 1393 +++++++++++ .../petstore_api/models/__init__.py | 15 + .../models/additional_properties_class.py | 130 ++ .../petstore_api/models/animal.py | 160 ++ .../petstore_api/models/api_response.py | 133 ++ .../models/array_of_array_of_number_only.py | 127 + .../models/array_of_number_only.py | 127 + .../petstore_api/models/array_test.py | 138 ++ .../petstore_api/models/capitalization.py | 142 ++ .../petstore_api/models/cat.py | 180 ++ .../petstore_api/models/cat_all_of.py | 127 + .../petstore_api/models/category.py | 132 ++ .../petstore_api/models/class_model.py | 127 + .../petstore_api/models/client.py | 127 + .../petstore_api/models/dog.py | 180 ++ .../petstore_api/models/dog_all_of.py | 127 + .../petstore_api/models/enum_arrays.py | 138 ++ .../petstore_api/models/enum_class.py | 126 + .../petstore_api/models/enum_test.py | 188 ++ .../petstore_api/models/file.py | 127 + .../models/file_schema_test_class.py | 135 ++ .../petstore_api/models/foo.py | 127 + .../petstore_api/models/format_test.py | 215 ++ .../petstore_api/models/has_only_read_only.py | 130 ++ .../models/health_check_result.py | 127 + .../petstore_api/models/inline_object.py | 130 ++ .../petstore_api/models/inline_object1.py | 130 ++ .../petstore_api/models/inline_object2.py | 139 ++ .../petstore_api/models/inline_object3.py | 205 ++ .../petstore_api/models/inline_object4.py | 133 ++ .../petstore_api/models/inline_object5.py | 132 ++ .../models/inline_response_default.py | 132 ++ .../petstore_api/models/list.py | 127 + .../petstore_api/models/map_test.py | 145 ++ ...perties_and_additional_properties_class.py | 138 ++ .../petstore_api/models/model200_response.py | 130 ++ .../petstore_api/models/model_return.py | 127 + .../petstore_api/models/name.py | 138 ++ .../petstore_api/models/nullable_class.py | 160 ++ .../petstore_api/models/number_only.py | 127 + .../petstore_api/models/order.py | 147 ++ .../petstore_api/models/outer_composite.py | 133 ++ .../petstore_api/models/outer_enum.py | 127 + .../models/outer_enum_default_value.py | 126 + .../petstore_api/models/outer_enum_integer.py | 126 + .../outer_enum_integer_default_value.py | 126 + .../petstore_api/models/pet.py | 160 ++ .../petstore_api/models/read_only_first.py | 130 ++ .../petstore_api/models/special_model_name.py | 127 + .../petstore_api/models/string_boolean_map.py | 124 + .../petstore_api/models/tag.py | 130 ++ .../petstore_api/models/user.py | 148 ++ .../python-experimental/petstore_api/rest.py | 296 +++ .../petstore/python-experimental/pom.xml | 46 + .../python-experimental/requirements.txt | 6 + .../petstore/python-experimental/setup.cfg | 2 + .../petstore/python-experimental/setup.py | 43 + .../python-experimental/test-requirements.txt | 4 + .../python-experimental/test/__init__.py | 0 .../test/test_additional_properties_class.py | 37 + .../python-experimental/test/test_animal.py | 37 + .../test/test_another_fake_api.py | 40 + .../test/test_api_response.py | 37 + .../test_array_of_array_of_number_only.py | 37 + .../test/test_array_of_number_only.py | 37 + .../test/test_array_test.py | 37 + .../test/test_capitalization.py | 37 + .../python-experimental/test/test_cat.py | 37 + .../test/test_cat_all_of.py | 37 + .../python-experimental/test/test_category.py | 37 + .../test/test_class_model.py | 37 + .../python-experimental/test/test_client.py | 37 + .../test/test_default_api.py | 39 + .../python-experimental/test/test_dog.py | 37 + .../test/test_dog_all_of.py | 37 + .../test/test_enum_arrays.py | 37 + .../test/test_enum_class.py | 37 + .../test/test_enum_test.py | 37 + .../python-experimental/test/test_fake_api.py | 124 + .../test/test_fake_classname_tags_123_api.py | 40 + .../python-experimental/test/test_file.py | 37 + .../test/test_file_schema_test_class.py | 37 + .../python-experimental/test/test_foo.py | 37 + .../test/test_format_test.py | 37 + .../test/test_has_only_read_only.py | 37 + .../test/test_health_check_result.py | 37 + .../test/test_inline_object.py | 37 + .../test/test_inline_object1.py | 37 + .../test/test_inline_object2.py | 37 + .../test/test_inline_object3.py | 37 + .../test/test_inline_object4.py | 37 + .../test/test_inline_object5.py | 37 + .../test/test_inline_response_default.py | 37 + .../python-experimental/test/test_list.py | 37 + .../python-experimental/test/test_map_test.py | 37 + ...perties_and_additional_properties_class.py | 37 + .../test/test_model200_response.py | 37 + .../test/test_model_return.py | 37 + .../python-experimental/test/test_name.py | 37 + .../test/test_nullable_class.py | 37 + .../test/test_number_only.py | 37 + .../python-experimental/test/test_order.py | 37 + .../test/test_outer_composite.py | 37 + .../test/test_outer_enum.py | 37 + .../test/test_outer_enum_default_value.py | 37 + .../test/test_outer_enum_integer.py | 37 + .../test_outer_enum_integer_default_value.py | 37 + .../python-experimental/test/test_pet.py | 37 + .../python-experimental/test/test_pet_api.py | 96 + .../test/test_read_only_first.py | 37 + .../test/test_special_model_name.py | 37 + .../test/test_store_api.py | 61 + .../test/test_string_boolean_map.py | 37 + .../python-experimental/test/test_tag.py | 37 + .../python-experimental/test/test_user.py | 37 + .../python-experimental/test/test_user_api.py | 89 + .../python-experimental/test_python2.sh | 33 + .../python-experimental/test_python2_and_3.sh | 31 + .../petstore/python-experimental/tox.ini | 9 + .../openapi_server/openapi/openapi.yaml | 62 +- .../openapi_server/openapi/openapi.yaml | 62 +- 226 files changed, 22417 insertions(+), 214 deletions(-) create mode 100755 bin/openapi3/python-experimental-petstore.sh create mode 100644 bin/openapi3/windows/python-experimental-petstore.bat create mode 100644 samples/openapi3/client/petstore/python-experimental/.gitignore create mode 100644 samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/python-experimental/.travis.yml create mode 100644 samples/openapi3/client/petstore/python-experimental/Makefile create mode 100644 samples/openapi3/client/petstore/python-experimental/README.md create mode 100644 samples/openapi3/client/petstore/python-experimental/dev-requirements.txt create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Animal.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Cat.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Category.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Client.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Dog.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/File.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Foo.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/List.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/MapTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Name.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Order.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Pet.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/PetApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Tag.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/User.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/UserApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/git_push.sh create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py create mode 100644 samples/openapi3/client/petstore/python-experimental/pom.xml create mode 100644 samples/openapi3/client/petstore/python-experimental/requirements.txt create mode 100644 samples/openapi3/client/petstore/python-experimental/setup.cfg create mode 100644 samples/openapi3/client/petstore/python-experimental/setup.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test-requirements.txt create mode 100644 samples/openapi3/client/petstore/python-experimental/test/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_animal.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_api_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_cat.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_category.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_class_model.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_client.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_default_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_dog.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_file.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_foo.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_format_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_list.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_map_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_model_return.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_order.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_pet.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_store_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_tag.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_user.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_user_api.py create mode 100755 samples/openapi3/client/petstore/python-experimental/test_python2.sh create mode 100755 samples/openapi3/client/petstore/python-experimental/test_python2_and_3.sh create mode 100644 samples/openapi3/client/petstore/python-experimental/tox.ini diff --git a/bin/openapi3/python-experimental-petstore.sh b/bin/openapi3/python-experimental-petstore.sh new file mode 100755 index 00000000000..7b4007372b2 --- /dev/null +++ b/bin/openapi3/python-experimental-petstore.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples/openapi3/client/petstore/python-experimental/ --additional-properties packageName=petstore_api $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/windows/python-experimental-petstore.bat b/bin/openapi3/windows/python-experimental-petstore.bat new file mode 100644 index 00000000000..73c433de278 --- /dev/null +++ b/bin/openapi3/windows/python-experimental-petstore.bat @@ -0,0 +1,10 @@ +set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples\openapi3\client\petstore\python-experimental --additional-properties packageName=petstore_api + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/utils/ensure-up-to-date b/bin/utils/ensure-up-to-date index 397b6975a1a..4bb9ee79b4f 100755 --- a/bin/utils/ensure-up-to-date +++ b/bin/utils/ensure-up-to-date @@ -41,6 +41,7 @@ declare -a samples=( "${root}/bin/python-petstore-all.sh" "${root}/bin/python-server-all.sh" "${root}/bin/openapi3/python-petstore.sh" +"${root}/bin/openapi3/python-experimental-petstore.sh" "${root}/bin/php-petstore.sh" "${root}/bin/php-silex-petstore-server.sh" "${root}/bin/php-symfony-petstore.sh" diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index 6a18abea015..7e31e615773 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -277,7 +277,9 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { // name looks like cat.Cat String moduleName = name.split("\\.")[0]; // https://exceptionshub.com/circular-or-cyclic-imports-in-python.html - String modelImport = "try:\n from " + modelPackage() + " import "+ moduleName+ "\nexcept ImportError:\n "+moduleName+" = sys.modules['"+modelPackage() + "."+ moduleName+"']"; + String modelImport = "try:\n from " + modelPackage() + + " import " + moduleName+ "\nexcept ImportError:\n " + + moduleName + " = sys.modules[\n '" + modelPackage() + "." + moduleName + "']"; return modelImport; } diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache index 734c490caba..2182d7362d0 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache @@ -108,7 +108,8 @@ class {{classname}}(object): ) kwargs['_host_index'] = kwargs.get('_host_index', 0) {{#requiredParams}} - kwargs['{{paramName}}'] = {{paramName}} + kwargs['{{paramName}}'] = \ + {{paramName}} {{/requiredParams}} return self.call_with_http_info(**kwargs) @@ -216,7 +217,8 @@ class {{classname}}(object): }, 'openapi_types': { {{#allParams}} - '{{paramName}}': ({{{dataType}}},), + '{{paramName}}': + ({{{dataType}}},), {{/allParams}} }, 'attribute_map': { diff --git a/pom.xml b/pom.xml index e01e715039a..64d0efc5fbe 100644 --- a/pom.xml +++ b/pom.xml @@ -1060,6 +1060,7 @@ samples/client/petstore/python-asyncio samples/client/petstore/python-tornado samples/openapi3/client/petstore/python + samples/openapi3/client/petstore/python-experimental samples/client/petstore/typescript-fetch/builds/default samples/client/petstore/typescript-fetch/builds/es6-target samples/client/petstore/typescript-fetch/builds/with-npm-version diff --git a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py index c8e87491d52..7a8e081050d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -102,7 +102,8 @@ class AnotherFakeApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.call_123_test_special_tags = Endpoint( @@ -134,7 +135,8 @@ class AnotherFakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'body': (client.Client,), + 'body': + (client.Client,), }, 'attribute_map': { }, diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py index be569e05cbd..13b39417a25 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -108,7 +108,8 @@ class FakeApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['xml_item'] = xml_item + kwargs['xml_item'] = \ + xml_item return self.call_with_http_info(**kwargs) self.create_xml_item = Endpoint( @@ -140,7 +141,8 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'xml_item': (xml_item.XmlItem,), + 'xml_item': + (xml_item.XmlItem,), }, 'attribute_map': { }, @@ -247,7 +249,8 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'body': (bool,), + 'body': + (bool,), }, 'attribute_map': { }, @@ -349,7 +352,8 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'body': (outer_composite.OuterComposite,), + 'body': + (outer_composite.OuterComposite,), }, 'attribute_map': { }, @@ -451,7 +455,8 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'body': (outer_enum.OuterEnum,), + 'body': + (outer_enum.OuterEnum,), }, 'attribute_map': { }, @@ -553,7 +558,8 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'body': (outer_number.OuterNumber,), + 'body': + (outer_number.OuterNumber,), }, 'attribute_map': { }, @@ -655,7 +661,8 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'body': (str,), + 'body': + (str,), }, 'attribute_map': { }, @@ -728,7 +735,8 @@ class FakeApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.test_body_with_file_schema = Endpoint( @@ -760,7 +768,8 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'body': (file_schema_test_class.FileSchemaTestClass,), + 'body': + (file_schema_test_class.FileSchemaTestClass,), }, 'attribute_map': { }, @@ -833,8 +842,10 @@ class FakeApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['query'] = query - kwargs['body'] = body + kwargs['query'] = \ + query + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.test_body_with_query_params = Endpoint( @@ -868,8 +879,10 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'query': (str,), - 'body': (user.User,), + 'query': + (str,), + 'body': + (user.User,), }, 'attribute_map': { 'query': 'query', @@ -944,7 +957,8 @@ class FakeApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.test_client_model = Endpoint( @@ -976,7 +990,8 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'body': (client.Client,), + 'body': + (client.Client,), }, 'attribute_map': { }, @@ -1055,11 +1070,16 @@ class FakeApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['query_integer'] = query_integer - kwargs['query_string'] = query_string - kwargs['path_string'] = path_string - kwargs['path_integer'] = path_integer - kwargs['header_number'] = header_number + kwargs['query_integer'] = \ + query_integer + kwargs['query_string'] = \ + query_string + kwargs['path_string'] = \ + path_string + kwargs['path_integer'] = \ + path_integer + kwargs['header_number'] = \ + header_number return self.call_with_http_info(**kwargs) self.test_endpoint_enums_length_one = Endpoint( @@ -1124,11 +1144,16 @@ class FakeApi(object): }, }, 'openapi_types': { - 'query_integer': (int,), - 'query_string': (str,), - 'path_string': (str,), - 'path_integer': (int,), - 'header_number': (float,), + 'query_integer': + (int,), + 'query_string': + (str,), + 'path_string': + (str,), + 'path_integer': + (int,), + 'header_number': + (float,), }, 'attribute_map': { 'query_integer': 'query_integer', @@ -1221,10 +1246,14 @@ class FakeApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['number'] = number - kwargs['double'] = double - kwargs['pattern_without_delimiter'] = pattern_without_delimiter - kwargs['byte'] = byte + kwargs['number'] = \ + number + kwargs['double'] = \ + double + kwargs['pattern_without_delimiter'] = \ + pattern_without_delimiter + kwargs['byte'] = \ + byte return self.call_with_http_info(**kwargs) self.test_endpoint_parameters = Endpoint( @@ -1323,20 +1352,34 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'number': (float,), - 'double': (float,), - 'pattern_without_delimiter': (str,), - 'byte': (str,), - 'integer': (int,), - 'int32': (int,), - 'int64': (int,), - 'float': (float,), - 'string': (str,), - 'binary': (file_type,), - 'date': (date,), - 'date_time': (datetime,), - 'password': (str,), - 'param_callback': (str,), + 'number': + (float,), + 'double': + (float,), + 'pattern_without_delimiter': + (str,), + 'byte': + (str,), + 'integer': + (int,), + 'int32': + (int,), + 'int64': + (int,), + 'float': + (float,), + 'string': + (str,), + 'binary': + (file_type,), + 'date': + (date,), + 'date_time': + (datetime,), + 'password': + (str,), + 'param_callback': + (str,), }, 'attribute_map': { 'number': 'number', @@ -1530,14 +1573,22 @@ class FakeApi(object): }, }, 'openapi_types': { - 'enum_header_string_array': ([str],), - 'enum_header_string': (str,), - 'enum_query_string_array': ([str],), - 'enum_query_string': (str,), - 'enum_query_integer': (int,), - 'enum_query_double': (float,), - 'enum_form_string_array': ([str],), - 'enum_form_string': (str,), + 'enum_header_string_array': + ([str],), + 'enum_header_string': + (str,), + 'enum_query_string_array': + ([str],), + 'enum_query_string': + (str,), + 'enum_query_integer': + (int,), + 'enum_query_double': + (float,), + 'enum_form_string_array': + ([str],), + 'enum_form_string': + (str,), }, 'attribute_map': { 'enum_header_string_array': 'enum_header_string_array', @@ -1633,9 +1684,12 @@ class FakeApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['required_string_group'] = required_string_group - kwargs['required_boolean_group'] = required_boolean_group - kwargs['required_int64_group'] = required_int64_group + kwargs['required_string_group'] = \ + required_string_group + kwargs['required_boolean_group'] = \ + required_boolean_group + kwargs['required_int64_group'] = \ + required_int64_group return self.call_with_http_info(**kwargs) self.test_group_parameters = Endpoint( @@ -1674,12 +1728,18 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'required_string_group': (int,), - 'required_boolean_group': (bool,), - 'required_int64_group': (int,), - 'string_group': (int,), - 'boolean_group': (bool,), - 'int64_group': (int,), + 'required_string_group': + (int,), + 'required_boolean_group': + (bool,), + 'required_int64_group': + (int,), + 'string_group': + (int,), + 'boolean_group': + (bool,), + 'int64_group': + (int,), }, 'attribute_map': { 'required_string_group': 'required_string_group', @@ -1760,7 +1820,8 @@ class FakeApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['param'] = param + kwargs['param'] = \ + param return self.call_with_http_info(**kwargs) self.test_inline_additional_properties = Endpoint( @@ -1792,7 +1853,8 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'param': ({str: (str,)},), + 'param': + ({str: (str,)},), }, 'attribute_map': { }, @@ -1865,8 +1927,10 @@ class FakeApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['param'] = param - kwargs['param2'] = param2 + kwargs['param'] = \ + param + kwargs['param2'] = \ + param2 return self.call_with_http_info(**kwargs) self.test_json_form_data = Endpoint( @@ -1900,8 +1964,10 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'param': (str,), - 'param2': (str,), + 'param': + (str,), + 'param2': + (str,), }, 'attribute_map': { 'param': 'param', diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py index b10c7cd3915..ba0386f633a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -102,7 +102,8 @@ class FakeClassnameTags123Api(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.test_classname = Endpoint( @@ -136,7 +137,8 @@ class FakeClassnameTags123Api(object): 'allowed_values': { }, 'openapi_types': { - 'body': (client.Client,), + 'body': + (client.Client,), }, 'attribute_map': { }, diff --git a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py index e7e1cf19c00..3eeae195e0a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -102,7 +102,8 @@ class PetApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.add_pet = Endpoint( @@ -136,7 +137,8 @@ class PetApi(object): 'allowed_values': { }, 'openapi_types': { - 'body': (pet.Pet,), + 'body': + (pet.Pet,), }, 'attribute_map': { }, @@ -210,7 +212,8 @@ class PetApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pet_id'] = pet_id + kwargs['pet_id'] = \ + pet_id return self.call_with_http_info(**kwargs) self.delete_pet = Endpoint( @@ -245,8 +248,10 @@ class PetApi(object): 'allowed_values': { }, 'openapi_types': { - 'pet_id': (int,), - 'api_key': (str,), + 'pet_id': + (int,), + 'api_key': + (str,), }, 'attribute_map': { 'pet_id': 'petId', @@ -320,7 +325,8 @@ class PetApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['status'] = status + kwargs['status'] = \ + status return self.call_with_http_info(**kwargs) self.find_pets_by_status = Endpoint( @@ -361,7 +367,8 @@ class PetApi(object): }, }, 'openapi_types': { - 'status': ([str],), + 'status': + ([str],), }, 'attribute_map': { 'status': 'status', @@ -437,7 +444,8 @@ class PetApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['tags'] = tags + kwargs['tags'] = \ + tags return self.call_with_http_info(**kwargs) self.find_pets_by_tags = Endpoint( @@ -471,7 +479,8 @@ class PetApi(object): 'allowed_values': { }, 'openapi_types': { - 'tags': ([str],), + 'tags': + ([str],), }, 'attribute_map': { 'tags': 'tags', @@ -547,7 +556,8 @@ class PetApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pet_id'] = pet_id + kwargs['pet_id'] = \ + pet_id return self.call_with_http_info(**kwargs) self.get_pet_by_id = Endpoint( @@ -581,7 +591,8 @@ class PetApi(object): 'allowed_values': { }, 'openapi_types': { - 'pet_id': (int,), + 'pet_id': + (int,), }, 'attribute_map': { 'pet_id': 'petId', @@ -655,7 +666,8 @@ class PetApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.update_pet = Endpoint( @@ -689,7 +701,8 @@ class PetApi(object): 'allowed_values': { }, 'openapi_types': { - 'body': (pet.Pet,), + 'body': + (pet.Pet,), }, 'attribute_map': { }, @@ -764,7 +777,8 @@ class PetApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pet_id'] = pet_id + kwargs['pet_id'] = \ + pet_id return self.call_with_http_info(**kwargs) self.update_pet_with_form = Endpoint( @@ -800,9 +814,12 @@ class PetApi(object): 'allowed_values': { }, 'openapi_types': { - 'pet_id': (int,), - 'name': (str,), - 'status': (str,), + 'pet_id': + (int,), + 'name': + (str,), + 'status': + (str,), }, 'attribute_map': { 'pet_id': 'petId', @@ -882,7 +899,8 @@ class PetApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pet_id'] = pet_id + kwargs['pet_id'] = \ + pet_id return self.call_with_http_info(**kwargs) self.upload_file = Endpoint( @@ -919,10 +937,14 @@ class PetApi(object): 'allowed_values': { }, 'openapi_types': { - 'pet_id': (int,), - 'additional_metadata': (str,), - 'file': (file_type,), - 'files': ([file_type],), + 'pet_id': + (int,), + 'additional_metadata': + (str,), + 'file': + (file_type,), + 'files': + ([file_type],), }, 'attribute_map': { 'pet_id': 'petId', @@ -1006,8 +1028,10 @@ class PetApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pet_id'] = pet_id - kwargs['required_file'] = required_file + kwargs['pet_id'] = \ + pet_id + kwargs['required_file'] = \ + required_file return self.call_with_http_info(**kwargs) self.upload_file_with_required_file = Endpoint( @@ -1044,9 +1068,12 @@ class PetApi(object): 'allowed_values': { }, 'openapi_types': { - 'pet_id': (int,), - 'required_file': (file_type,), - 'additional_metadata': (str,), + 'pet_id': + (int,), + 'required_file': + (file_type,), + 'additional_metadata': + (str,), }, 'attribute_map': { 'pet_id': 'petId', diff --git a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py index bb1367b167e..e429d348e67 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -102,7 +102,8 @@ class StoreApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['order_id'] = order_id + kwargs['order_id'] = \ + order_id return self.call_with_http_info(**kwargs) self.delete_order = Endpoint( @@ -134,7 +135,8 @@ class StoreApi(object): 'allowed_values': { }, 'openapi_types': { - 'order_id': (str,), + 'order_id': + (str,), }, 'attribute_map': { 'order_id': 'order_id', @@ -306,7 +308,8 @@ class StoreApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['order_id'] = order_id + kwargs['order_id'] = \ + order_id return self.call_with_http_info(**kwargs) self.get_order_by_id = Endpoint( @@ -344,7 +347,8 @@ class StoreApi(object): 'allowed_values': { }, 'openapi_types': { - 'order_id': (int,), + 'order_id': + (int,), }, 'attribute_map': { 'order_id': 'order_id', @@ -418,7 +422,8 @@ class StoreApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.place_order = Endpoint( @@ -450,7 +455,8 @@ class StoreApi(object): 'allowed_values': { }, 'openapi_types': { - 'body': (order.Order,), + 'body': + (order.Order,), }, 'attribute_map': { }, diff --git a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py index 17e2428b84c..9f754bb50a6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -102,7 +102,8 @@ class UserApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.create_user = Endpoint( @@ -134,7 +135,8 @@ class UserApi(object): 'allowed_values': { }, 'openapi_types': { - 'body': (user.User,), + 'body': + (user.User,), }, 'attribute_map': { }, @@ -204,7 +206,8 @@ class UserApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.create_users_with_array_input = Endpoint( @@ -236,7 +239,8 @@ class UserApi(object): 'allowed_values': { }, 'openapi_types': { - 'body': ([user.User],), + 'body': + ([user.User],), }, 'attribute_map': { }, @@ -306,7 +310,8 @@ class UserApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.create_users_with_list_input = Endpoint( @@ -338,7 +343,8 @@ class UserApi(object): 'allowed_values': { }, 'openapi_types': { - 'body': ([user.User],), + 'body': + ([user.User],), }, 'attribute_map': { }, @@ -409,7 +415,8 @@ class UserApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['username'] = username + kwargs['username'] = \ + username return self.call_with_http_info(**kwargs) self.delete_user = Endpoint( @@ -441,7 +448,8 @@ class UserApi(object): 'allowed_values': { }, 'openapi_types': { - 'username': (str,), + 'username': + (str,), }, 'attribute_map': { 'username': 'username', @@ -512,7 +520,8 @@ class UserApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['username'] = username + kwargs['username'] = \ + username return self.call_with_http_info(**kwargs) self.get_user_by_name = Endpoint( @@ -544,7 +553,8 @@ class UserApi(object): 'allowed_values': { }, 'openapi_types': { - 'username': (str,), + 'username': + (str,), }, 'attribute_map': { 'username': 'username', @@ -619,8 +629,10 @@ class UserApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['username'] = username - kwargs['password'] = password + kwargs['username'] = \ + username + kwargs['password'] = \ + password return self.call_with_http_info(**kwargs) self.login_user = Endpoint( @@ -654,8 +666,10 @@ class UserApi(object): 'allowed_values': { }, 'openapi_types': { - 'username': (str,), - 'password': (str,), + 'username': + (str,), + 'password': + (str,), }, 'attribute_map': { 'username': 'username', @@ -828,8 +842,10 @@ class UserApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['username'] = username - kwargs['body'] = body + kwargs['username'] = \ + username + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.update_user = Endpoint( @@ -863,8 +879,10 @@ class UserApi(object): 'allowed_values': { }, 'openapi_types': { - 'username': (str,), - 'body': (user.User,), + 'username': + (str,), + 'body': + (user.User,), }, 'attribute_map': { 'username': 'username', diff --git a/samples/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/client/petstore/python-experimental/petstore_api/models/animal.py index 2da7a5923a5..abb0d49e74c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/animal.py @@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401 try: from petstore_api.models import cat except ImportError: - cat = sys.modules['petstore_api.models.cat'] + cat = sys.modules[ + 'petstore_api.models.cat'] try: from petstore_api.models import dog except ImportError: - dog = sys.modules['petstore_api.models.dog'] + dog = sys.modules[ + 'petstore_api.models.dog'] class Animal(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py index 3c15d79a3d0..c99bc985cab 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py @@ -31,7 +31,8 @@ from petstore_api.model_utils import ( # noqa: F401 try: from petstore_api.models import read_only_first except ImportError: - read_only_first = sys.modules['petstore_api.models.read_only_first'] + read_only_first = sys.modules[ + 'petstore_api.models.read_only_first'] class ArrayTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/client/petstore/python-experimental/petstore_api/models/cat.py index 6b4985dc4a9..229d0445554 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/cat.py @@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401 try: from petstore_api.models import animal except ImportError: - animal = sys.modules['petstore_api.models.animal'] + animal = sys.modules[ + 'petstore_api.models.animal'] try: from petstore_api.models import cat_all_of except ImportError: - cat_all_of = sys.modules['petstore_api.models.cat_all_of'] + cat_all_of = sys.modules[ + 'petstore_api.models.cat_all_of'] class Cat(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child.py b/samples/client/petstore/python-experimental/petstore_api/models/child.py index 8a61f35ba14..9721a0b684f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child.py @@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401 try: from petstore_api.models import child_all_of except ImportError: - child_all_of = sys.modules['petstore_api.models.child_all_of'] + child_all_of = sys.modules[ + 'petstore_api.models.child_all_of'] try: from petstore_api.models import parent except ImportError: - parent = sys.modules['petstore_api.models.parent'] + parent = sys.modules[ + 'petstore_api.models.parent'] class Child(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py b/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py index b329281e9c2..7828dba8cb8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py @@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401 try: from petstore_api.models import child_cat_all_of except ImportError: - child_cat_all_of = sys.modules['petstore_api.models.child_cat_all_of'] + child_cat_all_of = sys.modules[ + 'petstore_api.models.child_cat_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules['petstore_api.models.parent_pet'] + parent_pet = sys.modules[ + 'petstore_api.models.parent_pet'] class ChildCat(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py b/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py index eaea5cba93c..36180f15713 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py @@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401 try: from petstore_api.models import child_dog_all_of except ImportError: - child_dog_all_of = sys.modules['petstore_api.models.child_dog_all_of'] + child_dog_all_of = sys.modules[ + 'petstore_api.models.child_dog_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules['petstore_api.models.parent_pet'] + parent_pet = sys.modules[ + 'petstore_api.models.parent_pet'] class ChildDog(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py index a038974bb54..cb79d4ad604 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py @@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401 try: from petstore_api.models import child_lizard_all_of except ImportError: - child_lizard_all_of = sys.modules['petstore_api.models.child_lizard_all_of'] + child_lizard_all_of = sys.modules[ + 'petstore_api.models.child_lizard_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules['petstore_api.models.parent_pet'] + parent_pet = sys.modules[ + 'petstore_api.models.parent_pet'] class ChildLizard(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/client/petstore/python-experimental/petstore_api/models/dog.py index 54ccf0e390a..b29e31d4e5d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/dog.py @@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401 try: from petstore_api.models import animal except ImportError: - animal = sys.modules['petstore_api.models.animal'] + animal = sys.modules[ + 'petstore_api.models.animal'] try: from petstore_api.models import dog_all_of except ImportError: - dog_all_of = sys.modules['petstore_api.models.dog_all_of'] + dog_all_of = sys.modules[ + 'petstore_api.models.dog_all_of'] class Dog(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py index 5df1bcbc2e7..42a4c562150 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py @@ -31,7 +31,8 @@ from petstore_api.model_utils import ( # noqa: F401 try: from petstore_api.models import outer_enum except ImportError: - outer_enum = sys.modules['petstore_api.models.outer_enum'] + outer_enum = sys.modules[ + 'petstore_api.models.outer_enum'] class EnumTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py index 62a9a4194a1..f1abb16cbc3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py @@ -31,7 +31,8 @@ from petstore_api.model_utils import ( # noqa: F401 try: from petstore_api.models import file except ImportError: - file = sys.modules['petstore_api.models.file'] + file = sys.modules[ + 'petstore_api.models.file'] class FileSchemaTestClass(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py index e6680cc7349..e996e27991c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py @@ -31,7 +31,8 @@ from petstore_api.model_utils import ( # noqa: F401 try: from petstore_api.models import string_boolean_map except ImportError: - string_boolean_map = sys.modules['petstore_api.models.string_boolean_map'] + string_boolean_map = sys.modules[ + 'petstore_api.models.string_boolean_map'] class MapTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py index 52969b942bf..60b89762456 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -31,7 +31,8 @@ from petstore_api.model_utils import ( # noqa: F401 try: from petstore_api.models import animal except ImportError: - animal = sys.modules['petstore_api.models.animal'] + animal = sys.modules[ + 'petstore_api.models.animal'] class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py index 013e386adff..067ac6a1400 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py @@ -31,7 +31,8 @@ from petstore_api.model_utils import ( # noqa: F401 try: from petstore_api.models import outer_number except ImportError: - outer_number = sys.modules['petstore_api.models.outer_number'] + outer_number = sys.modules[ + 'petstore_api.models.outer_number'] class OuterComposite(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent.py b/samples/client/petstore/python-experimental/petstore_api/models/parent.py index 4175d7792f6..70534d8026e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/parent.py @@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401 try: from petstore_api.models import grandparent except ImportError: - grandparent = sys.modules['petstore_api.models.grandparent'] + grandparent = sys.modules[ + 'petstore_api.models.grandparent'] try: from petstore_api.models import parent_all_of except ImportError: - parent_all_of = sys.modules['petstore_api.models.parent_all_of'] + parent_all_of = sys.modules[ + 'petstore_api.models.parent_all_of'] class Parent(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py b/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py index d98bdc6f657..16d00f42da5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py @@ -31,19 +31,23 @@ from petstore_api.model_utils import ( # noqa: F401 try: from petstore_api.models import child_cat except ImportError: - child_cat = sys.modules['petstore_api.models.child_cat'] + child_cat = sys.modules[ + 'petstore_api.models.child_cat'] try: from petstore_api.models import child_dog except ImportError: - child_dog = sys.modules['petstore_api.models.child_dog'] + child_dog = sys.modules[ + 'petstore_api.models.child_dog'] try: from petstore_api.models import child_lizard except ImportError: - child_lizard = sys.modules['petstore_api.models.child_lizard'] + child_lizard = sys.modules[ + 'petstore_api.models.child_lizard'] try: from petstore_api.models import grandparent_animal except ImportError: - grandparent_animal = sys.modules['petstore_api.models.grandparent_animal'] + grandparent_animal = sys.modules[ + 'petstore_api.models.grandparent_animal'] class ParentPet(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/pet.py b/samples/client/petstore/python-experimental/petstore_api/models/pet.py index 83b4679eb7a..11ffa6ff44f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/pet.py @@ -31,11 +31,13 @@ from petstore_api.model_utils import ( # noqa: F401 try: from petstore_api.models import category except ImportError: - category = sys.modules['petstore_api.models.category'] + category = sys.modules[ + 'petstore_api.models.category'] try: from petstore_api.models import tag except ImportError: - tag = sys.modules['petstore_api.models.tag'] + tag = sys.modules[ + 'petstore_api.models.tag'] class Pet(ModelNormal): diff --git a/samples/openapi3/client/petstore/python-experimental/.gitignore b/samples/openapi3/client/petstore/python-experimental/.gitignore new file mode 100644 index 00000000000..43995bd42fa --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.gitignore @@ -0,0 +1,66 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore b/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION new file mode 100644 index 00000000000..58592f031f6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/.travis.yml b/samples/openapi3/client/petstore/python-experimental/.travis.yml new file mode 100644 index 00000000000..388de83128f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.travis.yml @@ -0,0 +1,15 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "2.7" + - "3.2" + - "3.3" + - "3.4" + - "3.5" + - "3.6" + - "3.7" + - "3.8" +# command to install dependencies +install: "pip install -r requirements.txt" +# command to run tests +script: nosetests diff --git a/samples/openapi3/client/petstore/python-experimental/Makefile b/samples/openapi3/client/petstore/python-experimental/Makefile new file mode 100644 index 00000000000..9354f43d509 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/Makefile @@ -0,0 +1,19 @@ +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=.venv + +clean: + rm -rf $(REQUIREMENTS_OUT) + rm -rf $(SETUP_OUT) + rm -rf $(VENV) + rm -rf .tox + rm -rf .coverage + find . -name "*.py[oc]" -delete + find . -name "__pycache__" -delete + +test: clean + bash ./test_python2.sh + +test-all: clean + bash ./test_python2_and_3.sh diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md new file mode 100644 index 00000000000..8e82b0a81f3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -0,0 +1,210 @@ +# petstore-api +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.PythonClientExperimentalCodegen + +## Requirements. + +Python 2.7 and 3.4+ + +## Installation & Usage +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import petstore_api +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import petstore_api +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.AnotherFakeApi(petstore_api.ApiClient(configuration)) +client_client = petstore_api.Client() # client.Client | client model + +try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(client_client) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags +*DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | +*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | +*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet +*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user +*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system +*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +## Documentation For Models + + - [additional_properties_class.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [animal.Animal](docs/Animal.md) + - [api_response.ApiResponse](docs/ApiResponse.md) + - [array_of_array_of_number_only.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [array_of_number_only.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [array_test.ArrayTest](docs/ArrayTest.md) + - [capitalization.Capitalization](docs/Capitalization.md) + - [cat.Cat](docs/Cat.md) + - [cat_all_of.CatAllOf](docs/CatAllOf.md) + - [category.Category](docs/Category.md) + - [class_model.ClassModel](docs/ClassModel.md) + - [client.Client](docs/Client.md) + - [dog.Dog](docs/Dog.md) + - [dog_all_of.DogAllOf](docs/DogAllOf.md) + - [enum_arrays.EnumArrays](docs/EnumArrays.md) + - [enum_class.EnumClass](docs/EnumClass.md) + - [enum_test.EnumTest](docs/EnumTest.md) + - [file.File](docs/File.md) + - [file_schema_test_class.FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [foo.Foo](docs/Foo.md) + - [format_test.FormatTest](docs/FormatTest.md) + - [has_only_read_only.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [health_check_result.HealthCheckResult](docs/HealthCheckResult.md) + - [inline_object.InlineObject](docs/InlineObject.md) + - [inline_object1.InlineObject1](docs/InlineObject1.md) + - [inline_object2.InlineObject2](docs/InlineObject2.md) + - [inline_object3.InlineObject3](docs/InlineObject3.md) + - [inline_object4.InlineObject4](docs/InlineObject4.md) + - [inline_object5.InlineObject5](docs/InlineObject5.md) + - [inline_response_default.InlineResponseDefault](docs/InlineResponseDefault.md) + - [list.List](docs/List.md) + - [map_test.MapTest](docs/MapTest.md) + - [mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [model200_response.Model200Response](docs/Model200Response.md) + - [model_return.ModelReturn](docs/ModelReturn.md) + - [name.Name](docs/Name.md) + - [nullable_class.NullableClass](docs/NullableClass.md) + - [number_only.NumberOnly](docs/NumberOnly.md) + - [order.Order](docs/Order.md) + - [outer_composite.OuterComposite](docs/OuterComposite.md) + - [outer_enum.OuterEnum](docs/OuterEnum.md) + - [outer_enum_default_value.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [outer_enum_integer.OuterEnumInteger](docs/OuterEnumInteger.md) + - [outer_enum_integer_default_value.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [pet.Pet](docs/Pet.md) + - [read_only_first.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [special_model_name.SpecialModelName](docs/SpecialModelName.md) + - [string_boolean_map.StringBooleanMap](docs/StringBooleanMap.md) + - [tag.Tag](docs/Tag.md) + - [user.User](docs/User.md) + + +## Documentation For Authorization + + +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +## api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + + +## bearer_test + +- **Type**: Bearer authentication (JWT) + + +## http_basic_test + +- **Type**: HTTP basic authentication + + +## petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + + +## Author + + + + diff --git a/samples/openapi3/client/petstore/python-experimental/dev-requirements.txt b/samples/openapi3/client/petstore/python-experimental/dev-requirements.txt new file mode 100644 index 00000000000..ccdfca62949 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/dev-requirements.txt @@ -0,0 +1,2 @@ +tox +flake8 diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..4df80090d8e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md @@ -0,0 +1,11 @@ +# additional_properties_class.AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_property** | **{str: (str,)}** | | [optional] +**map_of_map_property** | **{str: ({str: (str,)},)}** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Animal.md b/samples/openapi3/client/petstore/python-experimental/docs/Animal.md new file mode 100644 index 00000000000..fda84ee28ee --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Animal.md @@ -0,0 +1,11 @@ +# animal.Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**color** | **str** | | [optional] if omitted the server will use the default value of 'red' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..b9a70253492 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -0,0 +1,63 @@ +# petstore_api.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags + + +# **call_123_test_special_tags** +> client.Client call_123_test_special_tags(client_client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.AnotherFakeApi() +client_client = petstore_api.Client() # client.Client | client model + +# example passing only required values which don't have defaults set +try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(client_client) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client_client** | [**client.Client**](Client.md)| client model | + +### Return type + +[**client.Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md b/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md new file mode 100644 index 00000000000..8f7ffa46134 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md @@ -0,0 +1,12 @@ +# api_response.ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**type** | **str** | | [optional] +**message** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..ab82c8c556d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# array_of_array_of_number_only.ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_array_number** | **[[float]]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..b8ffd843c8d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# array_of_number_only.ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_number** | **[float]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md new file mode 100644 index 00000000000..22f198440e7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md @@ -0,0 +1,12 @@ +# array_test.ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_of_string** | **[str]** | | [optional] +**array_array_of_integer** | **[[int]]** | | [optional] +**array_array_of_model** | [**[[read_only_first.ReadOnlyFirst]]**](ReadOnlyFirst.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/openapi3/client/petstore/python-experimental/docs/Capitalization.md b/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md new file mode 100644 index 00000000000..d402f2a571a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md @@ -0,0 +1,15 @@ +# capitalization.Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**small_camel** | **str** | | [optional] +**capital_camel** | **str** | | [optional] +**small_snake** | **str** | | [optional] +**capital_snake** | **str** | | [optional] +**sca_eth_flow_points** | **str** | | [optional] +**att_name** | **str** | Name of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Cat.md b/samples/openapi3/client/petstore/python-experimental/docs/Cat.md new file mode 100644 index 00000000000..1d7b5b26d71 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Cat.md @@ -0,0 +1,12 @@ +# cat.Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**declawed** | **bool** | | [optional] +**color** | **str** | | [optional] if omitted the server will use the default value of 'red' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md new file mode 100644 index 00000000000..653bb0aa353 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md @@ -0,0 +1,10 @@ +# cat_all_of.CatAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Category.md b/samples/openapi3/client/petstore/python-experimental/docs/Category.md new file mode 100644 index 00000000000..bb122d910fc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Category.md @@ -0,0 +1,11 @@ +# category.Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | defaults to 'default-name' +**id** | **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/openapi3/client/petstore/python-experimental/docs/ClassModel.md b/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md new file mode 100644 index 00000000000..3f5d0075c1b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md @@ -0,0 +1,11 @@ +# class_model.ClassModel + +Model for testing model with \"_class\" property +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_class** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Client.md b/samples/openapi3/client/petstore/python-experimental/docs/Client.md new file mode 100644 index 00000000000..4c7ce57f750 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Client.md @@ -0,0 +1,10 @@ +# client.Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md new file mode 100644 index 00000000000..cf6c28c597c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md @@ -0,0 +1,56 @@ +# petstore_api.DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**foo_get**](DefaultApi.md#foo_get) | **GET** /foo | + + +# **foo_get** +> inline_response_default.InlineResponseDefault foo_get() + + + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.DefaultApi() + +# example, this endpoint has no required or optional parameters +try: + api_response = api_instance.foo_get() + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling DefaultApi->foo_get: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**inline_response_default.InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Dog.md b/samples/openapi3/client/petstore/python-experimental/docs/Dog.md new file mode 100644 index 00000000000..ec98b99dcec --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Dog.md @@ -0,0 +1,12 @@ +# dog.Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**breed** | **str** | | [optional] +**color** | **str** | | [optional] if omitted the server will use the default value of 'red' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md new file mode 100644 index 00000000000..da3c29557df --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md @@ -0,0 +1,10 @@ +# dog_all_of.DogAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md new file mode 100644 index 00000000000..c2f22d45047 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md @@ -0,0 +1,11 @@ +# enum_arrays.EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_symbol** | **str** | | [optional] +**array_enum** | **[str]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md new file mode 100644 index 00000000000..333307fde46 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md @@ -0,0 +1,10 @@ +# enum_class.EnumClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | defaults to '-efg' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md new file mode 100644 index 00000000000..aee196204f9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md @@ -0,0 +1,17 @@ +# enum_test.EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_string_required** | **str** | | +**enum_string** | **str** | | [optional] +**enum_integer** | **int** | | [optional] +**enum_number** | **float** | | [optional] +**outer_enum** | [**outer_enum.OuterEnum**](OuterEnum.md) | | [optional] +**outer_enum_integer** | [**outer_enum_integer.OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outer_enum_default_value** | [**outer_enum_default_value.OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outer_enum_integer_default_value** | [**outer_enum_integer_default_value.OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.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/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md new file mode 100644 index 00000000000..63cbd5d1842 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md @@ -0,0 +1,849 @@ +# petstore_api.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | +[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | +[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | + + +# **fake_health_get** +> health_check_result.HealthCheckResult fake_health_get() + +Health check endpoint + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() + +# example, this endpoint has no required or optional parameters +try: + # Health check endpoint + api_response = api_instance.fake_health_get() + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_health_get: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**health_check_result.HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The instance started successfully | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fake_outer_boolean_serialize** +> bool fake_outer_boolean_serialize() + + + +Test serialization of outer boolean types + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +body = True # bool | Input boolean as post body (optional) + +# example passing only required values which don't have defaults set +# and optional values +try: + api_response = api_instance.fake_outer_boolean_serialize(body=body) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **bool**| Input boolean as post body | [optional] + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output boolean | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fake_outer_composite_serialize** +> outer_composite.OuterComposite fake_outer_composite_serialize() + + + +Test serialization of object with outer number type + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +outer_composite_outer_composite = petstore_api.OuterComposite() # outer_composite.OuterComposite | Input composite as post body (optional) + +# example passing only required values which don't have defaults set +# and optional values +try: + api_response = api_instance.fake_outer_composite_serialize(outer_composite_outer_composite=outer_composite_outer_composite) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outer_composite_outer_composite** | [**outer_composite.OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**outer_composite.OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output composite | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fake_outer_number_serialize** +> float fake_outer_number_serialize() + + + +Test serialization of outer number types + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +body = 3.4 # float | Input number as post body (optional) + +# example passing only required values which don't have defaults set +# and optional values +try: + api_response = api_instance.fake_outer_number_serialize(body=body) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **float**| Input number as post body | [optional] + +### Return type + +**float** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output number | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **fake_outer_string_serialize** +> str fake_outer_string_serialize() + + + +Test serialization of outer string types + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +body = 'body_example' # str | Input string as post body (optional) + +# example passing only required values which don't have defaults set +# and optional values +try: + api_response = api_instance.fake_outer_string_serialize(body=body) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **str**| Input string as post body | [optional] + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output string | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_body_with_file_schema** +> test_body_with_file_schema(file_schema_test_class_file_schema_test_class) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +file_schema_test_class_file_schema_test_class = petstore_api.FileSchemaTestClass() # file_schema_test_class.FileSchemaTestClass | + +# example passing only required values which don't have defaults set +try: + api_instance.test_body_with_file_schema(file_schema_test_class_file_schema_test_class) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file_schema_test_class_file_schema_test_class** | [**file_schema_test_class.FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_body_with_query_params** +> test_body_with_query_params(query, user_user) + + + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +query = 'query_example' # str | +user_user = petstore_api.User() # user.User | + +# example passing only required values which don't have defaults set +try: + api_instance.test_body_with_query_params(query, user_user) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **str**| | + **user_user** | [**user.User**](User.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_client_model** +> client.Client test_client_model(client_client) + +To test \"client\" model + +To test \"client\" model + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +client_client = petstore_api.Client() # client.Client | client model + +# example passing only required values which don't have defaults set +try: + # To test \"client\" model + api_response = api_instance.test_client_model(client_client) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_client_model: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client_client** | [**client.Client**](Client.md)| client model | + +### Return type + +[**client.Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_endpoint_parameters** +> test_endpoint_parameters(number, double, pattern_without_delimiter, byte) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +* Basic Authentication (http_basic_test): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure HTTP basic authorization: http_basic_test +configuration.username = 'YOUR_USERNAME' +configuration.password = 'YOUR_PASSWORD' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) +number = 3.4 # float | None +double = 3.4 # float | None +pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None +byte = 'byte_example' # str | None +integer = 56 # int | None (optional) +int32 = 56 # int | None (optional) +int64 = 56 # int | None (optional) +float = 3.4 # float | None (optional) +string = 'string_example' # str | None (optional) +binary = open('/path/to/file', 'rb') # file_type | None (optional) +date = '2013-10-20' # date | None (optional) +date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) +password = 'password_example' # str | None (optional) +param_callback = 'param_callback_example' # str | None (optional) + +# example passing only required values which don't have defaults set +try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **float**| None | + **double** | **float**| None | + **pattern_without_delimiter** | **str**| None | + **byte** | **str**| None | + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **int**| None | [optional] + **float** | **float**| None | [optional] + **string** | **str**| None | [optional] + **binary** | **file_type**| None | [optional] + **date** | **date**| None | [optional] + **date_time** | **datetime**| None | [optional] + **password** | **str**| None | [optional] + **param_callback** | **str**| None | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_enum_parameters** +> test_enum_parameters() + +To test enum parameters + +To test enum parameters + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +enum_header_string_array = ['enum_header_string_array_example'] # [str] | Header parameter enum test (string array) (optional) +enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) if omitted the server will use the default value of '-efg' +enum_query_string_array = ['enum_query_string_array_example'] # [str] | Query parameter enum test (string array) (optional) +enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) if omitted the server will use the default value of '-efg' +enum_query_integer = 56 # int | Query parameter enum test (double) (optional) +enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) +enum_form_string_array = '$' # [str] | Form parameter enum test (string array) (optional) if omitted the server will use the default value of '$' +enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) if omitted the server will use the default value of '-efg' + +# example passing only required values which don't have defaults set +# and optional values +try: + # To test enum parameters + api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enum_header_string_array** | **[str]**| Header parameter enum test (string array) | [optional] + **enum_header_string** | **str**| Header parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + **enum_query_string_array** | **[str]**| Query parameter enum test (string array) | [optional] + **enum_query_string** | **str**| Query parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] + **enum_query_double** | **float**| Query parameter enum test (double) | [optional] + **enum_form_string_array** | **[str]**| Form parameter enum test (string array) | [optional] if omitted the server will use the default value of '$' + **enum_form_string** | **str**| Form parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid request | - | +**404** | Not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_group_parameters** +> test_group_parameters(required_string_group, required_boolean_group, required_int64_group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +* Bearer (JWT) Authentication (bearer_test): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure Bearer authorization (JWT): bearer_test +configuration.access_token = 'YOUR_BEARER_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) +required_string_group = 56 # int | Required String in group parameters +required_boolean_group = True # bool | Required Boolean in group parameters +required_int64_group = 56 # int | Required Integer in group parameters +string_group = 56 # int | String in group parameters (optional) +boolean_group = True # bool | Boolean in group parameters (optional) +int64_group = 56 # int | Integer in group parameters (optional) + +# example passing only required values which don't have defaults set +try: + # Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **required_string_group** | **int**| Required String in group parameters | + **required_boolean_group** | **bool**| Required Boolean in group parameters | + **required_int64_group** | **int**| Required Integer in group parameters | + **string_group** | **int**| String in group parameters | [optional] + **boolean_group** | **bool**| Boolean in group parameters | [optional] + **int64_group** | **int**| Integer in group parameters | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Someting wrong | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_inline_additional_properties** +> test_inline_additional_properties(request_body) + +test inline additionalProperties + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +request_body = {'key': 'request_body_example'} # {str: (str,)} | request body + +# example passing only required values which don't have defaults set +try: + # test inline additionalProperties + api_instance.test_inline_additional_properties(request_body) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request_body** | **{str: (str,)}**| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_json_form_data** +> test_json_form_data(param, param2) + +test json serialization of form data + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +param = 'param_example' # str | field1 +param2 = 'param2_example' # str | field2 + +# example passing only required values which don't have defaults set +try: + # test json serialization of form data + api_instance.test_json_form_data(param, param2) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **str**| field1 | + **param2** | **str**| field2 | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_query_parameter_collection_format** +> test_query_parameter_collection_format(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +pipe = ['pipe_example'] # [str] | +ioutil = ['ioutil_example'] # [str] | +http = ['http_example'] # [str] | +url = ['url_example'] # [str] | +context = ['context_example'] # [str] | + +# example passing only required values which don't have defaults set +try: + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | **[str]**| | + **ioutil** | **[str]**| | + **http** | **[str]**| | + **url** | **[str]**| | + **context** | **[str]**| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..4f78b1bd4cb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -0,0 +1,71 @@ +# petstore_api.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case + + +# **test_classname** +> client.Client test_classname(client_client) + +To test class name in snake case + +To test class name in snake case + +### Example + +* Api Key Authentication (api_key_query): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure API key authorization: api_key_query +configuration.api_key['api_key_query'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_query'] = 'Bearer' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) +client_client = petstore_api.Client() # client.Client | client model + +# example passing only required values which don't have defaults set +try: + # To test class name in snake case + api_response = api_instance.test_classname(client_client) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client_client** | [**client.Client**](Client.md)| client model | + +### Return type + +[**client.Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/File.md b/samples/openapi3/client/petstore/python-experimental/docs/File.md new file mode 100644 index 00000000000..2847323a098 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/File.md @@ -0,0 +1,11 @@ +# file.File + +Must be named `File` for test. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_uri** | **str** | Test capitalization | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md new file mode 100644 index 00000000000..807350c62f2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md @@ -0,0 +1,11 @@ +# file_schema_test_class.FileSchemaTestClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**file.File**](File.md) | | [optional] +**files** | [**[file.File]**](File.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Foo.md b/samples/openapi3/client/petstore/python-experimental/docs/Foo.md new file mode 100644 index 00000000000..570d1dac093 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Foo.md @@ -0,0 +1,10 @@ +# foo.Foo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] if omitted the server will use the default value of 'bar' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md b/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md new file mode 100644 index 00000000000..cb7e31877a7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md @@ -0,0 +1,24 @@ +# format_test.FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | **float** | | +**byte** | **str** | | +**date** | **date** | | +**password** | **str** | | +**integer** | **int** | | [optional] +**int32** | **int** | | [optional] +**int64** | **int** | | [optional] +**float** | **float** | | [optional] +**double** | **float** | | [optional] +**string** | **str** | | [optional] +**binary** | **file_type** | | [optional] +**date_time** | **datetime** | | [optional] +**uuid** | **str** | | [optional] +**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**pattern_with_digits_and_delimiter** | **str** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..f2194e269ed --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ +# has_only_read_only.HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] [readonly] +**foo** | **str** | | [optional] [readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md new file mode 100644 index 00000000000..280ddc2eaf3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md @@ -0,0 +1,11 @@ +# health_check_result.HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullable_message** | **str, none_type** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md new file mode 100644 index 00000000000..362cc36d1f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md @@ -0,0 +1,11 @@ +# inline_object.InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Updated name of the pet | [optional] +**status** | **str** | Updated status of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md new file mode 100644 index 00000000000..3090ff26994 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md @@ -0,0 +1,11 @@ +# inline_object1.InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additional_metadata** | **str** | Additional data to pass to server | [optional] +**file** | **file_type** | file to upload | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md new file mode 100644 index 00000000000..f8ea923f4e0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md @@ -0,0 +1,11 @@ +# inline_object2.InlineObject2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_form_string_array** | **[str]** | Form parameter enum test (string array) | [optional] +**enum_form_string** | **str** | Form parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md new file mode 100644 index 00000000000..050d635dd25 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md @@ -0,0 +1,23 @@ +# inline_object3.InlineObject3 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | **float** | None | +**double** | **float** | None | +**pattern_without_delimiter** | **str** | None | +**byte** | **str** | None | +**integer** | **int** | None | [optional] +**int32** | **int** | None | [optional] +**int64** | **int** | None | [optional] +**float** | **float** | None | [optional] +**string** | **str** | None | [optional] +**binary** | **file_type** | None | [optional] +**date** | **date** | None | [optional] +**date_time** | **datetime** | None | [optional] +**password** | **str** | None | [optional] +**callback** | **str** | None | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md new file mode 100644 index 00000000000..30ee0475e79 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md @@ -0,0 +1,11 @@ +# inline_object4.InlineObject4 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **str** | field1 | +**param2** | **str** | field2 | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md new file mode 100644 index 00000000000..56d245f1683 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md @@ -0,0 +1,11 @@ +# inline_object5.InlineObject5 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**required_file** | **file_type** | file to upload | +**additional_metadata** | **str** | Additional data to pass to server | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md new file mode 100644 index 00000000000..295326496d7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md @@ -0,0 +1,10 @@ +# inline_response_default.InlineResponseDefault + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**foo.Foo**](Foo.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/List.md b/samples/openapi3/client/petstore/python-experimental/docs/List.md new file mode 100644 index 00000000000..28e2ec05968 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/List.md @@ -0,0 +1,10 @@ +# list.List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123_list** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md b/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md new file mode 100644 index 00000000000..9fc13abebdc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md @@ -0,0 +1,13 @@ +# map_test.MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional] +**map_of_enum_string** | **{str: (str,)}** | | [optional] +**direct_map** | **{str: (bool,)}** | | [optional] +**indirect_map** | [**string_boolean_map.StringBooleanMap**](StringBooleanMap.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..87cda996e76 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ +# mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **str** | | [optional] +**date_time** | **datetime** | | [optional] +**map** | [**{str: (animal.Animal,)}**](Animal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md b/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md new file mode 100644 index 00000000000..90f5c2c025d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md @@ -0,0 +1,12 @@ +# model200_response.Model200Response + +Model for testing model name starting with number +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | [optional] +**_class** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md new file mode 100644 index 00000000000..3be9912b753 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md @@ -0,0 +1,11 @@ +# model_return.ModelReturn + +Model for testing reserved words +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_return** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Name.md b/samples/openapi3/client/petstore/python-experimental/docs/Name.md new file mode 100644 index 00000000000..777b79a3d8b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Name.md @@ -0,0 +1,14 @@ +# name.Name + +Model for testing model name same as property name +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | +**snake_case** | **int** | | [optional] [readonly] +**_property** | **str** | | [optional] +**_123_number** | **int** | | [optional] [readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md b/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md new file mode 100644 index 00000000000..7b1fe8506a6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md @@ -0,0 +1,22 @@ +# nullable_class.NullableClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer_prop** | **int, none_type** | | [optional] +**number_prop** | **float, none_type** | | [optional] +**boolean_prop** | **bool, none_type** | | [optional] +**string_prop** | **str, none_type** | | [optional] +**date_prop** | **date, none_type** | | [optional] +**datetime_prop** | **datetime, none_type** | | [optional] +**array_nullable_prop** | **[bool, date, datetime, dict, float, int, list, str], none_type** | | [optional] +**array_and_items_nullable_prop** | **[bool, date, datetime, dict, float, int, list, str, none_type], none_type** | | [optional] +**array_items_nullable** | **[bool, date, datetime, dict, float, int, list, str, none_type]** | | [optional] +**object_nullable_prop** | **{str: (bool, date, datetime, dict, float, int, list, str,)}, none_type** | | [optional] +**object_and_items_nullable_prop** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional] +**object_items_nullable** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md new file mode 100644 index 00000000000..ea1a09d2934 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md @@ -0,0 +1,10 @@ +# number_only.NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_number** | **float** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Order.md b/samples/openapi3/client/petstore/python-experimental/docs/Order.md new file mode 100644 index 00000000000..9569ea55e55 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Order.md @@ -0,0 +1,15 @@ +# order.Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**pet_id** | **int** | | [optional] +**quantity** | **int** | | [optional] +**ship_date** | **datetime** | | [optional] +**status** | **str** | Order Status | [optional] +**complete** | **bool** | | [optional] if omitted the server will use the default value of False + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md new file mode 100644 index 00000000000..a389115ee5a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md @@ -0,0 +1,12 @@ +# outer_composite.OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**my_number** | **float** | | [optional] +**my_string** | **str** | | [optional] +**my_boolean** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md new file mode 100644 index 00000000000..d1414ba4e61 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md @@ -0,0 +1,10 @@ +# outer_enum.OuterEnum + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str, none_type** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..648f964b6b0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md @@ -0,0 +1,10 @@ +# outer_enum_default_value.OuterEnumDefaultValue + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | defaults to 'placed' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md new file mode 100644 index 00000000000..de77d44d702 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md @@ -0,0 +1,10 @@ +# outer_enum_integer.OuterEnumInteger + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..b8d9b9c0b01 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,10 @@ +# outer_enum_integer_default_value.OuterEnumIntegerDefaultValue + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | | defaults to 0 + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Pet.md b/samples/openapi3/client/petstore/python-experimental/docs/Pet.md new file mode 100644 index 00000000000..a1ea5598e86 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Pet.md @@ -0,0 +1,15 @@ +# pet.Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**photo_urls** | **[str]** | | +**id** | **int** | | [optional] +**category** | [**category.Category**](Category.md) | | [optional] +**tags** | [**[tag.Tag]**](Tag.md) | | [optional] +**status** | **str** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md new file mode 100644 index 00000000000..90b5647d5f3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md @@ -0,0 +1,597 @@ +# petstore_api.PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + +# **add_pet** +> add_pet(pet_pet) + +Add a new pet to the store + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_pet = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store + +# example passing only required values which don't have defaults set +try: + # Add a new pet to the store + api_instance.add_pet(pet_pet) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->add_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_pet** | [**pet.Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_pet** +> delete_pet(pet_id) + +Deletes a pet + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | Pet id to delete +api_key = 'api_key_example' # str | (optional) + +# example passing only required values which don't have defaults set +try: + # Deletes a pet + api_instance.delete_pet(pet_id) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Deletes a pet + api_instance.delete_pet(pet_id, api_key=api_key) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| Pet id to delete | + **api_key** | **str**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid pet value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **find_pets_by_status** +> [pet.Pet] find_pets_by_status(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +status = ['status_example'] # [str] | Status values that need to be considered for filter + +# example passing only required values which don't have defaults set +try: + # Finds Pets by status + api_response = api_instance.find_pets_by_status(status) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **[str]**| Status values that need to be considered for filter | + +### Return type + +[**[pet.Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid status value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **find_pets_by_tags** +> [pet.Pet] find_pets_by_tags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +tags = ['tags_example'] # [str] | Tags to filter by + +# example passing only required values which don't have defaults set +try: + # Finds Pets by tags + api_response = api_instance.find_pets_by_tags(tags) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | **[str]**| Tags to filter by | + +### Return type + +[**[pet.Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid tag value | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_pet_by_id** +> pet.Pet get_pet_by_id(pet_id) + +Find pet by ID + +Returns a single pet + +### Example + +* Api Key Authentication (api_key): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure API key authorization: api_key +configuration.api_key['api_key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | ID of pet to return + +# example passing only required values which don't have defaults set +try: + # Find pet by ID + api_response = api_instance.get_pet_by_id(pet_id) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to return | + +### Return type + +[**pet.Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_pet** +> update_pet(pet_pet) + +Update an existing pet + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_pet = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store + +# example passing only required values which don't have defaults set +try: + # Update an existing pet + api_instance.update_pet(pet_pet) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_pet** | [**pet.Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | +**405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_pet_with_form** +> update_pet_with_form(pet_id) + +Updates a pet in the store with form data + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | ID of pet that needs to be updated +name = 'name_example' # str | Updated name of the pet (optional) +status = 'status_example' # str | Updated status of the pet (optional) + +# example passing only required values which don't have defaults set +try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id, name=name, status=status) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet that needs to be updated | + **name** | **str**| Updated name of the pet | [optional] + **status** | **str**| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **upload_file** +> api_response.ApiResponse upload_file(pet_id) + +uploads an image + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | ID of pet to update +additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) +file = open('/path/to/file', 'rb') # file_type | file to upload (optional) + +# example passing only required values which don't have defaults set +try: + # uploads an image + api_response = api_instance.upload_file(pet_id) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # uploads an image + api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to update | + **additional_metadata** | **str**| Additional data to pass to server | [optional] + **file** | **file_type**| file to upload | [optional] + +### Return type + +[**api_response.ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **upload_file_with_required_file** +> api_response.ApiResponse upload_file_with_required_file(pet_id, required_file) + +uploads an image (required) + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | ID of pet to update +required_file = open('/path/to/file', 'rb') # file_type | file to upload +additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) + +# example passing only required values which don't have defaults set +try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file(pet_id, required_file) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to update | + **required_file** | **file_type**| file to upload | + **additional_metadata** | **str**| Additional data to pass to server | [optional] + +### Return type + +[**api_response.ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..252641787c3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# read_only_first.ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] [readonly] +**baz** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md new file mode 100644 index 00000000000..312539af45e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md @@ -0,0 +1,10 @@ +# special_model_name.SpecialModelName + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**special_property_name** | **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/openapi3/client/petstore/python-experimental/docs/StoreApi.md b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md new file mode 100644 index 00000000000..a54a8c61fb1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md @@ -0,0 +1,233 @@ +# petstore_api.StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet + + +# **delete_order** +> delete_order(order_id) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.StoreApi() +order_id = 'order_id_example' # str | ID of the order that needs to be deleted + +# example passing only required values which don't have defaults set +try: + # Delete purchase order by ID + api_instance.delete_order(order_id) +except petstore_api.ApiException as e: + print("Exception when calling StoreApi->delete_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_inventory** +> {str: (int,)} get_inventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +* Api Key Authentication (api_key): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure API key authorization: api_key +configuration.api_key['api_key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) + +# example, this endpoint has no required or optional parameters +try: + # Returns pet inventories by status + api_response = api_instance.get_inventory() + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling StoreApi->get_inventory: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**{str: (int,)}** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_order_by_id** +> order.Order get_order_by_id(order_id) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.StoreApi() +order_id = 56 # int | ID of pet that needs to be fetched + +# example passing only required values which don't have defaults set +try: + # Find purchase order by ID + api_response = api_instance.get_order_by_id(order_id) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| ID of pet that needs to be fetched | + +### Return type + +[**order.Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **place_order** +> order.Order place_order(order_order) + +Place an order for a pet + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.StoreApi() +order_order = petstore_api.Order() # order.Order | order placed for purchasing the pet + +# example passing only required values which don't have defaults set +try: + # Place an order for a pet + api_response = api_instance.place_order(order_order) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling StoreApi->place_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_order** | [**order.Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**order.Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md b/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md new file mode 100644 index 00000000000..2eb94fd9a73 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md @@ -0,0 +1,10 @@ +# string_boolean_map.StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Tag.md b/samples/openapi3/client/petstore/python-experimental/docs/Tag.md new file mode 100644 index 00000000000..66f75c28fe4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Tag.md @@ -0,0 +1,11 @@ +# tag.Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/User.md b/samples/openapi3/client/petstore/python-experimental/docs/User.md new file mode 100644 index 00000000000..52ff07af296 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/User.md @@ -0,0 +1,17 @@ +# user.User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**username** | **str** | | [optional] +**first_name** | **str** | | [optional] +**last_name** | **str** | | [optional] +**email** | **str** | | [optional] +**password** | **str** | | [optional] +**phone** | **str** | | [optional] +**user_status** | **int** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md new file mode 100644 index 00000000000..4eb75f42874 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md @@ -0,0 +1,437 @@ +# petstore_api.UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UserApi.md#create_user) | **POST** /user | Create user +[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system +[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +# **create_user** +> create_user(user_user) + +Create user + +This can only be done by the logged in user. + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +user_user = petstore_api.User() # user.User | Created user object + +# example passing only required values which don't have defaults set +try: + # Create user + api_instance.create_user(user_user) +except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_user** | [**user.User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_users_with_array_input** +> create_users_with_array_input(user_user) + +Creates list of users with given input array + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +user_user = [petstore_api.User()] # [user.User] | List of user object + +# example passing only required values which don't have defaults set +try: + # Creates list of users with given input array + api_instance.create_users_with_array_input(user_user) +except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_user** | [**[user.User]**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_users_with_list_input** +> create_users_with_list_input(user_user) + +Creates list of users with given input array + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +user_user = [petstore_api.User()] # [user.User] | List of user object + +# example passing only required values which don't have defaults set +try: + # Creates list of users with given input array + api_instance.create_users_with_list_input(user_user) +except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_user** | [**[user.User]**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_user** +> delete_user(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The name that needs to be deleted + +# example passing only required values which don't have defaults set +try: + # Delete user + api_instance.delete_user(username) +except petstore_api.ApiException as e: + print("Exception when calling UserApi->delete_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_user_by_name** +> user.User get_user_by_name(username) + +Get user by user name + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. + +# example passing only required values which don't have defaults set +try: + # Get user by user name + api_response = api_instance.get_user_by_name(username) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling UserApi->get_user_by_name: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**user.User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **login_user** +> str login_user(username, password) + +Logs user into the system + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The user name for login +password = 'password_example' # str | The password for login in clear text + +# example passing only required values which don't have defaults set +try: + # Logs user into the system + api_response = api_instance.login_user(username, password) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling UserApi->login_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The user name for login | + **password** | **str**| The password for login in clear text | + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +**400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logout_user** +> logout_user() + +Logs out current logged in user session + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() + +# example, this endpoint has no required or optional parameters +try: + # Logs out current logged in user session + api_instance.logout_user() +except petstore_api.ApiException as e: + print("Exception when calling UserApi->logout_user: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_user** +> update_user(username, user_user) + +Updated user + +This can only be done by the logged in user. + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | name that need to be deleted +user_user = petstore_api.User() # user.User | Updated user object + +# example passing only required values which don't have defaults set +try: + # Updated user + api_instance.update_user(username, user_user) +except petstore_api.ApiException as e: + print("Exception when calling UserApi->update_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| name that need to be deleted | + **user_user** | [**user.User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid user supplied | - | +**404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/git_push.sh b/samples/openapi3/client/petstore/python-experimental/git_push.sh new file mode 100644 index 00000000000..ced3be2b0c7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/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/openapi3/client/petstore/python-experimental/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py new file mode 100644 index 00000000000..2c9bc6e12f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +# flake8: noqa + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +__version__ = "1.0.0" + +# import apis into sdk package +from petstore_api.api.another_fake_api import AnotherFakeApi +from petstore_api.api.default_api import DefaultApi +from petstore_api.api.fake_api import FakeApi +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.pet_api import PetApi +from petstore_api.api.store_api import StoreApi +from petstore_api.api.user_api import UserApi + +# import ApiClient +from petstore_api.api_client import ApiClient + +# import Configuration +from petstore_api.configuration import Configuration + +# import exceptions +from petstore_api.exceptions import OpenApiException +from petstore_api.exceptions import ApiTypeError +from petstore_api.exceptions import ApiValueError +from petstore_api.exceptions import ApiKeyError +from petstore_api.exceptions import ApiException + +# import models into sdk package +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass +from petstore_api.models.animal import Animal +from petstore_api.models.api_response import ApiResponse +from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from petstore_api.models.array_of_number_only import ArrayOfNumberOnly +from petstore_api.models.array_test import ArrayTest +from petstore_api.models.capitalization import Capitalization +from petstore_api.models.cat import Cat +from petstore_api.models.cat_all_of import CatAllOf +from petstore_api.models.category import Category +from petstore_api.models.class_model import ClassModel +from petstore_api.models.client import Client +from petstore_api.models.dog import Dog +from petstore_api.models.dog_all_of import DogAllOf +from petstore_api.models.enum_arrays import EnumArrays +from petstore_api.models.enum_class import EnumClass +from petstore_api.models.enum_test import EnumTest +from petstore_api.models.file import File +from petstore_api.models.file_schema_test_class import FileSchemaTestClass +from petstore_api.models.foo import Foo +from petstore_api.models.format_test import FormatTest +from petstore_api.models.has_only_read_only import HasOnlyReadOnly +from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.inline_object import InlineObject +from petstore_api.models.inline_object1 import InlineObject1 +from petstore_api.models.inline_object2 import InlineObject2 +from petstore_api.models.inline_object3 import InlineObject3 +from petstore_api.models.inline_object4 import InlineObject4 +from petstore_api.models.inline_object5 import InlineObject5 +from petstore_api.models.inline_response_default import InlineResponseDefault +from petstore_api.models.list import List +from petstore_api.models.map_test import MapTest +from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from petstore_api.models.model200_response import Model200Response +from petstore_api.models.model_return import ModelReturn +from petstore_api.models.name import Name +from petstore_api.models.nullable_class import NullableClass +from petstore_api.models.number_only import NumberOnly +from petstore_api.models.order import Order +from petstore_api.models.outer_composite import OuterComposite +from petstore_api.models.outer_enum import OuterEnum +from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue +from petstore_api.models.outer_enum_integer import OuterEnumInteger +from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue +from petstore_api.models.pet import Pet +from petstore_api.models.read_only_first import ReadOnlyFirst +from petstore_api.models.special_model_name import SpecialModelName +from petstore_api.models.string_boolean_map import StringBooleanMap +from petstore_api.models.tag import Tag +from petstore_api.models.user import User diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py new file mode 100644 index 00000000000..fa4e54a8009 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py @@ -0,0 +1,12 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from petstore_api.api.another_fake_api import AnotherFakeApi +from petstore_api.api.default_api import DefaultApi +from petstore_api.api.fake_api import FakeApi +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.pet_api import PetApi +from petstore_api.api.store_api import StoreApi +from petstore_api.api.user_api import UserApi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py new file mode 100644 index 00000000000..487b15dd082 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -0,0 +1,378 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 +import sys # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models import client + + +class AnotherFakeApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __call_123_test_special_tags(self, client_client, **kwargs): # noqa: E501 + """To test special tags # noqa: E501 + + To test special tags and operation ID starting with number # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.call_123_test_special_tags(client_client, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param client.Client client_client: client model (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: client.Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['client_client'] = \ + client_client + return self.call_with_http_info(**kwargs) + + self.call_123_test_special_tags = Endpoint( + settings={ + 'response_type': (client.Client,), + 'auth': [], + 'endpoint_path': '/another-fake/dummy', + 'operation_id': 'call_123_test_special_tags', + 'http_method': 'PATCH', + 'servers': [], + }, + params_map={ + 'all': [ + 'client_client', + ], + 'required': [ + 'client_client', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'client_client': + (client.Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'client_client': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__call_123_test_special_tags + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py new file mode 100644 index 00000000000..58b7c22e5e9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py @@ -0,0 +1,366 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 +import sys # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models import inline_response_default + + +class DefaultApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __foo_get(self, **kwargs): # noqa: E501 + """foo_get # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.foo_get(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: inline_response_default.InlineResponseDefault + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.foo_get = Endpoint( + settings={ + 'response_type': (inline_response_default.InlineResponseDefault,), + 'auth': [], + 'endpoint_path': '/foo', + 'operation_id': 'foo_get', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__foo_get + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py new file mode 100644 index 00000000000..c967e92c76e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -0,0 +1,2080 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 +import sys # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models import health_check_result +from petstore_api.models import outer_composite +from petstore_api.models import file_schema_test_class +from petstore_api.models import user +from petstore_api.models import client + + +class FakeApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __fake_health_get(self, **kwargs): # noqa: E501 + """Health check endpoint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_health_get(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: health_check_result.HealthCheckResult + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_health_get = Endpoint( + settings={ + 'response_type': (health_check_result.HealthCheckResult,), + 'auth': [], + 'endpoint_path': '/fake/health', + 'operation_id': 'fake_health_get', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__fake_health_get + ) + + def __fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 + """fake_outer_boolean_serialize # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_boolean_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param bool body: Input boolean as post body + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: bool + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_outer_boolean_serialize = Endpoint( + settings={ + 'response_type': (bool,), + 'auth': [], + 'endpoint_path': '/fake/outer/boolean', + 'operation_id': 'fake_outer_boolean_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (bool,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__fake_outer_boolean_serialize + ) + + def __fake_outer_composite_serialize(self, **kwargs): # noqa: E501 + """fake_outer_composite_serialize # noqa: E501 + + Test serialization of object with outer number type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_composite_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param outer_composite.OuterComposite outer_composite_outer_composite: Input composite as post body + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: outer_composite.OuterComposite + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_outer_composite_serialize = Endpoint( + settings={ + 'response_type': (outer_composite.OuterComposite,), + 'auth': [], + 'endpoint_path': '/fake/outer/composite', + 'operation_id': 'fake_outer_composite_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'outer_composite_outer_composite', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'outer_composite_outer_composite': + (outer_composite.OuterComposite,), + }, + 'attribute_map': { + }, + 'location_map': { + 'outer_composite_outer_composite': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__fake_outer_composite_serialize + ) + + def __fake_outer_number_serialize(self, **kwargs): # noqa: E501 + """fake_outer_number_serialize # noqa: E501 + + Test serialization of outer number types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_number_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param float body: Input number as post body + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: float + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_outer_number_serialize = Endpoint( + settings={ + 'response_type': (float,), + 'auth': [], + 'endpoint_path': '/fake/outer/number', + 'operation_id': 'fake_outer_number_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (float,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__fake_outer_number_serialize + ) + + def __fake_outer_string_serialize(self, **kwargs): # noqa: E501 + """fake_outer_string_serialize # noqa: E501 + + Test serialization of outer string types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_string_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str body: Input string as post body + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_outer_string_serialize = Endpoint( + settings={ + 'response_type': (str,), + 'auth': [], + 'endpoint_path': '/fake/outer/string', + 'operation_id': 'fake_outer_string_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (str,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__fake_outer_string_serialize + ) + + def __test_body_with_file_schema(self, file_schema_test_class_file_schema_test_class, **kwargs): # noqa: E501 + """test_body_with_file_schema # noqa: E501 + + For this test, the body for this request much reference a schema named `File`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_body_with_file_schema(file_schema_test_class_file_schema_test_class, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param file_schema_test_class.FileSchemaTestClass file_schema_test_class_file_schema_test_class: (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['file_schema_test_class_file_schema_test_class'] = \ + file_schema_test_class_file_schema_test_class + return self.call_with_http_info(**kwargs) + + self.test_body_with_file_schema = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/body-with-file-schema', + 'operation_id': 'test_body_with_file_schema', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'file_schema_test_class_file_schema_test_class', + ], + 'required': [ + 'file_schema_test_class_file_schema_test_class', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'file_schema_test_class_file_schema_test_class': + (file_schema_test_class.FileSchemaTestClass,), + }, + 'attribute_map': { + }, + 'location_map': { + 'file_schema_test_class_file_schema_test_class': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_body_with_file_schema + ) + + def __test_body_with_query_params(self, query, user_user, **kwargs): # noqa: E501 + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_body_with_query_params(query, user_user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str query: (required) + :param user.User user_user: (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['query'] = \ + query + kwargs['user_user'] = \ + user_user + return self.call_with_http_info(**kwargs) + + self.test_body_with_query_params = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/body-with-query-params', + 'operation_id': 'test_body_with_query_params', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'query', + 'user_user', + ], + 'required': [ + 'query', + 'user_user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'query': + (str,), + 'user_user': + (user.User,), + }, + 'attribute_map': { + 'query': 'query', + }, + 'location_map': { + 'query': 'query', + 'user_user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_body_with_query_params + ) + + def __test_client_model(self, client_client, **kwargs): # noqa: E501 + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_client_model(client_client, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param client.Client client_client: client model (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: client.Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['client_client'] = \ + client_client + return self.call_with_http_info(**kwargs) + + self.test_client_model = Endpoint( + settings={ + 'response_type': (client.Client,), + 'auth': [], + 'endpoint_path': '/fake', + 'operation_id': 'test_client_model', + 'http_method': 'PATCH', + 'servers': [], + }, + params_map={ + 'all': [ + 'client_client', + ], + 'required': [ + 'client_client', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'client_client': + (client.Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'client_client': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_client_model + ) + + def __test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param float number: None (required) + :param float double: None (required) + :param str pattern_without_delimiter: None (required) + :param str byte: None (required) + :param int integer: None + :param int int32: None + :param int int64: None + :param float float: None + :param str string: None + :param file_type binary: None + :param date date: None + :param datetime date_time: None + :param str password: None + :param str param_callback: None + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['number'] = \ + number + kwargs['double'] = \ + double + kwargs['pattern_without_delimiter'] = \ + pattern_without_delimiter + kwargs['byte'] = \ + byte + return self.call_with_http_info(**kwargs) + + self.test_endpoint_parameters = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'http_basic_test' + ], + 'endpoint_path': '/fake', + 'operation_id': 'test_endpoint_parameters', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'byte', + 'integer', + 'int32', + 'int64', + 'float', + 'string', + 'binary', + 'date', + 'date_time', + 'password', + 'param_callback', + ], + 'required': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'byte', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'integer', + 'int32', + 'float', + 'string', + 'password', + ] + }, + root_map={ + 'validations': { + ('number',): { + + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + }, + ('double',): { + + 'inclusive_maximum': 123.4, + 'inclusive_minimum': 67.8, + }, + ('pattern_without_delimiter',): { + + 'regex': { + 'pattern': r'^[A-Z].*', # noqa: E501 + }, + }, + ('integer',): { + + 'inclusive_maximum': 100, + 'inclusive_minimum': 10, + }, + ('int32',): { + + 'inclusive_maximum': 200, + 'inclusive_minimum': 20, + }, + ('float',): { + + 'inclusive_maximum': 987.6, + }, + ('string',): { + + 'regex': { + 'pattern': r'[a-z]', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + ('password',): { + 'max_length': 64, + 'min_length': 10, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'number': + (float,), + 'double': + (float,), + 'pattern_without_delimiter': + (str,), + 'byte': + (str,), + 'integer': + (int,), + 'int32': + (int,), + 'int64': + (int,), + 'float': + (float,), + 'string': + (str,), + 'binary': + (file_type,), + 'date': + (date,), + 'date_time': + (datetime,), + 'password': + (str,), + 'param_callback': + (str,), + }, + 'attribute_map': { + 'number': 'number', + 'double': 'double', + 'pattern_without_delimiter': 'pattern_without_delimiter', + 'byte': 'byte', + 'integer': 'integer', + 'int32': 'int32', + 'int64': 'int64', + 'float': 'float', + 'string': 'string', + 'binary': 'binary', + 'date': 'date', + 'date_time': 'dateTime', + 'password': 'password', + 'param_callback': 'callback', + }, + 'location_map': { + 'number': 'form', + 'double': 'form', + 'pattern_without_delimiter': 'form', + 'byte': 'form', + 'integer': 'form', + 'int32': 'form', + 'int64': 'form', + 'float': 'form', + 'string': 'form', + 'binary': 'form', + 'date': 'form', + 'date_time': 'form', + 'password': 'form', + 'param_callback': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_endpoint_parameters + ) + + def __test_enum_parameters(self, **kwargs): # noqa: E501 + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_enum_parameters(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [str] enum_header_string_array: Header parameter enum test (string array) + :param str enum_header_string: Header parameter enum test (string) + :param [str] enum_query_string_array: Query parameter enum test (string array) + :param str enum_query_string: Query parameter enum test (string) + :param int enum_query_integer: Query parameter enum test (double) + :param float enum_query_double: Query parameter enum test (double) + :param [str] enum_form_string_array: Form parameter enum test (string array) + :param str enum_form_string: Form parameter enum test (string) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.test_enum_parameters = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake', + 'operation_id': 'test_enum_parameters', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'enum_header_string_array', + 'enum_header_string', + 'enum_query_string_array', + 'enum_query_string', + 'enum_query_integer', + 'enum_query_double', + 'enum_form_string_array', + 'enum_form_string', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + 'enum_header_string_array', + 'enum_header_string', + 'enum_query_string_array', + 'enum_query_string', + 'enum_query_integer', + 'enum_query_double', + 'enum_form_string_array', + 'enum_form_string', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('enum_header_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_header_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + ('enum_query_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_query_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + ('enum_query_integer',): { + + "1": 1, + "-2": -2 + }, + ('enum_query_double',): { + + "1.1": 1.1, + "-1.2": -1.2 + }, + ('enum_form_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_form_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + }, + 'openapi_types': { + 'enum_header_string_array': + ([str],), + 'enum_header_string': + (str,), + 'enum_query_string_array': + ([str],), + 'enum_query_string': + (str,), + 'enum_query_integer': + (int,), + 'enum_query_double': + (float,), + 'enum_form_string_array': + ([str],), + 'enum_form_string': + (str,), + }, + 'attribute_map': { + 'enum_header_string_array': 'enum_header_string_array', + 'enum_header_string': 'enum_header_string', + 'enum_query_string_array': 'enum_query_string_array', + 'enum_query_string': 'enum_query_string', + 'enum_query_integer': 'enum_query_integer', + 'enum_query_double': 'enum_query_double', + 'enum_form_string_array': 'enum_form_string_array', + 'enum_form_string': 'enum_form_string', + }, + 'location_map': { + 'enum_header_string_array': 'header', + 'enum_header_string': 'header', + 'enum_query_string_array': 'query', + 'enum_query_string': 'query', + 'enum_query_integer': 'query', + 'enum_query_double': 'query', + 'enum_form_string_array': 'form', + 'enum_form_string': 'form', + }, + 'collection_format_map': { + 'enum_header_string_array': 'csv', + 'enum_query_string_array': 'multi', + 'enum_form_string_array': 'csv', + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_enum_parameters + ) + + def __test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 + """Fake endpoint to test group parameters (optional) # noqa: E501 + + Fake endpoint to test group parameters (optional) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int required_string_group: Required String in group parameters (required) + :param bool required_boolean_group: Required Boolean in group parameters (required) + :param int required_int64_group: Required Integer in group parameters (required) + :param int string_group: String in group parameters + :param bool boolean_group: Boolean in group parameters + :param int int64_group: Integer in group parameters + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['required_string_group'] = \ + required_string_group + kwargs['required_boolean_group'] = \ + required_boolean_group + kwargs['required_int64_group'] = \ + required_int64_group + return self.call_with_http_info(**kwargs) + + self.test_group_parameters = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'bearer_test' + ], + 'endpoint_path': '/fake', + 'operation_id': 'test_group_parameters', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'required_string_group', + 'required_boolean_group', + 'required_int64_group', + 'string_group', + 'boolean_group', + 'int64_group', + ], + 'required': [ + 'required_string_group', + 'required_boolean_group', + 'required_int64_group', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'required_string_group': + (int,), + 'required_boolean_group': + (bool,), + 'required_int64_group': + (int,), + 'string_group': + (int,), + 'boolean_group': + (bool,), + 'int64_group': + (int,), + }, + 'attribute_map': { + 'required_string_group': 'required_string_group', + 'required_boolean_group': 'required_boolean_group', + 'required_int64_group': 'required_int64_group', + 'string_group': 'string_group', + 'boolean_group': 'boolean_group', + 'int64_group': 'int64_group', + }, + 'location_map': { + 'required_string_group': 'query', + 'required_boolean_group': 'header', + 'required_int64_group': 'query', + 'string_group': 'query', + 'boolean_group': 'header', + 'int64_group': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__test_group_parameters + ) + + def __test_inline_additional_properties(self, request_body, **kwargs): # noqa: E501 + """test inline additionalProperties # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_inline_additional_properties(request_body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param {str: (str,)} request_body: request body (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['request_body'] = \ + request_body + return self.call_with_http_info(**kwargs) + + self.test_inline_additional_properties = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/inline-additionalProperties', + 'operation_id': 'test_inline_additional_properties', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'request_body', + ], + 'required': [ + 'request_body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'request_body': + ({str: (str,)},), + }, + 'attribute_map': { + }, + 'location_map': { + 'request_body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_inline_additional_properties + ) + + def __test_json_form_data(self, param, param2, **kwargs): # noqa: E501 + """test json serialization of form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_json_form_data(param, param2, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str param: field1 (required) + :param str param2: field2 (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['param'] = \ + param + kwargs['param2'] = \ + param2 + return self.call_with_http_info(**kwargs) + + self.test_json_form_data = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/jsonFormData', + 'operation_id': 'test_json_form_data', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'param', + 'param2', + ], + 'required': [ + 'param', + 'param2', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'param': + (str,), + 'param2': + (str,), + }, + 'attribute_map': { + 'param': 'param', + 'param2': 'param2', + }, + 'location_map': { + 'param': 'form', + 'param2': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_json_form_data + ) + + def __test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 + """test_query_parameter_collection_format # noqa: E501 + + To test the collection format in query parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [str] pipe: (required) + :param [str] ioutil: (required) + :param [str] http: (required) + :param [str] url: (required) + :param [str] context: (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pipe'] = \ + pipe + kwargs['ioutil'] = \ + ioutil + kwargs['http'] = \ + http + kwargs['url'] = \ + url + kwargs['context'] = \ + context + return self.call_with_http_info(**kwargs) + + self.test_query_parameter_collection_format = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/test-query-paramters', + 'operation_id': 'test_query_parameter_collection_format', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'pipe', + 'ioutil', + 'http', + 'url', + 'context', + ], + 'required': [ + 'pipe', + 'ioutil', + 'http', + 'url', + 'context', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pipe': + ([str],), + 'ioutil': + ([str],), + 'http': + ([str],), + 'url': + ([str],), + 'context': + ([str],), + }, + 'attribute_map': { + 'pipe': 'pipe', + 'ioutil': 'ioutil', + 'http': 'http', + 'url': 'url', + 'context': 'context', + }, + 'location_map': { + 'pipe': 'query', + 'ioutil': 'query', + 'http': 'query', + 'url': 'query', + 'context': 'query', + }, + 'collection_format_map': { + 'pipe': 'multi', + 'ioutil': 'csv', + 'http': 'space', + 'url': 'csv', + 'context': 'multi', + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__test_query_parameter_collection_format + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py new file mode 100644 index 00000000000..90da061d2d9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -0,0 +1,380 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 +import sys # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models import client + + +class FakeClassnameTags123Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __test_classname(self, client_client, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_classname(client_client, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param client.Client client_client: client model (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: client.Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['client_client'] = \ + client_client + return self.call_with_http_info(**kwargs) + + self.test_classname = Endpoint( + settings={ + 'response_type': (client.Client,), + 'auth': [ + 'api_key_query' + ], + 'endpoint_path': '/fake_classname_test', + 'operation_id': 'test_classname', + 'http_method': 'PATCH', + 'servers': [], + }, + params_map={ + 'all': [ + 'client_client', + ], + 'required': [ + 'client_client', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'client_client': + (client.Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'client_client': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_classname + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py new file mode 100644 index 00000000000..9d890ef25f2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -0,0 +1,1319 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 +import sys # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models import pet +from petstore_api.models import api_response + + +class PetApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __add_pet(self, pet_pet, **kwargs): # noqa: E501 + """Add a new pet to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_pet(pet_pet, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param pet.Pet pet_pet: Pet object that needs to be added to the store (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_pet'] = \ + pet_pet + return self.call_with_http_info(**kwargs) + + self.add_pet = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet', + 'operation_id': 'add_pet', + 'http_method': 'POST', + 'servers': [ + 'http://petstore.swagger.io/v2', + 'http://path-server-test.petstore.local/v2' + ] + }, + params_map={ + 'all': [ + 'pet_pet', + ], + 'required': [ + 'pet_pet', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_pet': + (pet.Pet,), + }, + 'attribute_map': { + }, + 'location_map': { + 'pet_pet': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json', + 'application/xml' + ] + }, + api_client=api_client, + callable=__add_pet + ) + + def __delete_pet(self, pet_id, **kwargs): # noqa: E501 + """Deletes a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_pet(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: Pet id to delete (required) + :param str api_key: + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.delete_pet = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'delete_pet', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'api_key', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': + (int,), + 'api_key': + (str,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'api_key': 'api_key', + }, + 'location_map': { + 'pet_id': 'path', + 'api_key': 'header', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_pet + ) + + def __find_pets_by_status(self, status, **kwargs): # noqa: E501 + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_status(status, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [str] status: Status values that need to be considered for filter (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: [pet.Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['status'] = \ + status + return self.call_with_http_info(**kwargs) + + self.find_pets_by_status = Endpoint( + settings={ + 'response_type': ([pet.Pet],), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/findByStatus', + 'operation_id': 'find_pets_by_status', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'status', + ], + 'required': [ + 'status', + ], + 'nullable': [ + ], + 'enum': [ + 'status', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('status',): { + + "AVAILABLE": "available", + "PENDING": "pending", + "SOLD": "sold" + }, + }, + 'openapi_types': { + 'status': + ([str],), + }, + 'attribute_map': { + 'status': 'status', + }, + 'location_map': { + 'status': 'query', + }, + 'collection_format_map': { + 'status': 'csv', + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__find_pets_by_status + ) + + def __find_pets_by_tags(self, tags, **kwargs): # noqa: E501 + """Finds Pets by tags # noqa: E501 + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_tags(tags, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [str] tags: Tags to filter by (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: [pet.Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['tags'] = \ + tags + return self.call_with_http_info(**kwargs) + + self.find_pets_by_tags = Endpoint( + settings={ + 'response_type': ([pet.Pet],), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/findByTags', + 'operation_id': 'find_pets_by_tags', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'tags', + ], + 'required': [ + 'tags', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'tags': + ([str],), + }, + 'attribute_map': { + 'tags': 'tags', + }, + 'location_map': { + 'tags': 'query', + }, + 'collection_format_map': { + 'tags': 'csv', + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__find_pets_by_tags + ) + + def __get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_pet_by_id(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: ID of pet to return (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: pet.Pet + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.get_pet_by_id = Endpoint( + settings={ + 'response_type': (pet.Pet,), + 'auth': [ + 'api_key' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'get_pet_by_id', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': + (int,), + }, + 'attribute_map': { + 'pet_id': 'petId', + }, + 'location_map': { + 'pet_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_pet_by_id + ) + + def __update_pet(self, pet_pet, **kwargs): # noqa: E501 + """Update an existing pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet(pet_pet, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param pet.Pet pet_pet: Pet object that needs to be added to the store (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_pet'] = \ + pet_pet + return self.call_with_http_info(**kwargs) + + self.update_pet = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet', + 'operation_id': 'update_pet', + 'http_method': 'PUT', + 'servers': [ + 'http://petstore.swagger.io/v2', + 'http://path-server-test.petstore.local/v2' + ] + }, + params_map={ + 'all': [ + 'pet_pet', + ], + 'required': [ + 'pet_pet', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_pet': + (pet.Pet,), + }, + 'attribute_map': { + }, + 'location_map': { + 'pet_pet': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json', + 'application/xml' + ] + }, + api_client=api_client, + callable=__update_pet + ) + + def __update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 + """Updates a pet in the store with form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet_with_form(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: ID of pet that needs to be updated (required) + :param str name: Updated name of the pet + :param str status: Updated status of the pet + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.update_pet_with_form = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'update_pet_with_form', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'name', + 'status', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': + (int,), + 'name': + (str,), + 'status': + (str,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'name': 'name', + 'status': 'status', + }, + 'location_map': { + 'pet_id': 'path', + 'name': 'form', + 'status': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__update_pet_with_form + ) + + def __upload_file(self, pet_id, **kwargs): # noqa: E501 + """uploads an image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: ID of pet to update (required) + :param str additional_metadata: Additional data to pass to server + :param file_type file: file to upload + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: api_response.ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.upload_file = Endpoint( + settings={ + 'response_type': (api_response.ApiResponse,), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}/uploadImage', + 'operation_id': 'upload_file', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'additional_metadata', + 'file', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': + (int,), + 'additional_metadata': + (str,), + 'file': + (file_type,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'additional_metadata': 'additionalMetadata', + 'file': 'file', + }, + 'location_map': { + 'pet_id': 'path', + 'additional_metadata': 'form', + 'file': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'multipart/form-data' + ] + }, + api_client=api_client, + callable=__upload_file + ) + + def __upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501 + """uploads an image (required) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: ID of pet to update (required) + :param file_type required_file: file to upload (required) + :param str additional_metadata: Additional data to pass to server + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: api_response.ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = \ + pet_id + kwargs['required_file'] = \ + required_file + return self.call_with_http_info(**kwargs) + + self.upload_file_with_required_file = Endpoint( + settings={ + 'response_type': (api_response.ApiResponse,), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/fake/{petId}/uploadImageWithRequiredFile', + 'operation_id': 'upload_file_with_required_file', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'required_file', + 'additional_metadata', + ], + 'required': [ + 'pet_id', + 'required_file', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': + (int,), + 'required_file': + (file_type,), + 'additional_metadata': + (str,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'required_file': 'requiredFile', + 'additional_metadata': 'additionalMetadata', + }, + 'location_map': { + 'pet_id': 'path', + 'required_file': 'form', + 'additional_metadata': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'multipart/form-data' + ] + }, + api_client=api_client, + callable=__upload_file_with_required_file + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py new file mode 100644 index 00000000000..c45745f3e52 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -0,0 +1,699 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 +import sys # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models import order + + +class StoreApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __delete_order(self, order_id, **kwargs): # noqa: E501 + """Delete purchase order by ID # noqa: E501 + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_order(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str order_id: ID of the order that needs to be deleted (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['order_id'] = \ + order_id + return self.call_with_http_info(**kwargs) + + self.delete_order = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/store/order/{order_id}', + 'operation_id': 'delete_order', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'order_id', + ], + 'required': [ + 'order_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'order_id': + (str,), + }, + 'attribute_map': { + 'order_id': 'order_id', + }, + 'location_map': { + 'order_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_order + ) + + def __get_inventory(self, **kwargs): # noqa: E501 + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_inventory(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: {str: (int,)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.get_inventory = Endpoint( + settings={ + 'response_type': ({str: (int,)},), + 'auth': [ + 'api_key' + ], + 'endpoint_path': '/store/inventory', + 'operation_id': 'get_inventory', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_inventory + ) + + def __get_order_by_id(self, order_id, **kwargs): # noqa: E501 + """Find purchase order by ID # noqa: E501 + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_order_by_id(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int order_id: ID of pet that needs to be fetched (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: order.Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['order_id'] = \ + order_id + return self.call_with_http_info(**kwargs) + + self.get_order_by_id = Endpoint( + settings={ + 'response_type': (order.Order,), + 'auth': [], + 'endpoint_path': '/store/order/{order_id}', + 'operation_id': 'get_order_by_id', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'order_id', + ], + 'required': [ + 'order_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'order_id', + ] + }, + root_map={ + 'validations': { + ('order_id',): { + + 'inclusive_maximum': 5, + 'inclusive_minimum': 1, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'order_id': + (int,), + }, + 'attribute_map': { + 'order_id': 'order_id', + }, + 'location_map': { + 'order_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_order_by_id + ) + + def __place_order(self, order_order, **kwargs): # noqa: E501 + """Place an order for a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.place_order(order_order, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param order.Order order_order: order placed for purchasing the pet (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: order.Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['order_order'] = \ + order_order + return self.call_with_http_info(**kwargs) + + self.place_order = Endpoint( + settings={ + 'response_type': (order.Order,), + 'auth': [], + 'endpoint_path': '/store/order', + 'operation_id': 'place_order', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'order_order', + ], + 'required': [ + 'order_order', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'order_order': + (order.Order,), + }, + 'attribute_map': { + }, + 'location_map': { + 'order_order': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__place_order + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py new file mode 100644 index 00000000000..141520baa7e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -0,0 +1,1130 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 +import sys # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models import user + + +class UserApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __create_user(self, user_user, **kwargs): # noqa: E501 + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_user(user_user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param user.User user_user: Created user object (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['user_user'] = \ + user_user + return self.call_with_http_info(**kwargs) + + self.create_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user', + 'operation_id': 'create_user', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'user_user', + ], + 'required': [ + 'user_user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'user_user': + (user.User,), + }, + 'attribute_map': { + }, + 'location_map': { + 'user_user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__create_user + ) + + def __create_users_with_array_input(self, user_user, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_array_input(user_user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [user.User] user_user: List of user object (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['user_user'] = \ + user_user + return self.call_with_http_info(**kwargs) + + self.create_users_with_array_input = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/createWithArray', + 'operation_id': 'create_users_with_array_input', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'user_user', + ], + 'required': [ + 'user_user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'user_user': + ([user.User],), + }, + 'attribute_map': { + }, + 'location_map': { + 'user_user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__create_users_with_array_input + ) + + def __create_users_with_list_input(self, user_user, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_list_input(user_user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [user.User] user_user: List of user object (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['user_user'] = \ + user_user + return self.call_with_http_info(**kwargs) + + self.create_users_with_list_input = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/createWithList', + 'operation_id': 'create_users_with_list_input', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'user_user', + ], + 'required': [ + 'user_user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'user_user': + ([user.User],), + }, + 'attribute_map': { + }, + 'location_map': { + 'user_user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__create_users_with_list_input + ) + + def __delete_user(self, username, **kwargs): # noqa: E501 + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_user(username, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str username: The name that needs to be deleted (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['username'] = \ + username + return self.call_with_http_info(**kwargs) + + self.delete_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'delete_user', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + ], + 'required': [ + 'username', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': + (str,), + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_user + ) + + def __get_user_by_name(self, username, **kwargs): # noqa: E501 + """Get user by user name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_by_name(username, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: user.User + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['username'] = \ + username + return self.call_with_http_info(**kwargs) + + self.get_user_by_name = Endpoint( + settings={ + 'response_type': (user.User,), + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'get_user_by_name', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + ], + 'required': [ + 'username', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': + (str,), + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_user_by_name + ) + + def __login_user(self, username, password, **kwargs): # noqa: E501 + """Logs user into the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.login_user(username, password, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str username: The user name for login (required) + :param str password: The password for login in clear text (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['username'] = \ + username + kwargs['password'] = \ + password + return self.call_with_http_info(**kwargs) + + self.login_user = Endpoint( + settings={ + 'response_type': (str,), + 'auth': [], + 'endpoint_path': '/user/login', + 'operation_id': 'login_user', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + 'password', + ], + 'required': [ + 'username', + 'password', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': + (str,), + 'password': + (str,), + }, + 'attribute_map': { + 'username': 'username', + 'password': 'password', + }, + 'location_map': { + 'username': 'query', + 'password': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__login_user + ) + + def __logout_user(self, **kwargs): # noqa: E501 + """Logs out current logged in user session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.logout_user(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.logout_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/logout', + 'operation_id': 'logout_user', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__logout_user + ) + + def __update_user(self, username, user_user, **kwargs): # noqa: E501 + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_user(username, user_user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str username: name that need to be deleted (required) + :param user.User user_user: Updated user object (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['username'] = \ + username + kwargs['user_user'] = \ + user_user + return self.call_with_http_info(**kwargs) + + self.update_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'update_user', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + 'user_user', + ], + 'required': [ + 'username', + 'user_user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': + (str,), + 'user_user': + (user.User,), + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + 'user_user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__update_user + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py new file mode 100644 index 00000000000..d3e808ddf40 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py @@ -0,0 +1,535 @@ +# coding: utf-8 +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +from __future__ import absolute_import + +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from petstore_api import rest +from petstore_api.configuration import Configuration +from petstore_api.exceptions import ApiValueError +from petstore_api.model_utils import ( + ModelNormal, + ModelSimple, + date, + datetime, + deserialize_file, + file_type, + model_to_dict, + str, + validate_and_convert_types +) + + +class ApiClient(object): + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + # six.binary_type python2=str, python3=bytes + # six.text_type python2=unicode, python3=str + PRIMITIVE_TYPES = ( + (float, bool, six.binary_type, six.text_type) + six.integer_types + ) + _pool = None + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None, pool_threads=1): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + self.pool_threads = pool_threads + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/1.0.0/python' + + def __del__(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + self._pool = ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None, + _check_type=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize( + response_data, + response_type, + _check_type + ) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime, date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + elif isinstance(obj, ModelNormal): + # Convert model obj to dict + # Convert attribute name to json key in + # model definition for request + obj_dict = model_to_dict(obj, serialize=True) + elif isinstance(obj, ModelSimple): + return self.sanitize_for_serialization(obj.value) + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type, _check_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: For the response, a tuple containing: + valid classes + a list containing valid classes (for list schemas) + a dict containing a tuple of valid classes as the value + Example values: + (str,) + (Pet,) + (float, none_type) + ([int, none_type],) + ({str: (bool, str, int, float, date, datetime, str, none_type)},) + :param _check_type: boolean, whether to check the types of the data + received from the server + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == (file_type,): + content_disposition = response.getheader("Content-Disposition") + return deserialize_file(response.data, self.configuration, + content_disposition=content_disposition) + + # fetch data from response object + try: + received_data = json.loads(response.data) + except ValueError: + received_data = response.data + + # store our data under the key of 'received_data' so users have some + # context if they are deserializing a string and the data type is wrong + deserialized_data = validate_and_convert_types( + received_data, + response_type, + ['received_data'], + True, + _check_type, + configuration=self.configuration + ) + return deserialized_data + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None, + _check_type=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response_type: For the response, a tuple containing: + valid classes + a list containing valid classes (for list schemas) + a dict containing a tuple of valid classes as the value + Example values: + (str,) + (Pet,) + (float, none_type) + ([int, none_type],) + ({str: (bool, str, int, float, date, datetime, str, none_type)},) + :param files dict: key -> field name, value -> a list of open file + objects for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _check_type: boolean describing if the data back from the server + should have its type checked. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout, _host, + _check_type) + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, + query_params, + header_params, body, + post_params, files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, _check_type)) + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def files_parameters(self, files=None): + """Builds form parameters. + + :param files: None or a dict with key=param_name and + value is a list of open file objects + :return: List of tuples of form parameters with file data + """ + if files is None: + return [] + + params = [] + for param_name, file_instances in six.iteritems(files): + if file_instances is None: + # if the file field is nullable, skip None values + continue + for file_instance in file_instances: + if file_instance is None: + # if the file field is nullable, skip None values + continue + if file_instance.closed is True: + raise ApiValueError( + "Cannot read a closed file. The passed in file_type " + "for %s must be open." % param_name + ) + filename = os.path.basename(file_instance.name) + filedata = file_instance.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([param_name, tuple([filename, filedata, mimetype])])) + file_instance.close() + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py new file mode 100644 index 00000000000..60cb525776a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py @@ -0,0 +1,406 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import logging +import multiprocessing +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class Configuration(object): + """NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + + :Example: + + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + conf = petstore_api.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} + ) + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + """ + + def __init__(self, host="http://petstore.swagger.io:80/v2", + api_key=None, api_key_prefix=None, + username=None, password=None): + """Constructor + """ + self.host = host + """Default Base url + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = "" + """access token for OAuth/Bearer + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("petstore_api") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = None + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Disable client side validation + self.client_side_validation = True + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + if 'api_key' in self.api_key: + auth['api_key'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'api_key', + 'value': self.get_api_key_with_prefix('api_key') + } + if 'api_key_query' in self.api_key: + auth['api_key_query'] = { + 'type': 'api_key', + 'in': 'query', + 'key': 'api_key_query', + 'value': self.get_api_key_with_prefix('api_key_query') + } + if self.access_token is not None: + auth['bearer_test'] = { + 'type': 'bearer', + 'in': 'header', + 'format': 'JWT', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + if self.username is not None and self.password is not None: + auth['http_basic_test'] = { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_basic_auth_token() + } + if self.access_token is not None: + auth['petstore_auth'] = { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "http://{server}.swagger.io:{port}/v2", + 'description': "petstore server", + 'variables': { + 'server': { + 'description': "No description provided", + 'default_value': "petstore", + 'enum_values': [ + "petstore", + "qa-petstore", + "dev-petstore" + ] + }, + 'port': { + 'description': "No description provided", + 'default_value': "80", + 'enum_values': [ + "80", + "8080" + ] + } + } + }, + { + 'url': "https://localhost:8080/{version}", + 'description': "The local server", + 'variables': { + 'version': { + 'description': "No description provided", + 'default_value': "v2", + 'enum_values': [ + "v1", + "v2" + ] + } + } + } + ] + + def get_host_from_settings(self, index, variables=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :return: URL based on host settings + """ + variables = {} if variables is None else variables + servers = self.get_host_settings() + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server['variables'].items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py new file mode 100644 index 00000000000..100be3e0540 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import six + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, six.integer_types): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py new file mode 100644 index 00000000000..6d6a88edb7e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py @@ -0,0 +1,1393 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from datetime import date, datetime # noqa: F401 +import inspect +import os +import pprint +import re +import tempfile + +from dateutil.parser import parse +import six + +from petstore_api.exceptions import ( + ApiKeyError, + ApiTypeError, + ApiValueError, +) + +none_type = type(None) +if six.PY3: + import io + file_type = io.IOBase + # these are needed for when other modules import str and int from here + str = str + int = int +else: + file_type = file # noqa: F821 + str_py2 = str + unicode_py2 = unicode # noqa: F821 + long_py2 = long # noqa: F821 + int_py2 = int + # this requires that the future library is installed + from builtins import int, str + + +class OpenApiModel(object): + """The base class for all OpenAPIModels""" + + def set_attribute(self, name, value): + # this is only used to set properties on self + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + openapi_types = self.openapi_types() + if name in openapi_types: + required_types_mixed = openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self.__dict__['_data_store'][name] = value + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__setattr__(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__getattr__(name) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other + + +class ModelSimple(OpenApiModel): + """the parent class of models whose type != object in their + swagger/openapi""" + + def __setattr__(self, name, value): + """this allows us to set a value with instance.field_name = val""" + if name in self.required_properties: + self.__dict__[name] = value + return + + self.set_attribute(name, value) + + def __getattr__(self, name): + """this allows us to get a value with val = instance.field_name""" + if name in self.required_properties: + return self.__dict__[name] + + if name in self.__dict__['_data_store']: + return self.__dict__['_data_store'][name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def to_str(self): + """Returns the string representation of the model""" + return str(self.value) + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, self.__class__): + return False + + this_val = self._data_store['value'] + that_val = other._data_store['value'] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + +class ModelNormal(OpenApiModel): + """the parent class of models whose type == object in their + swagger/openapi""" + + def __setattr__(self, name, value): + """this allows us to set a value with instance.field_name = val""" + if name in self.required_properties: + self.__dict__[name] = value + return + + self.set_attribute(name, value) + + def __getattr__(self, name): + """this allows us to get a value with val = instance.field_name""" + if name in self.required_properties: + return self.__dict__[name] + + if name in self.__dict__['_data_store']: + return self.__dict__['_data_store'][name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, self.__class__): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + +class ModelComposed(OpenApiModel): + """the parent class of models whose type == object in their + swagger/openapi and have oneOf/allOf/anyOf""" + + def __setattr__(self, name, value): + """this allows us to set a value with instance.field_name = val""" + if name in self.required_properties: + self.__dict__[name] = value + return + + # set the attribute on the correct instance + model_instances = self._var_name_to_model_instances.get( + name, self._additional_properties_model_instances) + if model_instances: + for model_instance in model_instances: + if model_instance == self: + self.set_attribute(name, value) + else: + setattr(model_instance, name, value) + if name not in self._var_name_to_model_instances: + # we assigned an additional property + self.__dict__['_var_name_to_model_instances'][name] = ( + model_instance + ) + return None + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + + def __getattr__(self, name): + """this allows us to get a value with val = instance.field_name""" + if name in self.required_properties: + return self.__dict__[name] + + # get the attribute from the correct instance + model_instances = self._var_name_to_model_instances.get( + name, self._additional_properties_model_instances) + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + if model_instances: + values = set() + for model_instance in model_instances: + if name in model_instance._data_store: + values.add(model_instance._data_store[name]) + if len(values) == 1: + return list(values)[0] + raise ApiValueError( + "Values stored for property {0} in {1} difffer when looking " + "at self and self's composed instances. All values must be " + "the same".format(name, type(self).__name__), + path_to_item + ) + + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, self.__class__): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + +COERCION_INDEX_BY_TYPE = { + ModelComposed: 0, + ModelNormal: 1, + ModelSimple: 2, + none_type: 3, + list: 4, + dict: 5, + float: 6, + int: 7, + bool: 8, + datetime: 9, + date: 10, + str: 11, + file_type: 12, +} + +# these are used to limit what type conversions we try to do +# when we have a valid type already and we want to try converting +# to another type +UPCONVERSION_TYPE_PAIRS = ( + (str, datetime), + (str, date), + (list, ModelComposed), + (dict, ModelComposed), + (list, ModelNormal), + (dict, ModelNormal), + (str, ModelSimple), + (int, ModelSimple), + (float, ModelSimple), + (list, ModelSimple), +) + +COERCIBLE_TYPE_PAIRS = { + False: ( # client instantiation of a model with client data + # (dict, ModelComposed), + # (list, ModelComposed), + # (dict, ModelNormal), + # (list, ModelNormal), + # (str, ModelSimple), + # (int, ModelSimple), + # (float, ModelSimple), + # (list, ModelSimple), + # (str, int), + # (str, float), + # (str, datetime), + # (str, date), + # (int, str), + # (float, str), + ), + True: ( # server -> client data + (dict, ModelComposed), + (list, ModelComposed), + (dict, ModelNormal), + (list, ModelNormal), + (str, ModelSimple), + (int, ModelSimple), + (float, ModelSimple), + (list, ModelSimple), + # (str, int), + # (str, float), + (str, datetime), + (str, date), + # (int, str), + # (float, str), + (str, file_type) + ), +} + + +def get_simple_class(input_value): + """Returns an input_value's simple class that we will use for type checking + Python2: + float and int will return int, where int is the python3 int backport + str and unicode will return str, where str is the python3 str backport + Note: float and int ARE both instances of int backport + Note: str_py2 and unicode_py2 are NOT both instances of str backport + + Args: + input_value (class/class_instance): the item for which we will return + the simple class + """ + if isinstance(input_value, type): + # input_value is a class + return input_value + elif isinstance(input_value, tuple): + return tuple + elif isinstance(input_value, list): + return list + elif isinstance(input_value, dict): + return dict + elif isinstance(input_value, none_type): + return none_type + elif isinstance(input_value, file_type): + return file_type + elif isinstance(input_value, bool): + # this must be higher than the int check because + # isinstance(True, int) == True + return bool + elif isinstance(input_value, int): + # for python2 input_value==long_instance -> return int + # where int is the python3 int backport + return int + elif isinstance(input_value, datetime): + # this must be higher than the date check because + # isinstance(datetime_instance, date) == True + return datetime + elif isinstance(input_value, date): + return date + elif (six.PY2 and isinstance(input_value, (str_py2, unicode_py2, str)) or + isinstance(input_value, str)): + return str + return type(input_value) + + +def check_allowed_values(allowed_values, input_variable_path, input_values): + """Raises an exception if the input_values are not allowed + + Args: + allowed_values (dict): the allowed_values dict + input_variable_path (tuple): the path to the input variable + input_values (list/str/int/float/date/datetime): the values that we + are checking to see if they are in allowed_values + """ + these_allowed_values = list(allowed_values[input_variable_path].values()) + if (isinstance(input_values, list) + and not set(input_values).issubset( + set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values) - set(these_allowed_values))), + raise ApiValueError( + "Invalid values for `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) + ) + elif (isinstance(input_values, dict) + and not set( + input_values.keys()).issubset(set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values.keys()) - set(these_allowed_values))) + raise ApiValueError( + "Invalid keys in `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) + ) + elif (not isinstance(input_values, (list, dict)) + and input_values not in these_allowed_values): + raise ApiValueError( + "Invalid value for `%s` (%s), must be one of %s" % + ( + input_variable_path[0], + input_values, + these_allowed_values + ) + ) + + +def check_validations(validations, input_variable_path, input_values): + """Raises an exception if the input_values are invalid + + Args: + validations (dict): the validation dictionary + input_variable_path (tuple): the path to the input variable + input_values (list/str/int/float/date/datetime): the values that we + are checking + """ + current_validations = validations[input_variable_path] + if ('max_length' in current_validations and + len(input_values) > current_validations['max_length']): + raise ApiValueError( + "Invalid value for `%s`, length must be less than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['max_length'] + ) + ) + + if ('min_length' in current_validations and + len(input_values) < current_validations['min_length']): + raise ApiValueError( + "Invalid value for `%s`, length must be greater than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['min_length'] + ) + ) + + if ('max_items' in current_validations and + len(input_values) > current_validations['max_items']): + raise ApiValueError( + "Invalid value for `%s`, number of items must be less than or " + "equal to `%s`" % ( + input_variable_path[0], + current_validations['max_items'] + ) + ) + + if ('min_items' in current_validations and + len(input_values) < current_validations['min_items']): + raise ValueError( + "Invalid value for `%s`, number of items must be greater than or " + "equal to `%s`" % ( + input_variable_path[0], + current_validations['min_items'] + ) + ) + + items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', + 'inclusive_minimum') + if (any(item in current_validations for item in items)): + if isinstance(input_values, list): + max_val = max(input_values) + min_val = min(input_values) + elif isinstance(input_values, dict): + max_val = max(input_values.values()) + min_val = min(input_values.values()) + else: + max_val = input_values + min_val = input_values + + if ('exclusive_maximum' in current_validations and + max_val >= current_validations['exclusive_maximum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value less than `%s`" % ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) + ) + + if ('inclusive_maximum' in current_validations and + max_val > current_validations['inclusive_maximum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value less than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['inclusive_maximum'] + ) + ) + + if ('exclusive_minimum' in current_validations and + min_val <= current_validations['exclusive_minimum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value greater than `%s`" % + ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) + ) + + if ('inclusive_minimum' in current_validations and + min_val < current_validations['inclusive_minimum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value greater than or equal " + "to `%s`" % ( + input_variable_path[0], + current_validations['inclusive_minimum'] + ) + ) + flags = current_validations.get('regex', {}).get('flags', 0) + if ('regex' in current_validations and + not re.search(current_validations['regex']['pattern'], + input_values, flags=flags)): + raise ApiValueError( + r"Invalid value for `%s`, must be a follow pattern or equal to " + r"`%s` with flags=`%s`" % ( + input_variable_path[0], + current_validations['regex']['pattern'], + flags + ) + ) + + +def order_response_types(required_types): + """Returns the required types sorted in coercion order + + Args: + required_types (list/tuple): collection of classes or instance of + list or dict with classs information inside it + + Returns: + (list): coercion order sorted collection of classes or instance + of list or dict with classs information inside it + """ + + def index_getter(class_or_instance): + if isinstance(class_or_instance, list): + return COERCION_INDEX_BY_TYPE[list] + elif isinstance(class_or_instance, dict): + return COERCION_INDEX_BY_TYPE[dict] + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelComposed)): + return COERCION_INDEX_BY_TYPE[ModelComposed] + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelNormal)): + return COERCION_INDEX_BY_TYPE[ModelNormal] + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelSimple)): + return COERCION_INDEX_BY_TYPE[ModelSimple] + return COERCION_INDEX_BY_TYPE[class_or_instance] + + sorted_types = sorted( + required_types, + key=lambda class_or_instance: index_getter(class_or_instance) + ) + return sorted_types + + +def remove_uncoercible(required_types_classes, current_item, from_server, + must_convert=True): + """Only keeps the type conversions that are possible + + Args: + required_types_classes (tuple): tuple of classes that are required + these should be ordered by COERCION_INDEX_BY_TYPE + from_server (bool): a boolean of whether the data is from the server + if false, the data is from the client + current_item (any): the current item to be converted + + Keyword Args: + must_convert (bool): if True the item to convert is of the wrong + type and we want a big list of coercibles + if False, we want a limited list of coercibles + + Returns: + (list): the remaining coercible required types, classes only + """ + current_type_simple = get_simple_class(current_item) + + results_classes = [] + for required_type_class in required_types_classes: + # convert our models to OpenApiModel + required_type_class_simplified = required_type_class + if isinstance(required_type_class_simplified, type): + if issubclass(required_type_class_simplified, ModelComposed): + required_type_class_simplified = ModelComposed + elif issubclass(required_type_class_simplified, ModelNormal): + required_type_class_simplified = ModelNormal + elif issubclass(required_type_class_simplified, ModelSimple): + required_type_class_simplified = ModelSimple + + if required_type_class_simplified == current_type_simple: + # don't consider converting to one's own class + continue + + class_pair = (current_type_simple, required_type_class_simplified) + if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[from_server]: + results_classes.append(required_type_class) + elif class_pair in UPCONVERSION_TYPE_PAIRS: + results_classes.append(required_type_class) + return results_classes + + +def get_required_type_classes(required_types_mixed): + """Converts the tuple required_types into a tuple and a dict described + below + + Args: + required_types_mixed (tuple/list): will contain either classes or + instance of list or dict + + Returns: + (valid_classes, dict_valid_class_to_child_types_mixed): + valid_classes (tuple): the valid classes that the current item + should be + dict_valid_class_to_child_types_mixed (doct): + valid_class (class): this is the key + child_types_mixed (list/dict/tuple): describes the valid child + types + """ + valid_classes = [] + child_req_types_by_current_type = {} + for required_type in required_types_mixed: + if isinstance(required_type, list): + valid_classes.append(list) + child_req_types_by_current_type[list] = required_type + elif isinstance(required_type, tuple): + valid_classes.append(tuple) + child_req_types_by_current_type[tuple] = required_type + elif isinstance(required_type, dict): + valid_classes.append(dict) + child_req_types_by_current_type[dict] = required_type[str] + else: + valid_classes.append(required_type) + return tuple(valid_classes), child_req_types_by_current_type + + +def change_keys_js_to_python(input_dict, model_class): + """ + Converts from javascript_key keys in the input_dict to python_keys in + the output dict using the mapping in model_class + """ + + output_dict = {} + reversed_attr_map = {value: key for key, value in + six.iteritems(model_class.attribute_map)} + for javascript_key, value in six.iteritems(input_dict): + python_key = reversed_attr_map.get(javascript_key) + if python_key is None: + # if the key is unknown, it is in error or it is an + # additionalProperties variable + python_key = javascript_key + output_dict[python_key] = value + return output_dict + + +def get_type_error(var_value, path_to_item, valid_classes, key_type=False): + error_msg = type_error_message( + var_name=path_to_item[-1], + var_value=var_value, + valid_classes=valid_classes, + key_type=key_type + ) + return ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=valid_classes, + key_type=key_type + ) + + +def deserialize_primitive(data, klass, path_to_item): + """Deserializes string to primitive type. + + :param data: str/int/float + :param klass: str/class the class to convert to + + :return: int, float, str, bool, date, datetime + """ + additional_message = "" + try: + if klass in {datetime, date}: + additional_message = ( + "If you need your parameter to have a fallback " + "string value, please set its type as `type: {}` in your " + "spec. That allows the value to be any type. " + ) + if klass == datetime: + if len(data) < 8: + raise ValueError("This is not a datetime") + # The string should be in iso8601 datetime format. + parsed_datetime = parse(data) + date_only = ( + parsed_datetime.hour == 0 and + parsed_datetime.minute == 0 and + parsed_datetime.second == 0 and + parsed_datetime.tzinfo is None and + 8 <= len(data) <= 10 + ) + if date_only: + raise ValueError("This is a date, not a datetime") + return parsed_datetime + elif klass == date: + if len(data) < 8: + raise ValueError("This is not a date") + return parse(data).date() + else: + converted_value = klass(data) + if isinstance(data, str) and klass == float: + if str(converted_value) != data: + # '7' -> 7.0 -> '7.0' != '7' + raise ValueError('This is not a float') + return converted_value + except (OverflowError, ValueError): + # parse can raise OverflowError + raise ApiValueError( + "{0}Failed to parse {1} as {2}".format( + additional_message, repr(data), get_py3_class_name(klass) + ), + path_to_item=path_to_item + ) + + +def fix_model_input_data(model_data, model_class): + # this is only called on classes where the input data is a dict + fixed_model_data = change_keys_js_to_python( + model_data, + model_class + ) + if model_class._composed_schemas() is not None: + for allof_class in model_class._composed_schemas()['allOf']: + fixed_model_data = change_keys_js_to_python( + fixed_model_data, + allof_class + ) + return fixed_model_data + + +def deserialize_model(model_data, model_class, path_to_item, check_type, + configuration, from_server): + """Deserializes model_data to model instance. + + Args: + model_data (list/dict): data to instantiate the model + model_class (OpenApiModel): the model class + path_to_item (list): path to the model in the received data + check_type (bool): whether to check the data tupe for the values in + the model + configuration (Configuration): the instance to use to convert files + from_server (bool): True if the data is from the server + False if the data is from the client + + Returns: + model instance + + Raise: + ApiTypeError + ApiValueError + ApiKeyError + """ + + kw_args = dict(_check_type=check_type, + _path_to_item=path_to_item, + _configuration=configuration, + _from_server=from_server) + + used_model_class = model_class + if model_class.discriminator() is not None: + used_model_class = model_class.get_discriminator_class( + from_server, model_data) + + if issubclass(used_model_class, ModelSimple): + instance = used_model_class(value=model_data, **kw_args) + return instance + if isinstance(model_data, list): + instance = used_model_class(*model_data, **kw_args) + if isinstance(model_data, dict): + fixed_model_data = change_keys_js_to_python( + model_data, + used_model_class + ) + kw_args.update(fixed_model_data) + instance = used_model_class(**kw_args) + return instance + + +def deserialize_file(response_data, configuration, content_disposition=None): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + Args: + param response_data (str): the file data to write + configuration (Configuration): the instance to use to convert files + + Keyword Args: + content_disposition (str): the value of the Content-Disposition + header + + Returns: + (file_type): the deserialized file which is open + The user is responsible for closing and reading the file + """ + fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + if six.PY3 and isinstance(response_data, str): + # in python3 change str to bytes so we can write it + response_data = response_data.encode('utf-8') + f.write(response_data) + + f = open(path, "rb") + return f + + +def attempt_convert_item(input_value, valid_classes, path_to_item, + configuration, from_server, key_type=False, + must_convert=False, check_type=True): + """ + Args: + input_value (any): the data to convert + valid_classes (any): the classes that are valid + path_to_item (list): the path to the item to convert + configuration (Configuration): the instance to use to convert files + from_server (bool): True if data is from the server, False is data is + from the client + key_type (bool): if True we need to convert a key type (not supported) + must_convert (bool): if True we must convert + check_type (bool): if True we check the type or the returned data in + ModelComposed/ModelNormal/ModelSimple instances + + Returns: + instance (any) the fixed item + + Raises: + ApiTypeError + ApiValueError + ApiKeyError + """ + valid_classes_ordered = order_response_types(valid_classes) + valid_classes_coercible = remove_uncoercible( + valid_classes_ordered, input_value, from_server) + if not valid_classes_coercible or key_type: + # we do not handle keytype errors, json will take care + # of this for us + raise get_type_error(input_value, path_to_item, valid_classes, + key_type=key_type) + for valid_class in valid_classes_coercible: + try: + if issubclass(valid_class, OpenApiModel): + return deserialize_model(input_value, valid_class, + path_to_item, check_type, + configuration, from_server) + elif valid_class == file_type: + return deserialize_file(input_value, configuration) + return deserialize_primitive(input_value, valid_class, + path_to_item) + except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: + if must_convert: + raise conversion_exc + # if we have conversion errors when must_convert == False + # we ignore the exception and move on to the next class + continue + # we were unable to convert, must_convert == False + return input_value + + +def validate_and_convert_types(input_value, required_types_mixed, path_to_item, + from_server, _check_type, configuration=None): + """Raises a TypeError is there is a problem, otherwise returns value + + Args: + input_value (any): the data to validate/convert + required_types_mixed (list/dict/tuple): A list of + valid classes, or a list tuples of valid classes, or a dict where + the value is a tuple of value classes + path_to_item: (list) the path to the data being validated + this stores a list of keys or indices to get to the data being + validated + from_server (bool): True if data is from the server + False if data is from the client + _check_type: (boolean) if true, type will be checked and conversion + will be attempted. + configuration: (Configuration): the configuration class to use + when converting file_type items. + If passed, conversion will be attempted when possible + If not passed, no conversions will be attempted and + exceptions will be raised + + Returns: + the correctly typed value + + Raises: + ApiTypeError + """ + results = get_required_type_classes(required_types_mixed) + valid_classes, child_req_types_by_current_type = results + + input_class_simple = get_simple_class(input_value) + valid_type = input_class_simple in set(valid_classes) + if not valid_type: + if configuration: + # if input_value is not valid_type try to convert it + converted_instance = attempt_convert_item( + input_value, + valid_classes, + path_to_item, + configuration, + from_server, + key_type=False, + must_convert=True + ) + return converted_instance + else: + raise get_type_error(input_value, path_to_item, valid_classes, + key_type=False) + + # input_value's type is in valid_classes + if len(valid_classes) > 1 and configuration: + # there are valid classes which are not the current class + valid_classes_coercible = remove_uncoercible( + valid_classes, input_value, from_server, must_convert=False) + if valid_classes_coercible: + converted_instance = attempt_convert_item( + input_value, + valid_classes_coercible, + path_to_item, + configuration, + from_server, + key_type=False, + must_convert=False + ) + return converted_instance + + if child_req_types_by_current_type == {}: + # all types are of the required types and there are no more inner + # variables left to look at + return input_value + inner_required_types = child_req_types_by_current_type.get( + type(input_value) + ) + if inner_required_types is None: + # for this type, there are not more inner variables left to look at + return input_value + if isinstance(input_value, list): + if input_value == []: + # allow an empty list + return input_value + for index, inner_value in enumerate(input_value): + inner_path = list(path_to_item) + inner_path.append(index) + input_value[index] = validate_and_convert_types( + inner_value, + inner_required_types, + inner_path, + from_server, + _check_type, + configuration=configuration + ) + elif isinstance(input_value, dict): + if input_value == {}: + # allow an empty dict + return input_value + for inner_key, inner_val in six.iteritems(input_value): + inner_path = list(path_to_item) + inner_path.append(inner_key) + if get_simple_class(inner_key) != str: + raise get_type_error(inner_key, inner_path, valid_classes, + key_type=True) + input_value[inner_key] = validate_and_convert_types( + inner_val, + inner_required_types, + inner_path, + from_server, + _check_type, + configuration=configuration + ) + return input_value + + +def model_to_dict(model_instance, serialize=True): + """Returns the model properties as a dict + + Args: + model_instance (one of your model instances): the model instance that + will be converted to a dict. + + Keyword Args: + serialize (bool): if True, the keys in the dict will be values from + attribute_map + """ + result = {} + + model_instances = [model_instance] + if model_instance._composed_schemas() is not None: + model_instances = model_instance._composed_instances + for model_instance in model_instances: + for attr, value in six.iteritems(model_instance._data_store): + if serialize: + # we use get here because additional property key names do not + # exist in attribute_map + attr = model_instance.attribute_map.get(attr, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: model_to_dict(x, serialize=serialize) + if hasattr(x, '_data_store') else x, value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], + model_to_dict(item[1], serialize=serialize)) + if hasattr(item[1], '_data_store') else item, + value.items() + )) + elif hasattr(value, '_data_store'): + result[attr] = model_to_dict(value, serialize=serialize) + else: + result[attr] = value + + return result + + +def type_error_message(var_value=None, var_name=None, valid_classes=None, + key_type=None): + """ + Keyword Args: + var_value (any): the variable which has the type_error + var_name (str): the name of the variable which has the typ error + valid_classes (tuple): the accepted classes for current_item's + value + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + """ + key_or_value = 'value' + if key_type: + key_or_value = 'key' + valid_classes_phrase = get_valid_classes_phrase(valid_classes) + msg = ( + "Invalid type for variable '{0}'. Required {1} type {2} and " + "passed type was {3}".format( + var_name, + key_or_value, + valid_classes_phrase, + type(var_value).__name__, + ) + ) + return msg + + +def get_valid_classes_phrase(input_classes): + """Returns a string phrase describing what types are allowed + Note: Adds the extra valid classes in python2 + """ + all_classes = list(input_classes) + if six.PY2 and str in input_classes: + all_classes.extend([str_py2, unicode_py2]) + if six.PY2 and int in input_classes: + all_classes.extend([int_py2, long_py2]) + all_classes = sorted(all_classes, key=lambda cls: cls.__name__) + all_class_names = [cls.__name__ for cls in all_classes] + if len(all_class_names) == 1: + return 'is {0}'.format(all_class_names[0]) + return "is one of [{0}]".format(", ".join(all_class_names)) + + +def get_py3_class_name(input_class): + if six.PY2: + if input_class == str: + return 'str' + elif input_class == int: + return 'int' + return input_class.__name__ + + +def get_allof_instances(self, model_args, constant_args): + """ + Args: + self: the class we are handling + model_args (dict): var_name to var_value + used to make instances + constant_args (dict): var_name to var_value + used to make instances + + Returns + composed_instances (list) + """ + composed_instances = [] + for allof_class in self._composed_schemas()['allOf']: + + # transform js keys to python keys in fixed_model_args + fixed_model_args = change_keys_js_to_python( + model_args, allof_class) + + # extract a dict of only required keys from fixed_model_args + kwargs = {} + var_names = set(allof_class.openapi_types().keys()) + for var_name in var_names: + if var_name in fixed_model_args: + kwargs[var_name] = fixed_model_args[var_name] + + # and use it to make the instance + kwargs.update(constant_args) + allof_instance = allof_class(**kwargs) + composed_instances.append(allof_instance) + return composed_instances + + +def get_oneof_instance(self, model_args, constant_args): + """ + Args: + self: the class we are handling + model_args (dict): var_name to var_value + used to make instances + constant_args (dict): var_name to var_value + used to make instances + + Returns + oneof_instance (instance) + """ + oneof_instance = None + if len(self._composed_schemas()['oneOf']) == 0: + return oneof_instance + + for oneof_class in self._composed_schemas()['oneOf']: + # transform js keys to python keys in fixed_model_args + fixed_model_args = change_keys_js_to_python( + model_args, oneof_class) + + # extract a dict of only required keys from fixed_model_args + kwargs = {} + var_names = set(oneof_class.openapi_types().keys()) + for var_name in var_names: + if var_name in fixed_model_args: + kwargs[var_name] = fixed_model_args[var_name] + + # and use it to make the instance + kwargs.update(constant_args) + try: + oneof_instance = oneof_class(**kwargs) + break + except Exception: + pass + if oneof_instance is None: + raise ApiValueError( + "Invalid inputs given to generate an instance of %s. Unable to " + "make any instances of the classes in oneOf definition." % + self.__class__.__name__ + ) + return oneof_instance + + +def get_anyof_instances(self, model_args, constant_args): + """ + Args: + self: the class we are handling + model_args (dict): var_name to var_value + used to make instances + constant_args (dict): var_name to var_value + used to make instances + + Returns + anyof_instances (list) + """ + anyof_instances = [] + if len(self._composed_schemas()['anyOf']) == 0: + return anyof_instances + + for anyof_class in self._composed_schemas()['anyOf']: + # transform js keys to python keys in fixed_model_args + fixed_model_args = change_keys_js_to_python(model_args, anyof_class) + + # extract a dict of only required keys from these_model_vars + kwargs = {} + var_names = set(anyof_class.openapi_types().keys()) + for var_name in var_names: + if var_name in fixed_model_args: + kwargs[var_name] = fixed_model_args[var_name] + + # and use it to make the instance + kwargs.update(constant_args) + try: + anyof_instance = anyof_class(**kwargs) + anyof_instances.append(anyof_instance) + except Exception: + pass + if len(anyof_instances) == 0: + raise ApiValueError( + "Invalid inputs given to generate an instance of %s. Unable to " + "make any instances of the classes in anyOf definition." % + self.__class__.__name__ + ) + return anyof_instances + + +def get_additional_properties_model_instances( + composed_instances, self): + additional_properties_model_instances = [] + all_instances = [self] + all_instances.extend(composed_instances) + for instance in all_instances: + if instance.additional_properties_type is not None: + additional_properties_model_instances.append(instance) + return additional_properties_model_instances + + +def get_var_name_to_model_instances(self, composed_instances): + var_name_to_model_instances = {} + all_instances = [self] + all_instances.extend(composed_instances) + for instance in all_instances: + for var_name in instance.openapi_types(): + if var_name not in var_name_to_model_instances: + var_name_to_model_instances[var_name] = [instance] + else: + var_name_to_model_instances[var_name].append(instance) + return var_name_to_model_instances + + +def get_unused_args(self, composed_instances, model_args): + unused_args = dict(model_args) + # arguments apssed to self were already converted to python names + # before __init__ was called + for var_name_py in self.attribute_map: + if var_name_py in unused_args: + del unused_args[var_name_py] + for instance in composed_instances: + if instance.__class__ in self._composed_schemas()['allOf']: + for var_name_py in instance.attribute_map: + if var_name_py in unused_args: + del unused_args[var_name_py] + else: + for var_name_js in instance.attribute_map.values(): + if var_name_js in unused_args: + del unused_args[var_name_js] + return unused_args + + +def validate_get_composed_info(constant_args, model_args, self): + """ + For composed schemas/classes, validates the classes to make sure that + they do not share any of the same parameters. If there is no collision + then composed model instances are created and returned tot the calling + self model + + Args: + constant_args (dict): these are the args that every model requires + model_args (dict): these are the required and optional spec args that + were passed in to make this model + self (class): the class that we are instantiating + This class contains self._composed_schemas() + + Returns: + composed_info (list): length three + composed_instances (list): the composed instances which are not + self + var_name_to_model_instances (dict): a dict going from var_name + to the model_instance which holds that var_name + the model_instance may be self or an instance of one of the + classes in self.composed_instances() + additional_properties_model_instances (list): a list of the + model instances which have the property + additional_properties_type. This list can include self + """ + # create composed_instances + composed_instances = [] + allof_instances = get_allof_instances(self, model_args, constant_args) + composed_instances.extend(allof_instances) + oneof_instance = get_oneof_instance(self, model_args, constant_args) + if oneof_instance is not None: + composed_instances.append(oneof_instance) + anyof_instances = get_anyof_instances(self, model_args, constant_args) + composed_instances.extend(anyof_instances) + + # map variable names to composed_instances + var_name_to_model_instances = get_var_name_to_model_instances( + self, composed_instances) + + # set additional_properties_model_instances + additional_properties_model_instances = ( + get_additional_properties_model_instances(composed_instances, self) + ) + + # set any remaining values + unused_args = get_unused_args(self, composed_instances, model_args) + if len(unused_args) > 0: + if len(additional_properties_model_instances) == 0: + raise ApiValueError( + "Invalid input arguments input when making an instance of " + "class %s. Not all inputs were used. The unused input data " + "is %s" % (self.__class__.__name__, unused_args) + ) + for var_name, var_value in six.iteritems(unused_args): + for instance in additional_properties_model_instances: + setattr(instance, var_name, var_value) + # no need to add additional_properties to var_name_to_model_instances here + # because additional_properties_model_instances will direct us to that + # instance when we use getattr or setattr + # and we update var_name_to_model_instances in setattr + + return [ + composed_instances, + var_name_to_model_instances, + additional_properties_model_instances + ] diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py new file mode 100644 index 00000000000..e02c6651925 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +# flake8: noqa +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +# we can not import model classes here because that would create a circular +# reference which would not work in python2 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py new file mode 100644 index 00000000000..1539b694b56 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class AdditionalPropertiesClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'map_property': ({str: (str,)},), # noqa: E501 + 'map_of_map_property': ({str: ({str: (str,)},)},), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'map_property': 'map_property', # noqa: E501 + 'map_of_map_property': 'map_of_map_property', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """additional_properties_class.AdditionalPropertiesClass - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + map_property ({str: (str,)}): [optional] # noqa: E501 + map_of_map_property ({str: ({str: (str,)},)}): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py new file mode 100644 index 00000000000..abb0d49e74c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import cat +except ImportError: + cat = sys.modules[ + 'petstore_api.models.cat'] +try: + from petstore_api.models import dog +except ImportError: + dog = sys.modules[ + 'petstore_api.models.dog'] + + +class Animal(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'class_name': (str,), # noqa: E501 + 'color': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return { + 'class_name': { + 'Cat': cat.Cat, + 'Dog': dog.Dog, + }, + } + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'color': 'color', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """animal.Animal - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.class_name = class_name + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) + + @classmethod + def get_discriminator_class(cls, from_server, data): + """Returns the child class specified by the discriminator""" + discriminator = cls.discriminator() + discr_propertyname_py = list(discriminator.keys())[0] + discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + if from_server: + class_name = data[discr_propertyname_js] + else: + class_name = data[discr_propertyname_py] + class_name_to_discr_class = discriminator[discr_propertyname_py] + return class_name_to_discr_class.get(class_name) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py new file mode 100644 index 00000000000..cc3d2cea442 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class ApiResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'code': (int,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'code': 'code', # noqa: E501 + 'type': 'type', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """api_response.ApiResponse - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + code (int): [optional] # noqa: E501 + type (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py new file mode 100644 index 00000000000..3c0175acdd8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class ArrayOfArrayOfNumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'array_array_number': ([[float]],), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'array_array_number': 'ArrayArrayNumber', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """array_of_array_of_number_only.ArrayOfArrayOfNumberOnly - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + array_array_number ([[float]]): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py new file mode 100644 index 00000000000..28bacd7021d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class ArrayOfNumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'array_number': ([float],), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'array_number': 'ArrayNumber', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """array_of_number_only.ArrayOfNumberOnly - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + array_number ([float]): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py new file mode 100644 index 00000000000..c99bc985cab --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import read_only_first +except ImportError: + read_only_first = sys.modules[ + 'petstore_api.models.read_only_first'] + + +class ArrayTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'array_of_string': ([str],), # noqa: E501 + 'array_array_of_integer': ([[int]],), # noqa: E501 + 'array_array_of_model': ([[read_only_first.ReadOnlyFirst]],), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'array_of_string': 'array_of_string', # noqa: E501 + 'array_array_of_integer': 'array_array_of_integer', # noqa: E501 + 'array_array_of_model': 'array_array_of_model', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """array_test.ArrayTest - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + array_of_string ([str]): [optional] # noqa: E501 + array_array_of_integer ([[int]]): [optional] # noqa: E501 + array_array_of_model ([[read_only_first.ReadOnlyFirst]]): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py new file mode 100644 index 00000000000..8311ed65ba2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class Capitalization(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'small_camel': (str,), # noqa: E501 + 'capital_camel': (str,), # noqa: E501 + 'small_snake': (str,), # noqa: E501 + 'capital_snake': (str,), # noqa: E501 + 'sca_eth_flow_points': (str,), # noqa: E501 + 'att_name': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'small_camel': 'smallCamel', # noqa: E501 + 'capital_camel': 'CapitalCamel', # noqa: E501 + 'small_snake': 'small_Snake', # noqa: E501 + 'capital_snake': 'Capital_Snake', # noqa: E501 + 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', # noqa: E501 + 'att_name': 'ATT_NAME', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """capitalization.Capitalization - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + small_camel (str): [optional] # noqa: E501 + capital_camel (str): [optional] # noqa: E501 + small_snake (str): [optional] # noqa: E501 + capital_snake (str): [optional] # noqa: E501 + sca_eth_flow_points (str): [optional] # noqa: E501 + att_name (str): Name of the pet . [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py new file mode 100644 index 00000000000..229d0445554 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.models.animal'] +try: + from petstore_api.models import cat_all_of +except ImportError: + cat_all_of = sys.modules[ + 'petstore_api.models.cat_all_of'] + + +class Cat(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'class_name': (str,), # noqa: E501 + 'declawed': (bool,), # noqa: E501 + 'color': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'declawed': 'declawed', # noqa: E501 + 'color': 'color', # noqa: E501 + } + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """cat.Cat - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + declawed (bool): [optional] # noqa: E501 + color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_from_server': _from_server, + '_configuration': _configuration, + } + model_args = { + 'class_name': class_name, + } + model_args.update(kwargs) + composed_info = validate_get_composed_info( + constant_args, model_args, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + + self.class_name = class_name + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) + + @staticmethod + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error beause the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return { + 'anyOf': [ + ], + 'allOf': [ + animal.Animal, + cat_all_of.CatAllOf, + ], + 'oneOf': [ + ], + } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py new file mode 100644 index 00000000000..00b0cfae654 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class CatAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'declawed': (bool,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'declawed': 'declawed', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """cat_all_of.CatAllOf - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + declawed (bool): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py new file mode 100644 index 00000000000..2530a19b2f3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class Category(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'id': (int,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'name': 'name', # noqa: E501 + 'id': 'id', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, name='default-name', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """category.Category - a model defined in OpenAPI + + Args: + + Keyword Args: + name (str): defaults to 'default-name', must be one of ['default-name'] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.name = name + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py new file mode 100644 index 00000000000..f268d8576d5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class ClassModel(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + '_class': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + '_class': '_class', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """class_model.ClassModel - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _class (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py new file mode 100644 index 00000000000..1097c624d72 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class Client(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'client': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'client': 'client', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """client.Client - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + client (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py new file mode 100644 index 00000000000..b29e31d4e5d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.models.animal'] +try: + from petstore_api.models import dog_all_of +except ImportError: + dog_all_of = sys.modules[ + 'petstore_api.models.dog_all_of'] + + +class Dog(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'class_name': (str,), # noqa: E501 + 'breed': (str,), # noqa: E501 + 'color': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'breed': 'breed', # noqa: E501 + 'color': 'color', # noqa: E501 + } + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """dog.Dog - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + breed (str): [optional] # noqa: E501 + color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_from_server': _from_server, + '_configuration': _configuration, + } + model_args = { + 'class_name': class_name, + } + model_args.update(kwargs) + composed_info = validate_get_composed_info( + constant_args, model_args, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + + self.class_name = class_name + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) + + @staticmethod + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error beause the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return { + 'anyOf': [ + ], + 'allOf': [ + animal.Animal, + dog_all_of.DogAllOf, + ], + 'oneOf': [ + ], + } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py new file mode 100644 index 00000000000..316ec102b91 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class DogAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'breed': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'breed': 'breed', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """dog_all_of.DogAllOf - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + breed (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py new file mode 100644 index 00000000000..d997d53fac7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class EnumArrays(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('just_symbol',): { + '>=': ">=", + '$': "$", + }, + ('array_enum',): { + 'FISH': "fish", + 'CRAB': "crab", + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'just_symbol': (str,), # noqa: E501 + 'array_enum': ([str],), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'just_symbol': 'just_symbol', # noqa: E501 + 'array_enum': 'array_enum', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """enum_arrays.EnumArrays - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + just_symbol (str): [optional] # noqa: E501 + array_enum ([str]): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py new file mode 100644 index 00000000000..bda8183ce78 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class EnumClass(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '_ABC': "_abc", + '-EFG': "-efg", + '(XYZ)': "(xyz)", + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, value='-efg', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """enum_class.EnumClass - a model defined in OpenAPI + + Args: + + Keyword Args: + value (str): defaults to '-efg', must be one of ['-efg'] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.value = value + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py new file mode 100644 index 00000000000..9c6fc29d458 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import outer_enum +except ImportError: + outer_enum = sys.modules[ + 'petstore_api.models.outer_enum'] +try: + from petstore_api.models import outer_enum_default_value +except ImportError: + outer_enum_default_value = sys.modules[ + 'petstore_api.models.outer_enum_default_value'] +try: + from petstore_api.models import outer_enum_integer +except ImportError: + outer_enum_integer = sys.modules[ + 'petstore_api.models.outer_enum_integer'] +try: + from petstore_api.models import outer_enum_integer_default_value +except ImportError: + outer_enum_integer_default_value = sys.modules[ + 'petstore_api.models.outer_enum_integer_default_value'] + + +class EnumTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('enum_string_required',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + 'EMPTY': "", + }, + ('enum_string',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + 'EMPTY': "", + }, + ('enum_integer',): { + '1': 1, + '-1': -1, + }, + ('enum_number',): { + '1.1': 1.1, + '-1.2': -1.2, + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'enum_string_required': (str,), # noqa: E501 + 'enum_string': (str,), # noqa: E501 + 'enum_integer': (int,), # noqa: E501 + 'enum_number': (float,), # noqa: E501 + 'outer_enum': (outer_enum.OuterEnum,), # noqa: E501 + 'outer_enum_integer': (outer_enum_integer.OuterEnumInteger,), # noqa: E501 + 'outer_enum_default_value': (outer_enum_default_value.OuterEnumDefaultValue,), # noqa: E501 + 'outer_enum_integer_default_value': (outer_enum_integer_default_value.OuterEnumIntegerDefaultValue,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'enum_string_required': 'enum_string_required', # noqa: E501 + 'enum_string': 'enum_string', # noqa: E501 + 'enum_integer': 'enum_integer', # noqa: E501 + 'enum_number': 'enum_number', # noqa: E501 + 'outer_enum': 'outerEnum', # noqa: E501 + 'outer_enum_integer': 'outerEnumInteger', # noqa: E501 + 'outer_enum_default_value': 'outerEnumDefaultValue', # noqa: E501 + 'outer_enum_integer_default_value': 'outerEnumIntegerDefaultValue', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, enum_string_required, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """enum_test.EnumTest - a model defined in OpenAPI + + Args: + enum_string_required (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + enum_string (str): [optional] # noqa: E501 + enum_integer (int): [optional] # noqa: E501 + enum_number (float): [optional] # noqa: E501 + outer_enum (outer_enum.OuterEnum): [optional] # noqa: E501 + outer_enum_integer (outer_enum_integer.OuterEnumInteger): [optional] # noqa: E501 + outer_enum_default_value (outer_enum_default_value.OuterEnumDefaultValue): [optional] # noqa: E501 + outer_enum_integer_default_value (outer_enum_integer_default_value.OuterEnumIntegerDefaultValue): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.enum_string_required = enum_string_required + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py new file mode 100644 index 00000000000..ecc56b0cd00 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class File(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'source_uri': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'source_uri': 'sourceURI', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """file.File - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + source_uri (str): Test capitalization. [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py new file mode 100644 index 00000000000..f1abb16cbc3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import file +except ImportError: + file = sys.modules[ + 'petstore_api.models.file'] + + +class FileSchemaTestClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'file': (file.File,), # noqa: E501 + 'files': ([file.File],), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'file': 'file', # noqa: E501 + 'files': 'files', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """file_schema_test_class.FileSchemaTestClass - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + file (file.File): [optional] # noqa: E501 + files ([file.File]): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py new file mode 100644 index 00000000000..757cebbc1ed --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class Foo(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'bar': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'bar': 'bar', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """foo.Foo - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + bar (str): [optional] if omitted the server will use the default value of 'bar' # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py new file mode 100644 index 00000000000..7486b49cfe4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py @@ -0,0 +1,215 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class FormatTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('number',): { + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + }, + ('password',): { + 'max_length': 64, + 'min_length': 10, + }, + ('integer',): { + 'inclusive_maximum': 100, + 'inclusive_minimum': 10, + }, + ('int32',): { + 'inclusive_maximum': 200, + 'inclusive_minimum': 20, + }, + ('float',): { + 'inclusive_maximum': 987.6, + 'inclusive_minimum': 54.3, + }, + ('double',): { + 'inclusive_maximum': 123.4, + 'inclusive_minimum': 67.8, + }, + ('string',): { + 'regex': { + 'pattern': r'[a-z]', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + ('pattern_with_digits',): { + 'regex': { + 'pattern': r'^\d{10}$', # noqa: E501 + }, + }, + ('pattern_with_digits_and_delimiter',): { + 'regex': { + 'pattern': r'^image_\d{1,3}$', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'number': (float,), # noqa: E501 + 'byte': (str,), # noqa: E501 + 'date': (date,), # noqa: E501 + 'password': (str,), # noqa: E501 + 'integer': (int,), # noqa: E501 + 'int32': (int,), # noqa: E501 + 'int64': (int,), # noqa: E501 + 'float': (float,), # noqa: E501 + 'double': (float,), # noqa: E501 + 'string': (str,), # noqa: E501 + 'binary': (file_type,), # noqa: E501 + 'date_time': (datetime,), # noqa: E501 + 'uuid': (str,), # noqa: E501 + 'pattern_with_digits': (str,), # noqa: E501 + 'pattern_with_digits_and_delimiter': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'number': 'number', # noqa: E501 + 'byte': 'byte', # noqa: E501 + 'date': 'date', # noqa: E501 + 'password': 'password', # noqa: E501 + 'integer': 'integer', # noqa: E501 + 'int32': 'int32', # noqa: E501 + 'int64': 'int64', # noqa: E501 + 'float': 'float', # noqa: E501 + 'double': 'double', # noqa: E501 + 'string': 'string', # noqa: E501 + 'binary': 'binary', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'uuid': 'uuid', # noqa: E501 + 'pattern_with_digits': 'pattern_with_digits', # noqa: E501 + 'pattern_with_digits_and_delimiter': 'pattern_with_digits_and_delimiter', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, number, byte, date, password, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """format_test.FormatTest - a model defined in OpenAPI + + Args: + number (float): + byte (str): + date (date): + password (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + integer (int): [optional] # noqa: E501 + int32 (int): [optional] # noqa: E501 + int64 (int): [optional] # noqa: E501 + float (float): [optional] # noqa: E501 + double (float): [optional] # noqa: E501 + string (str): [optional] # noqa: E501 + binary (file_type): [optional] # noqa: E501 + date_time (datetime): [optional] # noqa: E501 + uuid (str): [optional] # noqa: E501 + pattern_with_digits (str): A string that is a 10 digit number. Can have leading zeros.. [optional] # noqa: E501 + pattern_with_digits_and_delimiter (str): A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.number = number + self.byte = byte + self.date = date + self.password = password + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py new file mode 100644 index 00000000000..90c4908aa89 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class HasOnlyReadOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'bar': (str,), # noqa: E501 + 'foo': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'bar': 'bar', # noqa: E501 + 'foo': 'foo', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """has_only_read_only.HasOnlyReadOnly - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + bar (str): [optional] # noqa: E501 + foo (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py new file mode 100644 index 00000000000..04a46b759db --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class HealthCheckResult(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'nullable_message': (str, none_type,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'nullable_message': 'NullableMessage', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """health_check_result.HealthCheckResult - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + nullable_message (str, none_type): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py new file mode 100644 index 00000000000..5d3ffe93c5a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class InlineObject(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'status': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'name': 'name', # noqa: E501 + 'status': 'status', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """inline_object.InlineObject - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + name (str): Updated name of the pet. [optional] # noqa: E501 + status (str): Updated status of the pet. [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py new file mode 100644 index 00000000000..93c0ec594c5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class InlineObject1(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'additional_metadata': (str,), # noqa: E501 + 'file': (file_type,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'additional_metadata': 'additionalMetadata', # noqa: E501 + 'file': 'file', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """inline_object1.InlineObject1 - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + additional_metadata (str): Additional data to pass to server. [optional] # noqa: E501 + file (file_type): file to upload. [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py new file mode 100644 index 00000000000..17ef9471842 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class InlineObject2(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('enum_form_string_array',): { + '>': ">", + '$': "$", + }, + ('enum_form_string',): { + '_ABC': "_abc", + '-EFG': "-efg", + '(XYZ)': "(xyz)", + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'enum_form_string_array': ([str],), # noqa: E501 + 'enum_form_string': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'enum_form_string_array': 'enum_form_string_array', # noqa: E501 + 'enum_form_string': 'enum_form_string', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """inline_object2.InlineObject2 - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + enum_form_string_array ([str]): Form parameter enum test (string array). [optional] # noqa: E501 + enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py new file mode 100644 index 00000000000..8fd4f33ead3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class InlineObject3(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('number',): { + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + }, + ('double',): { + 'inclusive_maximum': 123.4, + 'inclusive_minimum': 67.8, + }, + ('pattern_without_delimiter',): { + 'regex': { + 'pattern': r'^[A-Z].*', # noqa: E501 + }, + }, + ('integer',): { + 'inclusive_maximum': 100, + 'inclusive_minimum': 10, + }, + ('int32',): { + 'inclusive_maximum': 200, + 'inclusive_minimum': 20, + }, + ('float',): { + 'inclusive_maximum': 987.6, + }, + ('string',): { + 'regex': { + 'pattern': r'[a-z]', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + ('password',): { + 'max_length': 64, + 'min_length': 10, + }, + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'number': (float,), # noqa: E501 + 'double': (float,), # noqa: E501 + 'pattern_without_delimiter': (str,), # noqa: E501 + 'byte': (str,), # noqa: E501 + 'integer': (int,), # noqa: E501 + 'int32': (int,), # noqa: E501 + 'int64': (int,), # noqa: E501 + 'float': (float,), # noqa: E501 + 'string': (str,), # noqa: E501 + 'binary': (file_type,), # noqa: E501 + 'date': (date,), # noqa: E501 + 'date_time': (datetime,), # noqa: E501 + 'password': (str,), # noqa: E501 + 'callback': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'number': 'number', # noqa: E501 + 'double': 'double', # noqa: E501 + 'pattern_without_delimiter': 'pattern_without_delimiter', # noqa: E501 + 'byte': 'byte', # noqa: E501 + 'integer': 'integer', # noqa: E501 + 'int32': 'int32', # noqa: E501 + 'int64': 'int64', # noqa: E501 + 'float': 'float', # noqa: E501 + 'string': 'string', # noqa: E501 + 'binary': 'binary', # noqa: E501 + 'date': 'date', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'password': 'password', # noqa: E501 + 'callback': 'callback', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, number, double, pattern_without_delimiter, byte, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """inline_object3.InlineObject3 - a model defined in OpenAPI + + Args: + number (float): None + double (float): None + pattern_without_delimiter (str): None + byte (str): None + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + integer (int): None. [optional] # noqa: E501 + int32 (int): None. [optional] # noqa: E501 + int64 (int): None. [optional] # noqa: E501 + float (float): None. [optional] # noqa: E501 + string (str): None. [optional] # noqa: E501 + binary (file_type): None. [optional] # noqa: E501 + date (date): None. [optional] # noqa: E501 + date_time (datetime): None. [optional] # noqa: E501 + password (str): None. [optional] # noqa: E501 + callback (str): None. [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.number = number + self.double = double + self.pattern_without_delimiter = pattern_without_delimiter + self.byte = byte + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py new file mode 100644 index 00000000000..ed787c2e253 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class InlineObject4(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'param': (str,), # noqa: E501 + 'param2': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'param': 'param', # noqa: E501 + 'param2': 'param2', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, param, param2, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """inline_object4.InlineObject4 - a model defined in OpenAPI + + Args: + param (str): field1 + param2 (str): field2 + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.param = param + self.param2 = param2 + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py new file mode 100644 index 00000000000..44e1572bb3b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class InlineObject5(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'required_file': (file_type,), # noqa: E501 + 'additional_metadata': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'required_file': 'requiredFile', # noqa: E501 + 'additional_metadata': 'additionalMetadata', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, required_file, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """inline_object5.InlineObject5 - a model defined in OpenAPI + + Args: + required_file (file_type): file to upload + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + additional_metadata (str): Additional data to pass to server. [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.required_file = required_file + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py new file mode 100644 index 00000000000..0154a9e6c40 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import foo +except ImportError: + foo = sys.modules[ + 'petstore_api.models.foo'] + + +class InlineResponseDefault(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'string': (foo.Foo,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'string': 'string', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """inline_response_default.InlineResponseDefault - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + string (foo.Foo): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py new file mode 100644 index 00000000000..e6816fb51a0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class List(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + '_123_list': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + '_123_list': '123-list', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """list.List - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _123_list (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py new file mode 100644 index 00000000000..e996e27991c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import string_boolean_map +except ImportError: + string_boolean_map = sys.modules[ + 'petstore_api.models.string_boolean_map'] + + +class MapTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('map_of_enum_string',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'map_map_of_string': ({str: ({str: (str,)},)},), # noqa: E501 + 'map_of_enum_string': ({str: (str,)},), # noqa: E501 + 'direct_map': ({str: (bool,)},), # noqa: E501 + 'indirect_map': (string_boolean_map.StringBooleanMap,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'map_map_of_string': 'map_map_of_string', # noqa: E501 + 'map_of_enum_string': 'map_of_enum_string', # noqa: E501 + 'direct_map': 'direct_map', # noqa: E501 + 'indirect_map': 'indirect_map', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """map_test.MapTest - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 + map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 + direct_map ({str: (bool,)}): [optional] # noqa: E501 + indirect_map (string_boolean_map.StringBooleanMap): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py new file mode 100644 index 00000000000..60b89762456 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.models.animal'] + + +class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'uuid': (str,), # noqa: E501 + 'date_time': (datetime,), # noqa: E501 + 'map': ({str: (animal.Animal,)},), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'uuid': 'uuid', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'map': 'map', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + uuid (str): [optional] # noqa: E501 + date_time (datetime): [optional] # noqa: E501 + map ({str: (animal.Animal,)}): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py new file mode 100644 index 00000000000..cdfb0db9d60 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class Model200Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (int,), # noqa: E501 + '_class': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'name': 'name', # noqa: E501 + '_class': 'class', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """model200_response.Model200Response - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + name (int): [optional] # noqa: E501 + _class (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py new file mode 100644 index 00000000000..a145f8e706c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class ModelReturn(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + '_return': (int,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + '_return': 'return', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """model_return.ModelReturn - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _return (int): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py new file mode 100644 index 00000000000..e3b0378bab6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class Name(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (int,), # noqa: E501 + 'snake_case': (int,), # noqa: E501 + '_property': (str,), # noqa: E501 + '_123_number': (int,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'name': 'name', # noqa: E501 + 'snake_case': 'snake_case', # noqa: E501 + '_property': 'property', # noqa: E501 + '_123_number': '123Number', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """name.Name - a model defined in OpenAPI + + Args: + name (int): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + snake_case (int): [optional] # noqa: E501 + _property (str): [optional] # noqa: E501 + _123_number (int): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.name = name + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py new file mode 100644 index 00000000000..286f98f1a99 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class NullableClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'integer_prop': (int, none_type,), # noqa: E501 + 'number_prop': (float, none_type,), # noqa: E501 + 'boolean_prop': (bool, none_type,), # noqa: E501 + 'string_prop': (str, none_type,), # noqa: E501 + 'date_prop': (date, none_type,), # noqa: E501 + 'datetime_prop': (datetime, none_type,), # noqa: E501 + 'array_nullable_prop': ([bool, date, datetime, dict, float, int, list, str], none_type,), # noqa: E501 + 'array_and_items_nullable_prop': ([bool, date, datetime, dict, float, int, list, str, none_type], none_type,), # noqa: E501 + 'array_items_nullable': ([bool, date, datetime, dict, float, int, list, str, none_type],), # noqa: E501 + 'object_nullable_prop': ({str: (bool, date, datetime, dict, float, int, list, str,)}, none_type,), # noqa: E501 + 'object_and_items_nullable_prop': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + 'object_items_nullable': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'integer_prop': 'integer_prop', # noqa: E501 + 'number_prop': 'number_prop', # noqa: E501 + 'boolean_prop': 'boolean_prop', # noqa: E501 + 'string_prop': 'string_prop', # noqa: E501 + 'date_prop': 'date_prop', # noqa: E501 + 'datetime_prop': 'datetime_prop', # noqa: E501 + 'array_nullable_prop': 'array_nullable_prop', # noqa: E501 + 'array_and_items_nullable_prop': 'array_and_items_nullable_prop', # noqa: E501 + 'array_items_nullable': 'array_items_nullable', # noqa: E501 + 'object_nullable_prop': 'object_nullable_prop', # noqa: E501 + 'object_and_items_nullable_prop': 'object_and_items_nullable_prop', # noqa: E501 + 'object_items_nullable': 'object_items_nullable', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """nullable_class.NullableClass - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + integer_prop (int, none_type): [optional] # noqa: E501 + number_prop (float, none_type): [optional] # noqa: E501 + boolean_prop (bool, none_type): [optional] # noqa: E501 + string_prop (str, none_type): [optional] # noqa: E501 + date_prop (date, none_type): [optional] # noqa: E501 + datetime_prop (datetime, none_type): [optional] # noqa: E501 + array_nullable_prop ([bool, date, datetime, dict, float, int, list, str], none_type): [optional] # noqa: E501 + array_and_items_nullable_prop ([bool, date, datetime, dict, float, int, list, str, none_type], none_type): [optional] # noqa: E501 + array_items_nullable ([bool, date, datetime, dict, float, int, list, str, none_type]): [optional] # noqa: E501 + object_nullable_prop ({str: (bool, date, datetime, dict, float, int, list, str,)}, none_type): [optional] # noqa: E501 + object_and_items_nullable_prop ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + object_items_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py new file mode 100644 index 00000000000..6a30356c5e9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class NumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'just_number': (float,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'just_number': 'JustNumber', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """number_only.NumberOnly - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + just_number (float): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py new file mode 100644 index 00000000000..6e4e8af79fa --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class Order(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (int,), # noqa: E501 + 'pet_id': (int,), # noqa: E501 + 'quantity': (int,), # noqa: E501 + 'ship_date': (datetime,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'complete': (bool,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'id': 'id', # noqa: E501 + 'pet_id': 'petId', # noqa: E501 + 'quantity': 'quantity', # noqa: E501 + 'ship_date': 'shipDate', # noqa: E501 + 'status': 'status', # noqa: E501 + 'complete': 'complete', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """order.Order - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + pet_id (int): [optional] # noqa: E501 + quantity (int): [optional] # noqa: E501 + ship_date (datetime): [optional] # noqa: E501 + status (str): Order Status. [optional] # noqa: E501 + complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py new file mode 100644 index 00000000000..99b7406df90 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class OuterComposite(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'my_number': (float,), # noqa: E501 + 'my_string': (str,), # noqa: E501 + 'my_boolean': (bool,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'my_number': 'my_number', # noqa: E501 + 'my_string': 'my_string', # noqa: E501 + 'my_boolean': 'my_boolean', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """outer_composite.OuterComposite - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + my_number (float): [optional] # noqa: E501 + my_string (str): [optional] # noqa: E501 + my_boolean (bool): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py new file mode 100644 index 00000000000..90f65c56cef --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class OuterEnum(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'None': None, + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str, none_type,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """outer_enum.OuterEnum - a model defined in OpenAPI + + Args: + value (str, none_type): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.value = value + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py new file mode 100644 index 00000000000..35f86a699e6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class OuterEnumDefaultValue(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, value='placed', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """outer_enum_default_value.OuterEnumDefaultValue - a model defined in OpenAPI + + Args: + + Keyword Args: + value (str): defaults to 'placed', must be one of ['placed'] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.value = value + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py new file mode 100644 index 00000000000..2a80e1133c8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class OuterEnumInteger(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '0': 0, + '1': 1, + '2': 2, + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (int,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """outer_enum_integer.OuterEnumInteger - a model defined in OpenAPI + + Args: + value (int): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.value = value + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py new file mode 100644 index 00000000000..3de92379cb3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class OuterEnumIntegerDefaultValue(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '0': 0, + '1': 1, + '2': 2, + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (int,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, value=0, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """outer_enum_integer_default_value.OuterEnumIntegerDefaultValue - a model defined in OpenAPI + + Args: + + Keyword Args: + value (int): defaults to 0, must be one of [0] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.value = value + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py new file mode 100644 index 00000000000..11ffa6ff44f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import category +except ImportError: + category = sys.modules[ + 'petstore_api.models.category'] +try: + from petstore_api.models import tag +except ImportError: + tag = sys.modules[ + 'petstore_api.models.tag'] + + +class Pet(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'AVAILABLE': "available", + 'PENDING': "pending", + 'SOLD': "sold", + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'photo_urls': ([str],), # noqa: E501 + 'id': (int,), # noqa: E501 + 'category': (category.Category,), # noqa: E501 + 'tags': ([tag.Tag],), # noqa: E501 + 'status': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'name': 'name', # noqa: E501 + 'photo_urls': 'photoUrls', # noqa: E501 + 'id': 'id', # noqa: E501 + 'category': 'category', # noqa: E501 + 'tags': 'tags', # noqa: E501 + 'status': 'status', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, name, photo_urls, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """pet.Pet - a model defined in OpenAPI + + Args: + name (str): + photo_urls ([str]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + category (category.Category): [optional] # noqa: E501 + tags ([tag.Tag]): [optional] # noqa: E501 + status (str): pet status in the store. [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.name = name + self.photo_urls = photo_urls + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py new file mode 100644 index 00000000000..d2239f91920 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class ReadOnlyFirst(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'bar': (str,), # noqa: E501 + 'baz': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'bar': 'bar', # noqa: E501 + 'baz': 'baz', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """read_only_first.ReadOnlyFirst - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + bar (str): [optional] # noqa: E501 + baz (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py new file mode 100644 index 00000000000..607ddacbc05 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class SpecialModelName(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'special_property_name': (int,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'special_property_name': '$special[property.name]', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """special_model_name.SpecialModelName - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + special_property_name (int): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py new file mode 100644 index 00000000000..a5425b412ac --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class StringBooleanMap(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = (bool,) # noqa: E501 + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """string_boolean_map.StringBooleanMap - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py new file mode 100644 index 00000000000..ce06e651ee7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class Tag(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (int,), # noqa: E501 + 'name': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'id': 'id', # noqa: E501 + 'name': 'name', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """tag.Tag - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + name (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py new file mode 100644 index 00000000000..62c3bd48a16 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class User(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (int,), # noqa: E501 + 'username': (str,), # noqa: E501 + 'first_name': (str,), # noqa: E501 + 'last_name': (str,), # noqa: E501 + 'email': (str,), # noqa: E501 + 'password': (str,), # noqa: E501 + 'phone': (str,), # noqa: E501 + 'user_status': (int,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'id': 'id', # noqa: E501 + 'username': 'username', # noqa: E501 + 'first_name': 'firstName', # noqa: E501 + 'last_name': 'lastName', # noqa: E501 + 'email': 'email', # noqa: E501 + 'password': 'password', # noqa: E501 + 'phone': 'phone', # noqa: E501 + 'user_status': 'userStatus', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """user.User - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + username (str): [optional] # noqa: E501 + first_name (str): [optional] # noqa: E501 + last_name (str): [optional] # noqa: E501 + email (str): [optional] # noqa: E501 + password (str): [optional] # noqa: E501 + phone (str): [optional] # noqa: E501 + user_status (int): User Status. [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py new file mode 100644 index 00000000000..7ed815b8a18 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py @@ -0,0 +1,296 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import io +import json +import logging +import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode +import urllib3 + +from petstore_api.exceptions import ApiException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # In the python 3, the response.data is bytes. + # we need to decode it to string. + if six.PY3: + r.data = r.data.decode('utf8') + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) diff --git a/samples/openapi3/client/petstore/python-experimental/pom.xml b/samples/openapi3/client/petstore/python-experimental/pom.xml new file mode 100644 index 00000000000..2016c019a95 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + PythonExperimentalOAS3PetstoreTests + pom + 1.0-SNAPSHOT + Python-Experimental OpenAPI3 Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + test + integration-test + + exec + + + make + + test-all + + + + + + + + diff --git a/samples/openapi3/client/petstore/python-experimental/requirements.txt b/samples/openapi3/client/petstore/python-experimental/requirements.txt new file mode 100644 index 00000000000..eb358efd5bd --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/requirements.txt @@ -0,0 +1,6 @@ +certifi >= 14.05.14 +future; python_version<="2.7" +six >= 1.10 +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.15.1 diff --git a/samples/openapi3/client/petstore/python-experimental/setup.cfg b/samples/openapi3/client/petstore/python-experimental/setup.cfg new file mode 100644 index 00000000000..11433ee875a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/samples/openapi3/client/petstore/python-experimental/setup.py b/samples/openapi3/client/petstore/python-experimental/setup.py new file mode 100644 index 00000000000..f99ea80ad63 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/setup.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from setuptools import setup, find_packages # noqa: H301 + +NAME = "petstore-api" +VERSION = "1.0.0" +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] +EXTRAS = {':python_version <= "2.7"': ['future']} + +setup( + name=NAME, + version=VERSION, + description="OpenAPI Petstore", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="", + keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], + install_requires=REQUIRES, + extras_require=EXTRAS, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + license="Apache-2.0", + long_description="""\ + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + """ +) diff --git a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt new file mode 100644 index 00000000000..06f7754d204 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt @@ -0,0 +1,4 @@ +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 +mock; python_version<="2.7" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/test/__init__.py b/samples/openapi3/client/petstore/python-experimental/test/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py new file mode 100644 index 00000000000..279baa3a454 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestAdditionalPropertiesClass(unittest.TestCase): + """AdditionalPropertiesClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAdditionalPropertiesClass(self): + """Test AdditionalPropertiesClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.AdditionalPropertiesClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_animal.py b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py new file mode 100644 index 00000000000..66f94c5eef4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestAnimal(unittest.TestCase): + """Animal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAnimal(self): + """Test Animal""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Animal() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py new file mode 100644 index 00000000000..d95798cfc5a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestAnotherFakeApi(unittest.TestCase): + """AnotherFakeApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501 + + def tearDown(self): + pass + + def test_call_123_test_special_tags(self): + """Test case for call_123_test_special_tags + + To test special tags # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py new file mode 100644 index 00000000000..a253e6f364c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestApiResponse(unittest.TestCase): + """ApiResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApiResponse(self): + """Test ApiResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.ApiResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py new file mode 100644 index 00000000000..e47430f6861 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestArrayOfArrayOfNumberOnly(unittest.TestCase): + """ArrayOfArrayOfNumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayOfArrayOfNumberOnly(self): + """Test ArrayOfArrayOfNumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.ArrayOfArrayOfNumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py new file mode 100644 index 00000000000..1a65f69b926 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestArrayOfNumberOnly(unittest.TestCase): + """ArrayOfNumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayOfNumberOnly(self): + """Test ArrayOfNumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.ArrayOfNumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py new file mode 100644 index 00000000000..ac1b486bb74 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestArrayTest(unittest.TestCase): + """ArrayTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayTest(self): + """Test ArrayTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.ArrayTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py new file mode 100644 index 00000000000..1cb91380a76 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestCapitalization(unittest.TestCase): + """Capitalization unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCapitalization(self): + """Test Capitalization""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Capitalization() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py new file mode 100644 index 00000000000..bd616261861 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestCat(unittest.TestCase): + """Cat unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCat(self): + """Test Cat""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Cat() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py new file mode 100644 index 00000000000..136ed8da050 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestCatAllOf(unittest.TestCase): + """CatAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCatAllOf(self): + """Test CatAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.CatAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_category.py b/samples/openapi3/client/petstore/python-experimental/test/test_category.py new file mode 100644 index 00000000000..c2ab96f823b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_category.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestCategory(unittest.TestCase): + """Category unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCategory(self): + """Test Category""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Category() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py b/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py new file mode 100644 index 00000000000..3ac7e553042 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestClassModel(unittest.TestCase): + """ClassModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testClassModel(self): + """Test ClassModel""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.ClassModel() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_client.py b/samples/openapi3/client/petstore/python-experimental/test/test_client.py new file mode 100644 index 00000000000..68319036344 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_client.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestClient(unittest.TestCase): + """Client unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testClient(self): + """Test Client""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Client() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py new file mode 100644 index 00000000000..50e7c57bd0b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.default_api import DefaultApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestDefaultApi(unittest.TestCase): + """DefaultApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.default_api.DefaultApi() # noqa: E501 + + def tearDown(self): + pass + + def test_foo_get(self): + """Test case for foo_get + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py new file mode 100644 index 00000000000..37e9dd56d4f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestDog(unittest.TestCase): + """Dog unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDog(self): + """Test Dog""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Dog() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py new file mode 100644 index 00000000000..7f443eb9b60 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestDogAllOf(unittest.TestCase): + """DogAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDogAllOf(self): + """Test DogAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.DogAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py new file mode 100644 index 00000000000..5f789287332 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestEnumArrays(unittest.TestCase): + """EnumArrays unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumArrays(self): + """Test EnumArrays""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.EnumArrays() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py new file mode 100644 index 00000000000..f25e772ff26 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestEnumClass(unittest.TestCase): + """EnumClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumClass(self): + """Test EnumClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.EnumClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py new file mode 100644 index 00000000000..8238fb7a3ab --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestEnumTest(unittest.TestCase): + """EnumTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumTest(self): + """Test EnumTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.EnumTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py new file mode 100644 index 00000000000..581d1499eed --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.fake_api import FakeApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFakeApi(unittest.TestCase): + """FakeApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501 + + def tearDown(self): + pass + + def test_fake_health_get(self): + """Test case for fake_health_get + + Health check endpoint # noqa: E501 + """ + pass + + def test_fake_outer_boolean_serialize(self): + """Test case for fake_outer_boolean_serialize + + """ + pass + + def test_fake_outer_composite_serialize(self): + """Test case for fake_outer_composite_serialize + + """ + pass + + def test_fake_outer_number_serialize(self): + """Test case for fake_outer_number_serialize + + """ + pass + + def test_fake_outer_string_serialize(self): + """Test case for fake_outer_string_serialize + + """ + pass + + def test_test_body_with_file_schema(self): + """Test case for test_body_with_file_schema + + """ + pass + + def test_test_body_with_query_params(self): + """Test case for test_body_with_query_params + + """ + pass + + def test_test_client_model(self): + """Test case for test_client_model + + To test \"client\" model # noqa: E501 + """ + pass + + def test_test_endpoint_parameters(self): + """Test case for test_endpoint_parameters + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + """ + pass + + def test_test_enum_parameters(self): + """Test case for test_enum_parameters + + To test enum parameters # noqa: E501 + """ + pass + + def test_test_group_parameters(self): + """Test case for test_group_parameters + + Fake endpoint to test group parameters (optional) # noqa: E501 + """ + pass + + def test_test_inline_additional_properties(self): + """Test case for test_inline_additional_properties + + test inline additionalProperties # noqa: E501 + """ + pass + + def test_test_json_form_data(self): + """Test case for test_json_form_data + + test json serialization of form data # noqa: E501 + """ + pass + + def test_test_query_parameter_collection_format(self): + """Test case for test_query_parameter_collection_format + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py new file mode 100644 index 00000000000..f54e0d06644 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """FakeClassnameTags123Api unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 + + def tearDown(self): + pass + + def test_test_classname(self): + """Test case for test_classname + + To test class name in snake case # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file.py b/samples/openapi3/client/petstore/python-experimental/test/test_file.py new file mode 100644 index 00000000000..af185e32e6e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_file.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestFile(unittest.TestCase): + """File unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFile(self): + """Test File""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.File() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py new file mode 100644 index 00000000000..c2de4e866cd --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestFileSchemaTestClass(unittest.TestCase): + """FileSchemaTestClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFileSchemaTestClass(self): + """Test FileSchemaTestClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.FileSchemaTestClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_foo.py b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py new file mode 100644 index 00000000000..c54feb98c25 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestFoo(unittest.TestCase): + """Foo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFoo(self): + """Test Foo""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Foo() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py new file mode 100644 index 00000000000..a9d39521e93 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestFormatTest(unittest.TestCase): + """FormatTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFormatTest(self): + """Test FormatTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.FormatTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py new file mode 100644 index 00000000000..e042faf7c94 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestHasOnlyReadOnly(unittest.TestCase): + """HasOnlyReadOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testHasOnlyReadOnly(self): + """Test HasOnlyReadOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.HasOnlyReadOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py b/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py new file mode 100644 index 00000000000..ebcc32f4396 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestHealthCheckResult(unittest.TestCase): + """HealthCheckResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testHealthCheckResult(self): + """Test HealthCheckResult""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.HealthCheckResult() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py new file mode 100644 index 00000000000..fc2e177006a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestInlineObject(unittest.TestCase): + """InlineObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject(self): + """Test InlineObject""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.InlineObject() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py new file mode 100644 index 00000000000..12a62225def --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestInlineObject1(unittest.TestCase): + """InlineObject1 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject1(self): + """Test InlineObject1""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.InlineObject1() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py new file mode 100644 index 00000000000..1651197f964 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestInlineObject2(unittest.TestCase): + """InlineObject2 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject2(self): + """Test InlineObject2""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.InlineObject2() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py new file mode 100644 index 00000000000..2efbae377dd --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestInlineObject3(unittest.TestCase): + """InlineObject3 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject3(self): + """Test InlineObject3""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.InlineObject3() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py new file mode 100644 index 00000000000..4f74d9cacac --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestInlineObject4(unittest.TestCase): + """InlineObject4 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject4(self): + """Test InlineObject4""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.InlineObject4() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py new file mode 100644 index 00000000000..895cc44ea29 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestInlineObject5(unittest.TestCase): + """InlineObject5 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject5(self): + """Test InlineObject5""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.InlineObject5() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py new file mode 100644 index 00000000000..ecdd05f72fa --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestInlineResponseDefault(unittest.TestCase): + """InlineResponseDefault unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponseDefault(self): + """Test InlineResponseDefault""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.InlineResponseDefault() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_list.py b/samples/openapi3/client/petstore/python-experimental/test/test_list.py new file mode 100644 index 00000000000..29979911a8e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_list.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestList(unittest.TestCase): + """List unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testList(self): + """Test List""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.List() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py new file mode 100644 index 00000000000..8592f21949b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestMapTest(unittest.TestCase): + """MapTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMapTest(self): + """Test MapTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.MapTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py new file mode 100644 index 00000000000..a4e89d3e8c0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): + """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMixedPropertiesAndAdditionalPropertiesClass(self): + """Test MixedPropertiesAndAdditionalPropertiesClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py new file mode 100644 index 00000000000..149629fe1e8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestModel200Response(unittest.TestCase): + """Model200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testModel200Response(self): + """Test Model200Response""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Model200Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py b/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py new file mode 100644 index 00000000000..e48b2c47983 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestModelReturn(unittest.TestCase): + """ModelReturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testModelReturn(self): + """Test ModelReturn""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.ModelReturn() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_name.py new file mode 100644 index 00000000000..1f6407683b2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_name.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestName(unittest.TestCase): + """Name unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testName(self): + """Test Name""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Name() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py new file mode 100644 index 00000000000..8af2cb8447e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestNullableClass(unittest.TestCase): + """NullableClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNullableClass(self): + """Test NullableClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.NullableClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py new file mode 100644 index 00000000000..732baf4b84e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestNumberOnly(unittest.TestCase): + """NumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNumberOnly(self): + """Test NumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.NumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_order.py b/samples/openapi3/client/petstore/python-experimental/test/test_order.py new file mode 100644 index 00000000000..10ce38e954e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_order.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestOrder(unittest.TestCase): + """Order unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrder(self): + """Test Order""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Order() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py new file mode 100644 index 00000000000..c191d04ec6b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestOuterComposite(unittest.TestCase): + """OuterComposite unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterComposite(self): + """Test OuterComposite""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.OuterComposite() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py new file mode 100644 index 00000000000..ad8f7cc68b2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestOuterEnum(unittest.TestCase): + """OuterEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnum(self): + """Test OuterEnum""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.OuterEnum() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py new file mode 100644 index 00000000000..80c9534a88e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestOuterEnumDefaultValue(unittest.TestCase): + """OuterEnumDefaultValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnumDefaultValue(self): + """Test OuterEnumDefaultValue""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.OuterEnumDefaultValue() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py new file mode 100644 index 00000000000..60724eefd71 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestOuterEnumInteger(unittest.TestCase): + """OuterEnumInteger unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnumInteger(self): + """Test OuterEnumInteger""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.OuterEnumInteger() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py new file mode 100644 index 00000000000..8eca8fa69ac --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestOuterEnumIntegerDefaultValue(unittest.TestCase): + """OuterEnumIntegerDefaultValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnumIntegerDefaultValue(self): + """Test OuterEnumIntegerDefaultValue""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.OuterEnumIntegerDefaultValue() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet.py b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py new file mode 100644 index 00000000000..db9e3729f50 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestPet(unittest.TestCase): + """Pet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPet(self): + """Test Pet""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Pet() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py new file mode 100644 index 00000000000..77665df879f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.pet_api import PetApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestPetApi(unittest.TestCase): + """PetApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.pet_api.PetApi() # noqa: E501 + + def tearDown(self): + pass + + def test_add_pet(self): + """Test case for add_pet + + Add a new pet to the store # noqa: E501 + """ + pass + + def test_delete_pet(self): + """Test case for delete_pet + + Deletes a pet # noqa: E501 + """ + pass + + def test_find_pets_by_status(self): + """Test case for find_pets_by_status + + Finds Pets by status # noqa: E501 + """ + pass + + def test_find_pets_by_tags(self): + """Test case for find_pets_by_tags + + Finds Pets by tags # noqa: E501 + """ + pass + + def test_get_pet_by_id(self): + """Test case for get_pet_by_id + + Find pet by ID # noqa: E501 + """ + pass + + def test_update_pet(self): + """Test case for update_pet + + Update an existing pet # noqa: E501 + """ + pass + + def test_update_pet_with_form(self): + """Test case for update_pet_with_form + + Updates a pet in the store with form data # noqa: E501 + """ + pass + + def test_upload_file(self): + """Test case for upload_file + + uploads an image # noqa: E501 + """ + pass + + def test_upload_file_with_required_file(self): + """Test case for upload_file_with_required_file + + uploads an image (required) # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py b/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py new file mode 100644 index 00000000000..553768f3303 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestReadOnlyFirst(unittest.TestCase): + """ReadOnlyFirst unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testReadOnlyFirst(self): + """Test ReadOnlyFirst""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.ReadOnlyFirst() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py new file mode 100644 index 00000000000..7de520d9cef --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestSpecialModelName(unittest.TestCase): + """SpecialModelName unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSpecialModelName(self): + """Test SpecialModelName""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.SpecialModelName() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py new file mode 100644 index 00000000000..81848d24a67 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.store_api import StoreApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestStoreApi(unittest.TestCase): + """StoreApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.store_api.StoreApi() # noqa: E501 + + def tearDown(self): + pass + + def test_delete_order(self): + """Test case for delete_order + + Delete purchase order by ID # noqa: E501 + """ + pass + + def test_get_inventory(self): + """Test case for get_inventory + + Returns pet inventories by status # noqa: E501 + """ + pass + + def test_get_order_by_id(self): + """Test case for get_order_by_id + + Find purchase order by ID # noqa: E501 + """ + pass + + def test_place_order(self): + """Test case for place_order + + Place an order for a pet # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py new file mode 100644 index 00000000000..af071721eba --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestStringBooleanMap(unittest.TestCase): + """StringBooleanMap unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testStringBooleanMap(self): + """Test StringBooleanMap""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.StringBooleanMap() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_tag.py b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py new file mode 100644 index 00000000000..27c2be5391a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestTag(unittest.TestCase): + """Tag unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTag(self): + """Test Tag""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Tag() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user.py b/samples/openapi3/client/petstore/python-experimental/test/test_user.py new file mode 100644 index 00000000000..3df641e29b6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_user.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestUser(unittest.TestCase): + """User unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUser(self): + """Test User""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.User() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py new file mode 100644 index 00000000000..6df730fba2b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.user_api import UserApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestUserApi(unittest.TestCase): + """UserApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.user_api.UserApi() # noqa: E501 + + def tearDown(self): + pass + + def test_create_user(self): + """Test case for create_user + + Create user # noqa: E501 + """ + pass + + def test_create_users_with_array_input(self): + """Test case for create_users_with_array_input + + Creates list of users with given input array # noqa: E501 + """ + pass + + def test_create_users_with_list_input(self): + """Test case for create_users_with_list_input + + Creates list of users with given input array # noqa: E501 + """ + pass + + def test_delete_user(self): + """Test case for delete_user + + Delete user # noqa: E501 + """ + pass + + def test_get_user_by_name(self): + """Test case for get_user_by_name + + Get user by user name # noqa: E501 + """ + pass + + def test_login_user(self): + """Test case for login_user + + Logs user into the system # noqa: E501 + """ + pass + + def test_logout_user(self): + """Test case for logout_user + + Logs out current logged in user session # noqa: E501 + """ + pass + + def test_update_user(self): + """Test case for update_user + + Updated user # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test_python2.sh b/samples/openapi3/client/petstore/python-experimental/test_python2.sh new file mode 100755 index 00000000000..b2f344ec897 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test_python2.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=venv +DEACTIVE=false + +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 +PYTHONPATH="$(which python)" + +### set virtualenv +if [ -z "$VIRTUAL_ENV" ]; then + virtualenv $VENV --python=$PYTHONPATH --no-site-packages --always-copy + source $VENV/bin/activate + DEACTIVE=true +fi + +### install dependencies +pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT + +### run tests +tox -e py27 || exit 1 + +### static analysis of code +flake8 --show-source petstore_api/ + +### deactivate virtualenv +#if [ $DEACTIVE == true ]; then +# deactivate +#fi + diff --git a/samples/openapi3/client/petstore/python-experimental/test_python2_and_3.sh b/samples/openapi3/client/petstore/python-experimental/test_python2_and_3.sh new file mode 100755 index 00000000000..3205dfd07da --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test_python2_and_3.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=venv +DEACTIVE=false + +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 + +### set virtualenv +if [ -z "$VIRTUAL_ENV" ]; then + virtualenv $VENV --no-site-packages --always-copy + source $VENV/bin/activate + DEACTIVE=true +fi + +### install dependencies +pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT + +### run tests +tox || exit 1 + +### static analysis of code +flake8 --show-source petstore_api/ + +### deactivate virtualenv +#if [ $DEACTIVE == true ]; then +# deactivate +#fi diff --git a/samples/openapi3/client/petstore/python-experimental/tox.ini b/samples/openapi3/client/petstore/python-experimental/tox.ini new file mode 100644 index 00000000000..169d895329b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py27, py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=petstore_api diff --git a/samples/openapi3/server/petstore/python-flask-python2/openapi_server/openapi/openapi.yaml b/samples/openapi3/server/petstore/python-flask-python2/openapi_server/openapi/openapi.yaml index aa04dfb3cb1..922e0b4af69 100644 --- a/samples/openapi3/server/petstore/python-flask-python2/openapi_server/openapi/openapi.yaml +++ b/samples/openapi3/server/petstore/python-flask-python2/openapi_server/openapi/openapi.yaml @@ -26,7 +26,7 @@ paths: requestBody: $ref: '#/components/requestBodies/Pet' responses: - 405: + "405": description: Invalid input security: - petstore_auth: @@ -41,11 +41,11 @@ paths: requestBody: $ref: '#/components/requestBodies/Pet' responses: - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Pet not found - 405: + "405": description: Validation exception security: - petstore_auth: @@ -76,7 +76,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -89,7 +89,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": description: Invalid status value security: - petstore_auth: @@ -116,7 +116,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -129,7 +129,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": description: Invalid tag value security: - petstore_auth: @@ -159,7 +159,7 @@ paths: type: integer style: simple responses: - 400: + "400": description: Invalid pet value security: - petstore_auth: @@ -183,7 +183,7 @@ paths: type: integer style: simple responses: - 200: + "200": content: application/xml: schema: @@ -192,9 +192,9 @@ paths: schema: $ref: '#/components/schemas/Pet' description: successful operation - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Pet not found security: - api_key: [] @@ -228,7 +228,7 @@ paths: type: string type: object responses: - 405: + "405": description: Invalid input security: - petstore_auth: @@ -266,7 +266,7 @@ paths: type: string type: object responses: - 200: + "200": content: application/json: schema: @@ -285,7 +285,7 @@ paths: description: Returns a map of status codes to quantities operationId: get_inventory responses: - 200: + "200": content: application/json: schema: @@ -311,7 +311,7 @@ paths: description: order placed for purchasing the pet required: true responses: - 200: + "200": content: application/xml: schema: @@ -320,7 +320,7 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": description: Invalid Order summary: Place an order for a pet tags: @@ -341,9 +341,9 @@ paths: type: string style: simple responses: - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Order not found summary: Delete purchase order by ID tags: @@ -366,7 +366,7 @@ paths: type: integer style: simple responses: - 200: + "200": content: application/xml: schema: @@ -375,9 +375,9 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Order not found summary: Find purchase order by ID tags: @@ -453,7 +453,7 @@ paths: type: string style: form responses: - 200: + "200": content: application/xml: schema: @@ -485,7 +485,7 @@ paths: format: date-time type: string style: simple - 400: + "400": description: Invalid username/password supplied summary: Logs user into the system tags: @@ -517,9 +517,9 @@ paths: type: string style: simple responses: - 400: + "400": description: Invalid username supplied - 404: + "404": description: User not found security: - auth_cookie: [] @@ -539,7 +539,7 @@ paths: type: string style: simple responses: - 200: + "200": content: application/xml: schema: @@ -548,9 +548,9 @@ paths: schema: $ref: '#/components/schemas/User' description: successful operation - 400: + "400": description: Invalid username supplied - 404: + "404": description: User not found summary: Get user by user name tags: @@ -576,9 +576,9 @@ paths: description: Updated user object required: true responses: - 400: + "400": description: Invalid user supplied - 404: + "404": description: User not found security: - auth_cookie: [] diff --git a/samples/openapi3/server/petstore/python-flask/openapi_server/openapi/openapi.yaml b/samples/openapi3/server/petstore/python-flask/openapi_server/openapi/openapi.yaml index aa04dfb3cb1..922e0b4af69 100644 --- a/samples/openapi3/server/petstore/python-flask/openapi_server/openapi/openapi.yaml +++ b/samples/openapi3/server/petstore/python-flask/openapi_server/openapi/openapi.yaml @@ -26,7 +26,7 @@ paths: requestBody: $ref: '#/components/requestBodies/Pet' responses: - 405: + "405": description: Invalid input security: - petstore_auth: @@ -41,11 +41,11 @@ paths: requestBody: $ref: '#/components/requestBodies/Pet' responses: - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Pet not found - 405: + "405": description: Validation exception security: - petstore_auth: @@ -76,7 +76,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -89,7 +89,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": description: Invalid status value security: - petstore_auth: @@ -116,7 +116,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -129,7 +129,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": description: Invalid tag value security: - petstore_auth: @@ -159,7 +159,7 @@ paths: type: integer style: simple responses: - 400: + "400": description: Invalid pet value security: - petstore_auth: @@ -183,7 +183,7 @@ paths: type: integer style: simple responses: - 200: + "200": content: application/xml: schema: @@ -192,9 +192,9 @@ paths: schema: $ref: '#/components/schemas/Pet' description: successful operation - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Pet not found security: - api_key: [] @@ -228,7 +228,7 @@ paths: type: string type: object responses: - 405: + "405": description: Invalid input security: - petstore_auth: @@ -266,7 +266,7 @@ paths: type: string type: object responses: - 200: + "200": content: application/json: schema: @@ -285,7 +285,7 @@ paths: description: Returns a map of status codes to quantities operationId: get_inventory responses: - 200: + "200": content: application/json: schema: @@ -311,7 +311,7 @@ paths: description: order placed for purchasing the pet required: true responses: - 200: + "200": content: application/xml: schema: @@ -320,7 +320,7 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": description: Invalid Order summary: Place an order for a pet tags: @@ -341,9 +341,9 @@ paths: type: string style: simple responses: - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Order not found summary: Delete purchase order by ID tags: @@ -366,7 +366,7 @@ paths: type: integer style: simple responses: - 200: + "200": content: application/xml: schema: @@ -375,9 +375,9 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Order not found summary: Find purchase order by ID tags: @@ -453,7 +453,7 @@ paths: type: string style: form responses: - 200: + "200": content: application/xml: schema: @@ -485,7 +485,7 @@ paths: format: date-time type: string style: simple - 400: + "400": description: Invalid username/password supplied summary: Logs user into the system tags: @@ -517,9 +517,9 @@ paths: type: string style: simple responses: - 400: + "400": description: Invalid username supplied - 404: + "404": description: User not found security: - auth_cookie: [] @@ -539,7 +539,7 @@ paths: type: string style: simple responses: - 200: + "200": content: application/xml: schema: @@ -548,9 +548,9 @@ paths: schema: $ref: '#/components/schemas/User' description: successful operation - 400: + "400": description: Invalid username supplied - 404: + "404": description: User not found summary: Get user by user name tags: @@ -576,9 +576,9 @@ paths: description: Updated user object required: true responses: - 400: + "400": description: Invalid user supplied - 404: + "404": description: User not found security: - auth_cookie: [] From fc4563baef8a48cd6084f39279f3d9404fe32681 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2020 17:00:52 +0800 Subject: [PATCH 12/85] Bump spring-webflux from 5.0.8.RELEASE to 5.1.0.RELEASE in /samples/client/petstore/java/webclient (#5071) * Bump spring-webflux in /samples/client/petstore/java/webclient Bumps [spring-webflux](https://github.com/spring-projects/spring-framework) from 5.0.8.RELEASE to 5.1.0.RELEASE. - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v5.0.8.RELEASE...v5.1.0.RELEASE) Signed-off-by: dependabot[bot] * Bump spring-webflux version from 5.0.8 to 5.0.16 ref https://pivotal.io/security/cve-2020-5398 Co-authored-by: Akihito Nakano --- .../src/main/resources/Java/libraries/webclient/pom.mustache | 2 +- samples/client/petstore/java/webclient/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache index 7b57232bc5a..39cd7729c35 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache @@ -142,7 +142,7 @@ UTF-8 1.5.22 - 5.0.8.RELEASE + 5.0.16.RELEASE 2.10.1 2.10.1 0.2.1 diff --git a/samples/client/petstore/java/webclient/pom.xml b/samples/client/petstore/java/webclient/pom.xml index 1c54a76489c..3babb6c0d7b 100644 --- a/samples/client/petstore/java/webclient/pom.xml +++ b/samples/client/petstore/java/webclient/pom.xml @@ -121,7 +121,7 @@ UTF-8 1.5.22 - 5.0.8.RELEASE + 5.0.16.RELEASE 2.10.1 2.10.1 0.2.1 From bf57a9960d628f6517f610df9f5f79d5f4c49b33 Mon Sep 17 00:00:00 2001 From: Michele Albano Date: Wed, 22 Jan 2020 15:08:53 +0100 Subject: [PATCH 13/85] Rebased to current upstream/master. (#4514) Tests for python client, comprising support for additional_properties and arrays. There are ugly workarounds for when there are discriminators, since the python client generator does not fully handle them. Cool indentation of test files. --- .../languages/PythonClientCodegen.java | 178 ++++++++++++++++++ .../main/resources/python/model_test.mustache | 28 ++- .../petstore/python/test/test_animal.py | 25 ++- .../client/petstore/python/test/test_cat.py | 23 ++- .../petstore/python/test/test_category.py | 25 ++- .../petstore/python/test/test_enum_class.py | 22 ++- .../client/petstore/python/test/test_file.py | 23 ++- .../test/test_file_schema_test_class.py | 28 ++- .../petstore/python/test/test_format_test.py | 40 +++- .../petstore/python/test/test_map_test.py | 36 +++- ...perties_and_additional_properties_class.py | 29 ++- .../client/petstore/python/test/test_pet.py | 40 +++- 12 files changed, 443 insertions(+), 54 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index fd90aabdd03..f605ea8dbbb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -695,6 +695,184 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig return addRegularExpressionDelimiter(pattern); } + @Override + public String toExampleValue(Schema schema) { + return toExampleValueRecursive(schema, new ArrayList(), 5); + } + + private String toExampleValueRecursive(Schema schema, List included_schemas, int indentation) { + String indentation_string = ""; + for (int i=0 ; i< indentation ; i++) indentation_string += " "; + String example = super.toExampleValue(schema); + + // correct "true"s into "True"s, since super.toExampleValue uses "toString()" on Java booleans + if (ModelUtils.isBooleanSchema(schema) && null!=example) { + if ("false".equalsIgnoreCase(example)) example = "False"; + else example = "True"; + } + + // correct "'"s into "'"s after toString() + if (ModelUtils.isStringSchema(schema) && schema.getDefault() != null) { + example = (String) schema.getDefault(); + } + + if (StringUtils.isNotBlank(example) && !"null".equals(example)) { + if (ModelUtils.isStringSchema(schema)) { + example = "'" + example + "'"; + } + return example; + } + + if (schema.getEnum() != null && !schema.getEnum().isEmpty()) { + // Enum case: + example = schema.getEnum().get(0).toString(); + if (ModelUtils.isStringSchema(schema)) { + example = "'" + escapeText(example) + "'"; + } + if (null == example) + LOGGER.warn("Empty enum. Cannot built an example!"); + + return example; + } else if (null != schema.get$ref()) { + // $ref case: + Map allDefinitions = ModelUtils.getSchemas(this.openAPI); + String ref = ModelUtils.getSimpleRef(schema.get$ref()); + if (allDefinitions != null) { + Schema refSchema = allDefinitions.get(ref); + if (null == refSchema) { + return "None"; + } else { + String refTitle = refSchema.getTitle(); + if (StringUtils.isBlank(refTitle) || "null".equals(refTitle)) { + refSchema.setTitle(ref); + } + if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { + included_schemas.add(schema.getTitle()); + } + return toExampleValueRecursive(refSchema, included_schemas, indentation); + } + } else { + LOGGER.warn("allDefinitions not defined in toExampleValue!\n"); + } + } + if (ModelUtils.isDateSchema(schema)) { + example = "datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date()"; + return example; + } else if (ModelUtils.isDateTimeSchema(schema)) { + example = "datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f')"; + return example; + } else if (ModelUtils.isBinarySchema(schema)) { + example = "bytes(b'blah')"; + return example; + } else if (ModelUtils.isByteArraySchema(schema)) { + example = "YQ=="; + } else if (ModelUtils.isStringSchema(schema)) { + // a BigDecimal: + if ("Number".equalsIgnoreCase(schema.getFormat())) {return "1";} + if (StringUtils.isNotBlank(schema.getPattern())) return "'a'"; // I cheat here, since it would be too complicated to generate a string from a regexp + int len = 0; + if (null != schema.getMinLength()) len = schema.getMinLength().intValue(); + if (len < 1) len = 1; + example = ""; + for (int i=0;i reqs = schema.getRequired(); + + // if required and optionals + List reqs = new ArrayList(); + for (Object toAdd : schema.getProperties().keySet()) + reqs.add((String)toAdd); + + Map properties = schema.getProperties(); + Set propkeys = null; + if (properties != null) propkeys = properties.keySet(); + if (toExclude != null && reqs.contains(toExclude)) { + reqs.remove(toExclude); + } + for (String toRemove : included_schemas) { + if (reqs.contains(toRemove)) { + reqs.remove(toRemove); + } + } + if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { + included_schemas.add(schema.getTitle()); + } + if (null != schema.getRequired()) for (Object toAdd : schema.getRequired()) { + reqs.add((String)toAdd); + } + if (null!=propkeys) for (String propname : propkeys) { + Schema schema2 = properties.get(propname); + if (reqs.contains(propname)) { + String refTitle = schema2.getTitle(); + if (StringUtils.isBlank(refTitle) || "null".equals(refTitle)) { + schema2.setTitle(propname); + } + example += "\n" + indentation_string + underscore(propname) + " = "+ + toExampleValueRecursive(schema2, included_schemas, indentation+1)+", "; + } + } + example +=")"; + } else { + LOGGER.warn("Type " + schema.getType() + " not handled properly in toExampleValue"); + } + + if (ModelUtils.isStringSchema(schema)) { + example = "'" + escapeText(example) + "'"; + } + + return example; + } + @Override public void setParameterExampleValue(CodegenParameter p) { String example; diff --git a/modules/openapi-generator/src/main/resources/python/model_test.mustache b/modules/openapi-generator/src/main/resources/python/model_test.mustache index 765e4f9c2c0..b69f13f7441 100644 --- a/modules/openapi-generator/src/main/resources/python/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_test.mustache @@ -5,6 +5,7 @@ from __future__ import absolute_import import unittest +import datetime {{#models}} {{#model}} @@ -12,7 +13,6 @@ import {{packageName}} from {{modelPackage}}.{{classFilename}} import {{classname}} # noqa: E501 from {{packageName}}.rest import ApiException - class Test{{classname}}(unittest.TestCase): """{{classname}} unit test stubs""" @@ -22,11 +22,31 @@ class Test{{classname}}(unittest.TestCase): def tearDown(self): pass + def make_instance(self, include_optional): + """Test {{classname}} + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = {{packageName}}.models.{{classFilename}}.{{classname}}() # noqa: E501 + if include_optional : + return {{classname}}( +{{#vars}} + {{name}} = {{#example}}{{{.}}}{{/example}}{{^example}}None{{/example}}{{#hasMore}}, {{/hasMore}} +{{/vars}} + ) + else : + return {{classname}}( +{{#vars}} +{{#required}} + {{name}} = {{#example}}{{{.}}}{{/example}}{{^example}}None{{/example}}, +{{/required}} +{{/vars}} + ) + def test{{classname}}(self): """Test {{classname}}""" - # FIXME: construct object with mandatory attributes with example values - # model = {{packageName}}.models.{{classFilename}}.{{classname}}() # noqa: E501 - pass + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) {{/model}} {{/models}} diff --git a/samples/client/petstore/python/test/test_animal.py b/samples/client/petstore/python/test/test_animal.py index 179f1fbd0e5..88d0693a100 100644 --- a/samples/client/petstore/python/test/test_animal.py +++ b/samples/client/petstore/python/test/test_animal.py @@ -5,7 +5,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ @@ -13,12 +13,12 @@ from __future__ import absolute_import import unittest +import datetime import petstore_api from petstore_api.models.animal import Animal # noqa: E501 from petstore_api.rest import ApiException - class TestAnimal(unittest.TestCase): """Animal unit test stubs""" @@ -28,11 +28,26 @@ class TestAnimal(unittest.TestCase): def tearDown(self): pass + def make_instance(self, include_optional): + """Test Animal + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = petstore_api.models.animal.Animal() # noqa: E501 + if include_optional : + return Animal( + class_name = '0', + color = 'red' + ) + else : + return Animal( + class_name = '0', + ) + def testAnimal(self): """Test Animal""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.animal.Animal() # noqa: E501 - pass + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_cat.py b/samples/client/petstore/python/test/test_cat.py index 5ebd7908d2d..a835b6af736 100644 --- a/samples/client/petstore/python/test/test_cat.py +++ b/samples/client/petstore/python/test/test_cat.py @@ -5,7 +5,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ @@ -13,12 +13,12 @@ from __future__ import absolute_import import unittest +import datetime import petstore_api from petstore_api.models.cat import Cat # noqa: E501 from petstore_api.rest import ApiException - class TestCat(unittest.TestCase): """Cat unit test stubs""" @@ -28,11 +28,24 @@ class TestCat(unittest.TestCase): def tearDown(self): pass + def make_instance(self, include_optional): + """Test Cat + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = petstore_api.models.cat.Cat() # noqa: E501 + if include_optional : + return Cat( + declawed = True + ) + else : + return Cat( + ) + def testCat(self): """Test Cat""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.cat.Cat() # noqa: E501 - pass + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_category.py b/samples/client/petstore/python/test/test_category.py index 6a592521281..05b4714fe9f 100644 --- a/samples/client/petstore/python/test/test_category.py +++ b/samples/client/petstore/python/test/test_category.py @@ -5,7 +5,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ @@ -13,12 +13,12 @@ from __future__ import absolute_import import unittest +import datetime import petstore_api from petstore_api.models.category import Category # noqa: E501 from petstore_api.rest import ApiException - class TestCategory(unittest.TestCase): """Category unit test stubs""" @@ -28,11 +28,26 @@ class TestCategory(unittest.TestCase): def tearDown(self): pass + def make_instance(self, include_optional): + """Test Category + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = petstore_api.models.category.Category() # noqa: E501 + if include_optional : + return Category( + id = 56, + name = 'default-name' + ) + else : + return Category( + name = 'default-name', + ) + def testCategory(self): """Test Category""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.category.Category() # noqa: E501 - pass + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_enum_class.py b/samples/client/petstore/python/test/test_enum_class.py index 57eb14558a7..f092ab77642 100644 --- a/samples/client/petstore/python/test/test_enum_class.py +++ b/samples/client/petstore/python/test/test_enum_class.py @@ -5,7 +5,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ @@ -13,12 +13,12 @@ from __future__ import absolute_import import unittest +import datetime import petstore_api from petstore_api.models.enum_class import EnumClass # noqa: E501 from petstore_api.rest import ApiException - class TestEnumClass(unittest.TestCase): """EnumClass unit test stubs""" @@ -28,11 +28,23 @@ class TestEnumClass(unittest.TestCase): def tearDown(self): pass + def make_instance(self, include_optional): + """Test EnumClass + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = petstore_api.models.enum_class.EnumClass() # noqa: E501 + if include_optional : + return EnumClass( + ) + else : + return EnumClass( + ) + def testEnumClass(self): """Test EnumClass""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.enum_class.EnumClass() # noqa: E501 - pass + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_file.py b/samples/client/petstore/python/test/test_file.py index cc32edb7b52..bc51bffba56 100644 --- a/samples/client/petstore/python/test/test_file.py +++ b/samples/client/petstore/python/test/test_file.py @@ -5,7 +5,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ @@ -13,12 +13,12 @@ from __future__ import absolute_import import unittest +import datetime import petstore_api from petstore_api.models.file import File # noqa: E501 from petstore_api.rest import ApiException - class TestFile(unittest.TestCase): """File unit test stubs""" @@ -28,11 +28,24 @@ class TestFile(unittest.TestCase): def tearDown(self): pass + def make_instance(self, include_optional): + """Test File + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = petstore_api.models.file.File() # noqa: E501 + if include_optional : + return File( + source_uri = '0' + ) + else : + return File( + ) + def testFile(self): """Test File""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.file.File() # noqa: E501 - pass + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_file_schema_test_class.py b/samples/client/petstore/python/test/test_file_schema_test_class.py index 91e1b6a1c74..182a1b0a553 100644 --- a/samples/client/petstore/python/test/test_file_schema_test_class.py +++ b/samples/client/petstore/python/test/test_file_schema_test_class.py @@ -5,7 +5,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ @@ -13,12 +13,12 @@ from __future__ import absolute_import import unittest +import datetime import petstore_api from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501 from petstore_api.rest import ApiException - class TestFileSchemaTestClass(unittest.TestCase): """FileSchemaTestClass unit test stubs""" @@ -28,11 +28,29 @@ class TestFileSchemaTestClass(unittest.TestCase): def tearDown(self): pass + def make_instance(self, include_optional): + """Test FileSchemaTestClass + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501 + if include_optional : + return FileSchemaTestClass( + file = petstore_api.models.file.File( + source_uri = '0', ), + files = [ + petstore_api.models.file.File( + source_uri = '0', ) + ] + ) + else : + return FileSchemaTestClass( + ) + def testFileSchemaTestClass(self): """Test FileSchemaTestClass""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501 - pass + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_format_test.py b/samples/client/petstore/python/test/test_format_test.py index 46707c77b70..70255fccd1d 100644 --- a/samples/client/petstore/python/test/test_format_test.py +++ b/samples/client/petstore/python/test/test_format_test.py @@ -5,7 +5,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ @@ -13,12 +13,12 @@ from __future__ import absolute_import import unittest +import datetime import petstore_api from petstore_api.models.format_test import FormatTest # noqa: E501 from petstore_api.rest import ApiException - class TestFormatTest(unittest.TestCase): """FormatTest unit test stubs""" @@ -28,11 +28,41 @@ class TestFormatTest(unittest.TestCase): def tearDown(self): pass + def make_instance(self, include_optional): + """Test FormatTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = petstore_api.models.format_test.FormatTest() # noqa: E501 + if include_optional : + return FormatTest( + integer = 1E+1, + int32 = 2E+1, + int64 = 56, + number = 32.1, + float = 54.3, + double = 67.8, + string = 'a', + byte = 'YQ==', + binary = bytes(b'blah'), + date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + uuid = '72f98069-206d-4f12-9f12-3d1e525a8e84', + password = '0123456789', + big_decimal = 1 + ) + else : + return FormatTest( + number = 32.1, + byte = 'YQ==', + date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + password = '0123456789', + ) + def testFormatTest(self): """Test FormatTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.format_test.FormatTest() # noqa: E501 - pass + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_map_test.py b/samples/client/petstore/python/test/test_map_test.py index 0ba6481903e..40eb0a42e6e 100644 --- a/samples/client/petstore/python/test/test_map_test.py +++ b/samples/client/petstore/python/test/test_map_test.py @@ -5,7 +5,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ @@ -13,12 +13,12 @@ from __future__ import absolute_import import unittest +import datetime import petstore_api from petstore_api.models.map_test import MapTest # noqa: E501 from petstore_api.rest import ApiException - class TestMapTest(unittest.TestCase): """MapTest unit test stubs""" @@ -28,11 +28,37 @@ class TestMapTest(unittest.TestCase): def tearDown(self): pass + def make_instance(self, include_optional): + """Test MapTest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = petstore_api.models.map_test.MapTest() # noqa: E501 + if include_optional : + return MapTest( + map_map_of_string = { + 'key' : { + 'key' : '0' + } + }, + map_of_enum_string = { + 'UPPER' : 'UPPER' + }, + direct_map = { + 'key' : True + }, + indirect_map = { + 'key' : True + } + ) + else : + return MapTest( + ) + def testMapTest(self): """Test MapTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.map_test.MapTest() # noqa: E501 - pass + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py index 8893bdaf44e..ef77830aa19 100644 --- a/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python/test/test_mixed_properties_and_additional_properties_class.py @@ -5,7 +5,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ @@ -13,12 +13,12 @@ from __future__ import absolute_import import unittest +import datetime import petstore_api from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501 from petstore_api.rest import ApiException - class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" @@ -28,11 +28,30 @@ class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): def tearDown(self): pass + def make_instance(self, include_optional): + """Test MixedPropertiesAndAdditionalPropertiesClass + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 + if include_optional : + return MixedPropertiesAndAdditionalPropertiesClass( + uuid = '0', + date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + map = { + 'key' : petstore_api.models.animal.Animal( + class_name = '0', + color = 'red', ) + } + ) + else : + return MixedPropertiesAndAdditionalPropertiesClass( + ) + def testMixedPropertiesAndAdditionalPropertiesClass(self): """Test MixedPropertiesAndAdditionalPropertiesClass""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 - pass + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': diff --git a/samples/client/petstore/python/test/test_pet.py b/samples/client/petstore/python/test/test_pet.py index bc5cc30fac0..2e4a40d78b3 100644 --- a/samples/client/petstore/python/test/test_pet.py +++ b/samples/client/petstore/python/test/test_pet.py @@ -5,7 +5,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ @@ -13,12 +13,12 @@ from __future__ import absolute_import import unittest +import datetime import petstore_api from petstore_api.models.pet import Pet # noqa: E501 from petstore_api.rest import ApiException - class TestPet(unittest.TestCase): """Pet unit test stubs""" @@ -28,11 +28,41 @@ class TestPet(unittest.TestCase): def tearDown(self): pass + def make_instance(self, include_optional): + """Test Pet + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # model = petstore_api.models.pet.Pet() # noqa: E501 + if include_optional : + return Pet( + id = 56, + category = petstore_api.models.category.Category( + id = 56, + name = 'default-name', ), + name = 'doggie', + photo_urls = [ + '0' + ], + tags = [ + petstore_api.models.tag.Tag( + id = 56, + name = '0', ) + ], + status = 'available' + ) + else : + return Pet( + name = 'doggie', + photo_urls = [ + '0' + ], + ) + def testPet(self): """Test Pet""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.pet.Pet() # noqa: E501 - pass + inst_req_only = self.make_instance(include_optional=False) + inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': From ac528aaf07978ac722c6da5435cbda16aba9115f Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Wed, 22 Jan 2020 18:04:00 -0500 Subject: [PATCH 14/85] [test] Removes jmockit in favor of mockito (#5063) * [test] Removes jmockit in favor of mockito We use mockito in many tests. This removes jmockit which is run as a javaagent in favor of Mockito which is not. This work is in preparation for applying some static analysis tools, while evaluating others such as Jacoco. I'm also look at ways to improve build times while also decreasing "ramp up time" for contributions from the community. Reducing the number of mock frameworks and dependencies is a step toward that goal. * Rename method in new.sh * [cli] Mock the generate task --- .gitignore | 1 + modules/openapi-generator-cli/pom.xml | 6 +- .../openapitools/codegen/cmd/Generate.java | 39 +- .../codegen/cmd/GenerateTest.java | 881 ++++++++---------- modules/openapi-generator/pom.xml | 8 +- .../codegen/AbstractOptionsTest.java | 20 +- .../codegen/bash/BashClientOptionsTest.java | 44 +- .../codegen/dart/DartClientOptionsTest.java | 43 +- .../dartdio/DartDioClientOptionsTest.java | 49 +- .../elixir/ElixirClientOptionsTest.java | 15 +- .../codegen/go/GoClientOptionsTest.java | 39 +- .../HaskellServantOptionsTest.java | 22 +- .../lumen/PhpLumenServerOptionsTest.java | 37 +- .../codegen/mysql/MysqlSchemaOptionsTest.java | 22 +- .../codegen/objc/ObjcClientOptionsTest.java | 31 +- .../ScalaHttpClientOptionsProvider.java | 2 +- .../codegen/perl/PerlClientOptionsTest.java | 22 +- .../codegen/php/PhpClientOptionsTest.java | 37 +- .../python/PythonClientOptionsTest.java | 37 +- .../codegen/ruby/RubyClientOptionsTest.java | 44 +- .../RubySinatraServerOptionsTest.java | 14 +- .../scalaakka/ScalaAkkaClientOptionsTest.java | 31 +- .../ScalaHttpClientOptionsTest.java | 31 +- .../silex/PhpSilexServerOptionsTest.java | 16 +- .../slim/PhpSlimServerOptionsTest.java | 37 +- .../slim4/PhpSlim4ServerOptionsTest.java | 40 +- .../codegen/swift3/Swift3OptionsTest.java | 34 +- .../codegen/swift4/Swift4OptionsTest.java | 37 +- .../codegen/swift5/Swift5OptionsTest.java | 34 +- .../TypeScriptAureliaClientOptionsTest.java | 25 +- .../TypeScriptFetchClientOptionsTest.java | 28 +- .../TypeScriptAngularClientOptionsTest.java | 28 +- .../TypeScriptAngularJsClientOptionsTest.java | 25 +- .../TypeScriptNodeClientOptionsTest.java | 25 +- new.sh | 16 +- pom.xml | 18 +- 36 files changed, 730 insertions(+), 1108 deletions(-) diff --git a/.gitignore b/.gitignore index f73850f56b0..81c33b22aac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.scannerwork/ .vscode *.iml out/ diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index b02f64f636d..6aa9eb42def 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -109,9 +109,9 @@ test - org.jmockit - jmockit - + org.mockito + mockito-core + ${mockito-version} test diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java index cf8f8a1dd39..de331cde1ea 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java @@ -28,22 +28,17 @@ import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.stream.Stream; -import org.openapitools.codegen.ClientOptInput; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.DefaultGenerator; -import org.openapitools.codegen.GeneratorNotFoundException; + +import org.openapitools.codegen.*; import org.openapitools.codegen.config.CodegenConfigurator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -/** - * User: lanwen Date: 24.03.15 Time: 20:22 - */ - @Command(name = "generate", description = "Generate code with the specified generator.") public class Generate implements Runnable { - // private static final Logger LOGGER = LoggerFactory.getLogger(Generate.class); + CodegenConfigurator configurator; + Generator generator; @Option(name = {"-v", "--verbose"}, description = "verbose mode") private Boolean verbose; @@ -257,13 +252,18 @@ public class Generate implements Runnable { .ifPresent(FilterAttachable::clearAllFilters); } - // attempt to read from config file - CodegenConfigurator configurator = CodegenConfigurator.fromFile(configFile); - - // if a config file wasn't specified or we were unable to read it + // this initial check allows for field-level package private injection (for unit testing) if (configurator == null) { - // createa a fresh configurator - configurator = new CodegenConfigurator(); + if (configFile != null && configFile.length() > 0) { + // attempt to load from configFile + configurator = CodegenConfigurator.fromFile(configFile); + } + + // if a config file wasn't specified, or we were unable to read it + if (configurator == null) { + // create a fresh configurator + configurator = new CodegenConfigurator(); + } } // now override with any specified parameters @@ -413,7 +413,14 @@ public class Generate implements Runnable { try { final ClientOptInput clientOptInput = configurator.toClientOptInput(); - new DefaultGenerator().opts(clientOptInput).generate(); + + // this null check allows us to inject for unit testing. + if (generator == null) { + generator = new DefaultGenerator(); + } + + generator.opts(clientOptInput); + generator.generate(); } catch (GeneratorNotFoundException e) { System.err.println(e.getMessage()); System.err.println("[error] Check the spelling of the generator's name and try again."); diff --git a/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java b/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java index 8f1879dd987..496e078a15d 100644 --- a/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java +++ b/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java @@ -17,536 +17,417 @@ package org.openapitools.codegen.cmd; -import org.openapitools.codegen.ClientOptInput; -import org.openapitools.codegen.DefaultGenerator; -import org.openapitools.codegen.OpenAPIGenerator; -import org.openapitools.codegen.config.CodegenConfigurator; -import mockit.Expectations; -import mockit.FullVerifications; -import mockit.Injectable; -import mockit.Mocked; -import mockit.Verifications; +import io.airlift.airline.Cli; import org.apache.commons.lang3.ArrayUtils; +import org.mockito.MockSettings; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.Generator; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; + +import static org.mockito.Answers.CALLS_REAL_METHODS; +import static org.mockito.Mockito.*; +import static org.testng.Assert.fail; + @SuppressWarnings("unused") public class GenerateTest { - @Mocked - CodegenConfigurator configurator; + protected MockSettings mockSettings = withSettings().useConstructor().defaultAnswer(CALLS_REAL_METHODS); + private Generator generator; + private CodegenConfigurator configurator; + private Path outputDirectory; - @Injectable - ClientOptInput clientOptInput; + @AfterMethod + public void afterEachTest() { + outputDirectory.toFile().deleteOnExit(); + } - @Mocked - DefaultGenerator generator; + @BeforeMethod + public void beforeEachTest() throws IOException { + outputDirectory = Files.createTempDirectory("GenerateTest"); + generator = mock(DefaultGenerator.class); + when(generator.generate()).thenReturn(new ArrayList<>()); - @Test - public void testVerbose() throws Exception { - setupAndRunGenericTest("-v"); - - new FullVerifications() { - { - configurator.setVerbose(true); - times = 1; - } - }; - - setupAndRunGenericTest("--verbose"); - - new FullVerifications() { - { - configurator.setVerbose(true); - times = 1; - } - }; + configurator = mock(CodegenConfigurator.class, mockSettings); } @Test - public void testRequiredArgs_ShortArgs() throws Exception { - setupAndRunTest("-i", "src/test/resources/swagger.yaml", "-g", "java", "-o", "src/main/java", false, null, "-p", "foo=bar"); - new FullVerifications() { - { - configurator.addAdditionalProperty("foo", "bar"); - times = 1; - } - }; - } - - @Test - public void testRequiredArgs_LongArgs() throws Exception { - setupAndRunTest("--input-spec", "src/test/resources/swagger.yaml", "--generator-name", "java", "--output", - "src/main/java", false, null); - new FullVerifications() { - { - } - }; - } - - @Test - public void testTemplateDir() throws Exception { - - final String templateDir = "src/main/resources/customTemplates"; - - setupAndRunGenericTest("--template-dir", templateDir); - - new FullVerifications() { - { - configurator.setTemplateDir(templateDir); - times = 1; - } - }; - - setupAndRunGenericTest("-t", templateDir); - - new FullVerifications() { - { - configurator.setTemplateDir(templateDir); - times = 1; - } - }; - } - - @Test - public void testAuth() throws Exception { - - final String auth = "hello:world"; - - setupAndRunGenericTest("--auth", auth); - - new FullVerifications() { - { - configurator.setAuth(auth); - times = 1; - } - }; - - setupAndRunGenericTest("-a", auth); - - new FullVerifications() { - { - configurator.setAuth(auth); - times = 1; - } - }; - - setupAndRunGenericTest(); - - new FullVerifications() { - { - configurator.setAuth(anyString); - times = 0; - } - }; - } - - @Test - public void testConfigJson() throws Exception { - - setupAndRunTest("-i", "src/test/resources/swagger.yaml", "-g", "java", "-o", "src/main/java", true, - "config.json", "-c", "config.json"); - - new FullVerifications() { - { - } - }; - - setupAndRunTest("-i", "src/test/resources/swagger.yaml", "-g", "java", "-o", "src/main/java", true, - "config.json", "--config", "config.json"); - - new FullVerifications() { - { - } - }; - } - - @Test - public void testConfigYaml() throws Exception { - - setupAndRunTest("-i", "src/test/resources/swagger.yaml", "-g", "java", "-o", "src/main/java", true, - "config.yaml", "-c", "config.yaml"); - - new FullVerifications() { - { - } - }; - - setupAndRunTest("-i", "src/test/resources/swagger.yaml", "-g", "java", "-o", "src/main/java", true, - "config.yaml", "--config", "config.yaml"); - - new FullVerifications() { - { - } - }; - } - - @Test - public void testSkipOverwrite() throws Exception { - - setupAndRunGenericTest("-s"); - new FullVerifications() { - { - configurator.setSkipOverwrite(true); - times = 1; - } - }; - - setupAndRunGenericTest("--skip-overwrite"); - new FullVerifications() { - { - configurator.setSkipOverwrite(true); - times = 1; - } - }; - } - - @Test - public void testStrictSpec() throws Exception { - - setupAndRunGenericTest("--strict-spec", "true"); - new FullVerifications() { - { - configurator.setStrictSpecBehavior(true); - times = 1; - } - }; - - setupAndRunGenericTest("--strict-spec", "false"); - new FullVerifications() { - { - configurator.setStrictSpecBehavior(false); - times = 1; - } - }; - } - - @Test - public void testPackageName() throws Exception { - final String value = "io.foo.bar.baz"; - setupAndRunGenericTest("--package-name", value); - - new FullVerifications() { - { - configurator.setPackageName(value); - times = 1; - } - }; - } - - @Test - public void testApiPackage() throws Exception { - final String value = "io.foo.bar.api"; - setupAndRunGenericTest("--api-package", value); - - new FullVerifications() { - { - configurator.setApiPackage(value); - times = 1; - } - }; - } - - @Test - public void testModelPackage() throws Exception { - final String value = "io.foo.bar.api"; - setupAndRunGenericTest("--model-package", value); - - new FullVerifications() { - { - configurator.setModelPackage(value); - times = 1; - } - }; - } - - @Test - public void testInstantiationTypes() throws Exception { - - setupAndRunGenericTest("--instantiation-types", "hello=world,key=,foo=bar,key2"); - - new FullVerifications() { - { - configurator.addInstantiationType("hello", "world"); - times = 1; - configurator.addInstantiationType("foo", "bar"); - times = 1; - configurator.addInstantiationType("key", ""); - times = 1; - configurator.addInstantiationType("key2", ""); - times = 1; - } - }; - - setupAndRunGenericTest("--instantiation-types", "hello=world", "--instantiation-types", - "key=", "--instantiation-types", "foo=bar", "--instantiation-types", "key2"); - - new FullVerifications() { - { - configurator.addInstantiationType("hello", "world"); - times = 1; - configurator.addInstantiationType("foo", "bar"); - times = 1; - configurator.addInstantiationType("key", ""); - times = 1; - configurator.addInstantiationType("key2", ""); - times = 1; - } - }; - } - - @Test - public void testTypeMappings() throws Exception { - setupAndRunGenericTest("--type-mappings", "hello=world,key=,foo=bar,key2"); - - new FullVerifications() { - { - configurator.addTypeMapping("hello", "world"); - times = 1; - configurator.addTypeMapping("foo", "bar"); - times = 1; - configurator.addTypeMapping("key", ""); - times = 1; - configurator.addTypeMapping("key2", ""); - times = 1; - } - }; - - setupAndRunGenericTest("--type-mappings", "hello=world", "--type-mappings", "key=", - "--type-mappings", "foo=bar", "--type-mappings", "key2"); - - new FullVerifications() { - { - configurator.addTypeMapping("hello", "world"); - times = 1; - configurator.addTypeMapping("foo", "bar"); - times = 1; - configurator.addTypeMapping("key", ""); - times = 1; - configurator.addTypeMapping("key2", ""); - times = 1; - } - }; - } - - @Test - public void testAdditionalProperties() throws Exception { + public void testAdditionalPropertiesLong() { setupAndRunGenericTest("--additional-properties", "hello=world,key=,foo=bar,key2"); + verify(configurator).addAdditionalProperty("hello", "world"); + verify(configurator).addAdditionalProperty("foo", "bar"); + verify(configurator).addAdditionalProperty("key", ""); + verify(configurator).addAdditionalProperty("key2", ""); + } - new FullVerifications() { - { - configurator.addAdditionalProperty("hello", "world"); - times = 1; - configurator.addAdditionalProperty("foo", "bar"); - times = 1; - configurator.addAdditionalProperty("key", ""); - times = 1; - configurator.addAdditionalProperty("key2", ""); - times = 1; - } - }; - + @Test + public void testAdditionalPropertiesLongMultiple() { setupAndRunGenericTest("--additional-properties", "hello=world", "--additional-properties", "key=", "--additional-properties", "foo=bar", "--additional-properties", "key2"); - - new FullVerifications() { - { - configurator.addAdditionalProperty("hello", "world"); - times = 1; - configurator.addAdditionalProperty("foo", "bar"); - times = 1; - configurator.addAdditionalProperty("key", ""); - times = 1; - configurator.addAdditionalProperty("key2", ""); - times = 1; - } - }; + verify(configurator).addAdditionalProperty("hello", "world"); + verify(configurator).addAdditionalProperty("foo", "bar"); + verify(configurator).addAdditionalProperty("key", ""); + verify(configurator).addAdditionalProperty("key2", ""); } @Test - public void testLanguageSpecificPrimitives() throws Exception { - setupAndRunGenericTest("--language-specific-primitives", "foo,,bar", - "--language-specific-primitives", "hello,world"); - - new FullVerifications() { - { - configurator.addLanguageSpecificPrimitive("foo"); - times = 1; - configurator.addLanguageSpecificPrimitive("bar"); - times = 1; - configurator.addLanguageSpecificPrimitive("hello"); - times = 1; - configurator.addLanguageSpecificPrimitive("world"); - times = 1; - } - }; - } - - @Test - public void testImportMappings() throws Exception { - setupAndRunGenericTest("--import-mappings", "hello=world,key=,foo=bar,key2"); - - new FullVerifications() { - { - configurator.addImportMapping("hello", "world"); - times = 1; - configurator.addImportMapping("foo", "bar"); - times = 1; - configurator.addImportMapping("key", ""); - times = 1; - configurator.addImportMapping("key2", ""); - times = 1; - } - }; - - setupAndRunGenericTest("--import-mappings", "hello=world", "--import-mappings", "key=", - "--import-mappings", "foo=bar", "--import-mappings", "key2"); - - new FullVerifications() { - { - configurator.addImportMapping("hello", "world"); - times = 1; - configurator.addImportMapping("foo", "bar"); - times = 1; - configurator.addImportMapping("key", ""); - times = 1; - configurator.addImportMapping("key2", ""); - times = 1; - } - }; - } - - @Test - public void testInvokerPackage() throws Exception { + public void testApiPackage() { final String value = "io.foo.bar.api"; - setupAndRunGenericTest("--invoker-package", value); - - new FullVerifications() { - { - configurator.setInvokerPackage(value); - times = 1; - } - }; + setupAndRunGenericTest("--api-package", value); + verify(configurator).setApiPackage(value); } @Test - public void testGroupId() throws Exception { - final String value = "io.foo.bar.api"; - setupAndRunGenericTest("--group-id", value); - - new FullVerifications() { - { - configurator.setGroupId(value); - times = 1; - } - }; - } - - @Test - public void testArtifactId() throws Exception { + public void testArtifactId() { final String value = "awesome-api"; setupAndRunGenericTest("--artifact-id", value); - new FullVerifications() { - { - configurator.setArtifactId(value); - times = 1; - } - }; - } - - @Test - public void testArtifactVersion() throws Exception { - final String value = "1.2.3"; - setupAndRunGenericTest("--artifact-version", value); - - new FullVerifications() { - { - configurator.setArtifactVersion(value); - times = 1; - } - }; - } - - @Test - public void testLibrary() throws Exception { - final String value = "library1"; - setupAndRunGenericTest("--library", value); - - new FullVerifications() { - { - configurator.setLibrary(value); - times = 1; - } - }; - } - - private void setupAndRunTest(String specFlag, final String spec, String langFlag, - final String lang, String outputDirFlag, final String outputDir, - boolean configuratorFromFile, final String configFile, String... additionalParameters) { - final String[] commonArgs = - {"generate", langFlag, lang, outputDirFlag, outputDir, specFlag, spec}; - - String[] argsToUse = ArrayUtils.addAll(commonArgs, additionalParameters); - - if (configuratorFromFile) { - - new Expectations() { - { - CodegenConfigurator.fromFile(configFile); - times = 1; - result = configurator; - } - }; - - } else { - new Expectations() { - { - CodegenConfigurator.fromFile(anyString); - result = null; - - new CodegenConfigurator(); - times = 1; - result = configurator; - } - }; - } - - new Expectations() { - { - - configurator.toClientOptInput(); - times = 1; - result = clientOptInput; - - new DefaultGenerator(); - times = 1; - result = generator; - - generator.opts(clientOptInput); - times = 1; - result = generator; - - generator.generate(); - times = 1; - - } - }; - - OpenAPIGenerator.main(argsToUse); - - new Verifications() { - { - configurator.setGeneratorName(lang); - times = 1; - configurator.setInputSpec(spec); - times = 1; - configurator.setOutputDir(outputDir); - } - }; + verify(configurator).setArtifactId(value); } private void setupAndRunGenericTest(String... additionalParameters) { setupAndRunTest("-i", "src/test/resources/swagger.yaml", "-g", "java", "-o", "src/main/java", false, null, additionalParameters); } + + @SuppressWarnings("SameParameterValue") + private void setupAndRunTest(String specFlag, final String spec, String langFlag, + final String lang, String outputDirFlag, final String outputDir, + boolean configuratorFromFile, final String configFile, String... additionalParameters) { + final String[] commonArgs = + {"generate", langFlag, lang, outputDirFlag, outputDir, specFlag, spec}; + + String[] argsToUse = ArrayUtils.addAll(commonArgs, additionalParameters); + + Cli.CliBuilder builder = + Cli.builder("openapi-generator-cli") + .withCommands(Generate.class); + + Generate generate = (Generate) builder.build().parse(argsToUse); + + generate.configurator = configurator; + generate.generator = generator; + + try { + generate.run(); + } finally { + verify(configurator).setInputSpec(spec); + verify(configurator).setGeneratorName(lang); + verify(configurator).setOutputDir(outputDir); + } + } + + @Test + public void testArtifactVersion() { + final String value = "1.2.3"; + setupAndRunGenericTest("--artifact-version", value); + + verify(configurator).setArtifactVersion(value); + } + + @Test + public void testAuthLong() { + final String auth = "hello:world"; + setupAndRunGenericTest("--auth", auth); + verify(configurator).toClientOptInput(); + verify(configurator).toContext(); + verify(configurator).setAuth(auth); + verifyNoMoreInteractions(configurator); + } + + @Test + public void testAuthShort() { + final String auth = "hello:world"; + setupAndRunGenericTest("-a", auth); + verify(configurator).toClientOptInput(); + verify(configurator).toContext(); + verify(configurator).setAuth(auth); + verifyNoMoreInteractions(configurator); + } + + @Test + public void testAuthUnspecified() { + setupAndRunGenericTest(); + + verify(configurator).toClientOptInput(); + verify(configurator).toContext(); + + verify(configurator, never()).setAuth(anyString()); + verifyNoMoreInteractions(configurator); + } + + @Test + public void testConfigJsonLong() { + setupAndRunTest("-i", "src/test/resources/swagger.yaml", "-g", "java", "-o", "src/main/java", true, + "config.json", "--config", "config.json"); + + verify(configurator).toClientOptInput(); + verify(configurator).toContext(); + + verifyNoMoreInteractions(configurator); + } + + @Test + public void testConfigJsonShort() { + setupAndRunTest("-i", "src/test/resources/swagger.yaml", "-g", "java", "-o", "src/main/java", true, + "config.json", "-c", "config.json"); + + // on top of those in setupAndRunTest + verify(configurator).toClientOptInput(); + verify(configurator).toContext(); + + verifyNoMoreInteractions(configurator); + } + + @Test + public void testConfigYamlLong() { + setupAndRunTest("-i", "src/test/resources/swagger.yaml", "-g", "java", "-o", "src/main/java", true, + "config.yaml", "--config", "config.yaml"); + + verify(configurator).toClientOptInput(); + verify(configurator).toContext(); + + verifyNoMoreInteractions(configurator); + } + + @Test + public void testConfigYamlShort() { + setupAndRunTest("-i", "src/test/resources/swagger.yaml", "-g", "java", "-o", "src/main/java", true, + "config.yaml", "-c", "config.yaml"); + + // on top of those in setupAndRunTest + verify(configurator).toClientOptInput(); + verify(configurator).toContext(); + + verifyNoMoreInteractions(configurator); + } + + @Test + public void testGroupId() { + final String value = "io.foo.bar.api"; + setupAndRunGenericTest("--group-id", value); + verify(configurator).setGroupId(value); + } + + @Test + public void testImportMappingsLong() { + setupAndRunGenericTest("--import-mappings", "hello=world,key=,foo=bar,key2"); + + verify(configurator).addImportMapping("hello", "world"); + verify(configurator).addImportMapping("foo", "bar"); + verify(configurator).addImportMapping("key", ""); + verify(configurator).addImportMapping("key2", ""); + } + + @Test + public void testImportMappingsLongMultiple() { + setupAndRunGenericTest("--import-mappings", "hello=world", "--import-mappings", "key=", + "--import-mappings", "foo=bar", "--import-mappings", "key2"); + + verify(configurator).addImportMapping("hello", "world"); + verify(configurator).addImportMapping("foo", "bar"); + verify(configurator).addImportMapping("key", ""); + verify(configurator).addImportMapping("key2", ""); + } + + @Test + public void testInstantiationTypesLong() { + setupAndRunGenericTest("--instantiation-types", "hello=world,key=,foo=bar,key2"); + verify(configurator).addInstantiationType("hello", "world"); + verify(configurator).addInstantiationType("foo", "bar"); + verify(configurator).addInstantiationType("key", ""); + verify(configurator).addInstantiationType("key2", ""); + } + + @Test + public void testInstantiationTypesLongMultiple() { + setupAndRunGenericTest("--instantiation-types", "hello=world", "--instantiation-types", + "key=", "--instantiation-types", "foo=bar", "--instantiation-types", "key2"); + verify(configurator).addInstantiationType("hello", "world"); + verify(configurator).addInstantiationType("foo", "bar"); + verify(configurator).addInstantiationType("key", ""); + verify(configurator).addInstantiationType("key2", ""); + } + + @Test + public void testInvokerPackage() { + final String value = "io.foo.bar.api"; + setupAndRunGenericTest("--invoker-package", value); + verify(configurator).setInvokerPackage(value); + } + + @Test + public void testLanguageSpecificPrimitives() { + setupAndRunGenericTest("--language-specific-primitives", "foo,,bar", + "--language-specific-primitives", "hello,world"); + + verify(configurator).addLanguageSpecificPrimitive("foo"); + verify(configurator).addLanguageSpecificPrimitive("bar"); + verify(configurator).addLanguageSpecificPrimitive("hello"); + verify(configurator).addLanguageSpecificPrimitive("world"); + } + + @Test + public void testLibrary() { + final String value = "feign"; + setupAndRunGenericTest("--library", value); + verify(configurator).setLibrary(value); + } + + @Test + public void testModelPackage() { + final String value = "io.foo.bar.api"; + setupAndRunGenericTest("--model-package", value); + verify(configurator).setModelPackage(value); + } + + @Test + public void testPackageName() { + final String value = "io.foo.bar.baz"; + setupAndRunGenericTest("--package-name", value); + verify(configurator).setPackageName(value); + } + + @Test + public void testRequiredArgs_LongArgs() { + setupAndRunTest("--input-spec", "src/test/resources/swagger.yaml", "--generator-name", "java", "--output", + "src/main/java", false, null); + + // on top of those in setupAndRunTest: + verify(configurator).toClientOptInput(); + verify(configurator).toContext(); + + verifyNoMoreInteractions(configurator); + } + + @Test + public void testRequiredArgs_ShortArgs() { + setupAndRunTest("-i", "src/test/resources/swagger.yaml", "-g", "java", "-o", "src/main/java", false, null, "-p", "foo=bar"); + + verify(configurator).addAdditionalProperty("foo", "bar"); + verify(configurator).toClientOptInput(); + verify(configurator).toContext(); + + verifyNoMoreInteractions(configurator); + } + + @Test + public void testSkipOverwriteLong() { + setupAndRunGenericTest("--skip-overwrite"); + verify(configurator).setSkipOverwrite(true); + verify(configurator).toClientOptInput(); + verify(configurator).toContext(); + verifyNoMoreInteractions(configurator); + } + + @Test + public void testSkipOverwriteShort() { + setupAndRunGenericTest("-s"); + verify(configurator).setSkipOverwrite(true); + verify(configurator).toClientOptInput(); + verify(configurator).toContext(); + verifyNoMoreInteractions(configurator); + } + + @Test + public void testStrictSpecFalse() { + setupAndRunGenericTest("--strict-spec", "false"); + verify(configurator).setStrictSpecBehavior(false); + } + + @Test + public void testStrictSpecTrue() { + setupAndRunGenericTest("--strict-spec", "true"); + verify(configurator).setStrictSpecBehavior(true); + } + + @SuppressWarnings("ResultOfMethodCallIgnored") + @Test + public void testTemplateDirLong() { + final String templateDir = "src/main/resources/customTemplates"; + File f = outputDirectory.resolve(templateDir).toFile(); + try { + f.mkdirs(); + setupAndRunGenericTest("--template-dir", f.getAbsolutePath()); + verify(configurator).setTemplateDir(f.getAbsolutePath()); + verify(configurator).toClientOptInput(); + verify(configurator).toContext(); + verifyNoMoreInteractions(configurator); + } finally { + if(!f.delete()) { + System.out.println("Directory didn't delete. You can ignore this."); + } + } + } + + @Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Template directory src/main/resources/customTemplates does not exist.") + public void testTemplateDirMustExist() { + final String templateDir = "src/main/resources/customTemplates"; + setupAndRunGenericTest("-t", templateDir); + fail("Expected exception was not thrown."); + } + + @SuppressWarnings("ResultOfMethodCallIgnored") + @Test + public void testTemplateDirShort() { + final String templateDir = "src/main/resources/customTemplates"; + File f = outputDirectory.resolve(templateDir).toFile(); + try { + f.mkdirs(); + setupAndRunGenericTest("-t", f.getAbsolutePath()); + } finally { + verify(configurator).setTemplateDir(f.getAbsolutePath()); + verify(configurator).toClientOptInput(); + verify(configurator).toContext(); + verifyNoMoreInteractions(configurator); + if(!f.delete()) { + System.out.println("Directory didn't delete. You can ignore this."); + } + } + } + + @Test + public void testTypeMappingsLong() { + setupAndRunGenericTest("--type-mappings", "hello=world,key=,foo=bar,key2"); + verify(configurator).addTypeMapping("hello", "world"); + verify(configurator).addTypeMapping("foo", "bar"); + verify(configurator).addTypeMapping("key", ""); + verify(configurator).addTypeMapping("key2", ""); + } + + @Test + public void testTypeMappingsLongMultiple() { + setupAndRunGenericTest("--type-mappings", "hello=world", "--type-mappings", "key=", + "--type-mappings", "foo=bar", "--type-mappings", "key2"); + verify(configurator).addTypeMapping("hello", "world"); + verify(configurator).addTypeMapping("foo", "bar"); + verify(configurator).addTypeMapping("key", ""); + verify(configurator).addTypeMapping("key2", ""); + } + + @Test + public void testVerboseLong() { + setupAndRunGenericTest("--verbose"); + verify(configurator).setVerbose(true); + verify(configurator).toClientOptInput(); + verify(configurator).toContext(); + verifyNoMoreInteractions(configurator); + } + + @Test + public void testVerboseShort() { + setupAndRunGenericTest("-v"); + verify(configurator).setVerbose(true); + verify(configurator).toClientOptInput(); + verify(configurator).toContext(); + verifyNoMoreInteractions(configurator); + } } diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index 9ab17b45b53..69f0314bb62 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -291,12 +291,6 @@ ${reflections-version} test - - org.jmockit - jmockit - - test - com.googlecode.java-diff-utils diffutils @@ -311,7 +305,7 @@ org.mockito mockito-core - 3.2.0 + ${mockito-version} test diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/AbstractOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/AbstractOptionsTest.java index 89abc085f1b..a5929f4af73 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/AbstractOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/AbstractOptionsTest.java @@ -19,8 +19,8 @@ package org.openapitools.codegen; import com.google.common.base.Function; import com.google.common.collect.Lists; -import mockit.FullVerifications; import org.apache.commons.lang3.StringUtils; +import org.mockito.MockSettings; import org.openapitools.codegen.options.OptionsProvider; import org.testng.Assert; import org.testng.annotations.Test; @@ -29,8 +29,16 @@ import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Set; +import java.util.stream.Collectors; +import static org.mockito.Answers.CALLS_REAL_METHODS; +import static org.mockito.Mockito.withSettings; + +/** + * Base class for applying and processing generator options, then invoking a helper method to verify those options. + */ public abstract class AbstractOptionsTest { + protected MockSettings mockSettings = withSettings().useConstructor().defaultAnswer(CALLS_REAL_METHODS); private final OptionsProvider optionsProvider; protected AbstractOptionsTest(OptionsProvider optionsProvider) { @@ -41,17 +49,13 @@ public abstract class AbstractOptionsTest { @Test public void checkOptionsProcessing() { getCodegenConfig().additionalProperties().putAll(optionsProvider.createOptions()); - setExpectations(); - getCodegenConfig().processOpts(); - - new FullVerifications() {{ - }}; + verifyOptions(); } @Test(description = "check if all options described in documentation are presented in test case") public void checkOptionsHelp() { - final List cliOptions = Lists.transform(getCodegenConfig().cliOptions(), getCliOptionTransformer()); + final List cliOptions = getCodegenConfig().cliOptions().stream().map(getCliOptionTransformer()).collect(Collectors.toList()); final Set testOptions = optionsProvider.createOptions().keySet(); final Set skipped = new HashSet(cliOptions); skipped.removeAll(testOptions); @@ -76,5 +80,5 @@ public abstract class AbstractOptionsTest { protected abstract CodegenConfig getCodegenConfig(); - protected abstract void setExpectations(); + protected abstract void verifyOptions(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/bash/BashClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/bash/BashClientOptionsTest.java index 7fdff8e2fa8..1d08eab2bed 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/bash/BashClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/bash/BashClientOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.bash; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.BashClientCodegen; import org.openapitools.codegen.options.BashClientOptionsProvider; -public class BashClientOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private BashClientCodegen clientCodegen; +public class BashClientOptionsTest extends AbstractOptionsTest { + private BashClientCodegen clientCodegen = mock(BashClientCodegen.class, mockSettings); public BashClientOptionsTest() { super(new BashClientOptionsProvider()); @@ -40,36 +39,25 @@ public class BashClientOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setCurlOptions( + protected void verifyOptions() { + verify(clientCodegen).setCurlOptions( BashClientOptionsProvider.CURL_OPTIONS); - times = 1; - clientCodegen.setProcessMarkdown( + verify(clientCodegen).setProcessMarkdown( Boolean.parseBoolean( - BashClientOptionsProvider.PROCESS_MARKDOWN)); - times = 1; - clientCodegen.setScriptName( + BashClientOptionsProvider.PROCESS_MARKDOWN)); + verify(clientCodegen).setScriptName( BashClientOptionsProvider.SCRIPT_NAME); - times = 1; - clientCodegen.setGenerateBashCompletion( + verify(clientCodegen).setGenerateBashCompletion( Boolean.parseBoolean( - BashClientOptionsProvider.GENERATE_BASH_COMPLETION)); - times = 1; - clientCodegen.setGenerateZshCompletion( + BashClientOptionsProvider.GENERATE_BASH_COMPLETION)); + verify(clientCodegen).setGenerateZshCompletion( Boolean.parseBoolean( - BashClientOptionsProvider.GENERATE_ZSH_COMPLETION)); - times = 1; - clientCodegen.setHostEnvironmentVariable( + BashClientOptionsProvider.GENERATE_ZSH_COMPLETION)); + verify(clientCodegen).setHostEnvironmentVariable( BashClientOptionsProvider.HOST_ENVIRONMENT_VARIABLE_NAME); - times = 1; - clientCodegen.setApiKeyAuthEnvironmentVariable( + verify(clientCodegen).setApiKeyAuthEnvironmentVariable( BashClientOptionsProvider.APIKEY_AUTH_ENVIRONMENT_VARIABLE_NAME); - times = 1; - clientCodegen.setAllowUnicodeIdentifiers(Boolean.valueOf(BashClientOptionsProvider.ALLOW_UNICODE_IDENTIFIERS_VALUE)); - times = 1; - - }}; + verify(clientCodegen).setAllowUnicodeIdentifiers(Boolean.valueOf(BashClientOptionsProvider.ALLOW_UNICODE_IDENTIFIERS_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java index 8cb3ac96424..98bab7f0922 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.dart; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.DartClientCodegen; import org.openapitools.codegen.options.DartClientOptionsProvider; -public class DartClientOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private DartClientCodegen clientCodegen; +public class DartClientOptionsTest extends AbstractOptionsTest { + private DartClientCodegen clientCodegen = mock(DartClientCodegen.class, mockSettings); public DartClientOptionsTest() { super(new DartClientOptionsProvider()); @@ -40,28 +39,16 @@ public class DartClientOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(DartClientOptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - clientCodegen.setBrowserClient(Boolean.valueOf(DartClientOptionsProvider.BROWSER_CLIENT_VALUE)); - times = 1; - clientCodegen.setPubName(DartClientOptionsProvider.PUB_NAME_VALUE); - times = 1; - clientCodegen.setPubVersion(DartClientOptionsProvider.PUB_VERSION_VALUE); - times = 1; - clientCodegen.setPubDescription(DartClientOptionsProvider.PUB_DESCRIPTION_VALUE); - times = 1; - clientCodegen.setPubAuthor(DartClientOptionsProvider.PUB_AUTHOR_VALUE); - times = 1; - clientCodegen.setPubAuthorEmail(DartClientOptionsProvider.PUB_AUTHOR_EMAIL_VALUE); - times = 1; - clientCodegen.setPubHomepage(DartClientOptionsProvider.PUB_HOMEPAGE_VALUE); - times = 1; - clientCodegen.setSourceFolder(DartClientOptionsProvider.SOURCE_FOLDER_VALUE); - times = 1; - clientCodegen.setUseEnumExtension(Boolean.valueOf(DartClientOptionsProvider.USE_ENUM_EXTENSION)); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(DartClientOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setBrowserClient(Boolean.parseBoolean(DartClientOptionsProvider.BROWSER_CLIENT_VALUE)); + verify(clientCodegen).setPubName(DartClientOptionsProvider.PUB_NAME_VALUE); + verify(clientCodegen).setPubVersion(DartClientOptionsProvider.PUB_VERSION_VALUE); + verify(clientCodegen).setPubDescription(DartClientOptionsProvider.PUB_DESCRIPTION_VALUE); + verify(clientCodegen).setPubAuthor(DartClientOptionsProvider.PUB_AUTHOR_VALUE); + verify(clientCodegen).setPubAuthorEmail(DartClientOptionsProvider.PUB_AUTHOR_EMAIL_VALUE); + verify(clientCodegen).setPubHomepage(DartClientOptionsProvider.PUB_HOMEPAGE_VALUE); + verify(clientCodegen).setSourceFolder(DartClientOptionsProvider.SOURCE_FOLDER_VALUE); + verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartClientOptionsProvider.USE_ENUM_EXTENSION)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dartdio/DartDioClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dartdio/DartDioClientOptionsTest.java index 8ab0fef3801..81f707f507a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dartdio/DartDioClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dartdio/DartDioClientOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.dartdio; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.DartDioClientCodegen; import org.openapitools.codegen.options.DartDioClientOptionsProvider; -public class DartDioClientOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private DartDioClientCodegen clientCodegen; +public class DartDioClientOptionsTest extends AbstractOptionsTest { + private DartDioClientCodegen clientCodegen = mock(DartDioClientCodegen.class, mockSettings); public DartDioClientOptionsTest() { super(new DartDioClientOptionsProvider()); @@ -40,32 +39,18 @@ public class DartDioClientOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(DartDioClientOptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - clientCodegen.setBrowserClient(Boolean.valueOf(DartDioClientOptionsProvider.BROWSER_CLIENT_VALUE)); - times = 1; - clientCodegen.setPubName(DartDioClientOptionsProvider.PUB_NAME_VALUE); - times = 1; - clientCodegen.setPubVersion(DartDioClientOptionsProvider.PUB_VERSION_VALUE); - times = 1; - clientCodegen.setPubDescription(DartDioClientOptionsProvider.PUB_DESCRIPTION_VALUE); - times = 1; - //clientCodegen.setPubAuthor(DartDioClientOptionsProvider.PUB_AUTHOR_VALUE); - //times = 1; - //clientCodegen.setPubAuthorEmail(DartDioClientOptionsProvider.PUB_AUTHOR_EMAIL_VALUE); - //times = 1; - //clientCodegen.setPubHomepage(DartDioClientOptionsProvider.PUB_HOMEPAGE_VALUE); - //times = 1; - clientCodegen.setSourceFolder(DartDioClientOptionsProvider.SOURCE_FOLDER_VALUE); - times = 1; - clientCodegen.setUseEnumExtension(Boolean.valueOf(DartDioClientOptionsProvider.USE_ENUM_EXTENSION)); - times = 1; - clientCodegen.setDateLibrary(DartDioClientOptionsProvider.DATE_LIBRARY); - times = 1; - clientCodegen.setNullableFields(Boolean.valueOf(DartDioClientOptionsProvider.NULLABLE_FIELDS)); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(DartDioClientOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setBrowserClient(Boolean.parseBoolean(DartDioClientOptionsProvider.BROWSER_CLIENT_VALUE)); + verify(clientCodegen).setPubName(DartDioClientOptionsProvider.PUB_NAME_VALUE); + verify(clientCodegen).setPubVersion(DartDioClientOptionsProvider.PUB_VERSION_VALUE); + verify(clientCodegen).setPubDescription(DartDioClientOptionsProvider.PUB_DESCRIPTION_VALUE); + //verify(clientCodegen).setPubAuthor(DartDioClientOptionsProvider.PUB_AUTHOR_VALUE); + //verify(clientCodegen).setPubAuthorEmail(DartDioClientOptionsProvider.PUB_AUTHOR_EMAIL_VALUE); + //verify(clientCodegen).setPubHomepage(DartDioClientOptionsProvider.PUB_HOMEPAGE_VALUE); + verify(clientCodegen).setSourceFolder(DartDioClientOptionsProvider.SOURCE_FOLDER_VALUE); + verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartDioClientOptionsProvider.USE_ENUM_EXTENSION)); + verify(clientCodegen).setDateLibrary(DartDioClientOptionsProvider.DATE_LIBRARY); + verify(clientCodegen).setNullableFields(Boolean.parseBoolean(DartDioClientOptionsProvider.NULLABLE_FIELDS)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/elixir/ElixirClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/elixir/ElixirClientOptionsTest.java index e5f9e05475f..41fe7cbbbbf 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/elixir/ElixirClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/elixir/ElixirClientOptionsTest.java @@ -17,17 +17,17 @@ package org.openapitools.codegen.elixir; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.ElixirClientCodegen; import org.openapitools.codegen.options.ElixirClientOptionsProvider; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + public class ElixirClientOptionsTest extends AbstractOptionsTest { - @Tested - private ElixirClientCodegen clientCodegen; + private ElixirClientCodegen clientCodegen = mock(ElixirClientCodegen.class, mockSettings); public ElixirClientOptionsTest() { super(new ElixirClientOptionsProvider()); @@ -40,10 +40,7 @@ public class ElixirClientOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setModuleName(ElixirClientOptionsProvider.INVOKER_PACKAGE_VALUE); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setModuleName(ElixirClientOptionsProvider.INVOKER_PACKAGE_VALUE); } } \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java index e132eea7050..e6a65d953a9 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java @@ -17,17 +17,17 @@ package org.openapitools.codegen.go; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.GoClientCodegen; import org.openapitools.codegen.options.GoClientOptionsProvider; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + public class GoClientOptionsTest extends AbstractOptionsTest { - @Tested - private GoClientCodegen clientCodegen; + private GoClientCodegen clientCodegen = mock(GoClientCodegen.class, mockSettings); public GoClientOptionsTest() { super(new GoClientOptionsProvider()); @@ -40,26 +40,15 @@ public class GoClientOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setPackageVersion(GoClientOptionsProvider.PACKAGE_VERSION_VALUE); - times = 1; - clientCodegen.setPackageName(GoClientOptionsProvider.PACKAGE_NAME_VALUE); - times = 1; - clientCodegen.setWithGoCodegenComment(GoClientOptionsProvider.WITH_GO_CODEGEN_COMMENT_VALUE); - times = 1; - clientCodegen.setWithXml(GoClientOptionsProvider.WITH_XML_VALUE); - times = 1; - clientCodegen.setWithXml(GoClientOptionsProvider.ENUM_CLASS_PREFIX_VALUE); - times = 1; - clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(GoClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); - times = 1; - clientCodegen.setIsGoSubmodule(Boolean.valueOf(GoClientOptionsProvider.IS_GO_SUBMODULE_VALUE)); - times = 1; - clientCodegen.setStructPrefix(Boolean.valueOf(GoClientOptionsProvider.STRUCT_PREFIX_VALUE)); - times = 1; - clientCodegen.setWithAWSV4Signature(Boolean.valueOf(GoClientOptionsProvider.WITH_AWSV4_SIGNATURE)); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setPackageVersion(GoClientOptionsProvider.PACKAGE_VERSION_VALUE); + verify(clientCodegen).setPackageName(GoClientOptionsProvider.PACKAGE_NAME_VALUE); + verify(clientCodegen).setWithGoCodegenComment(GoClientOptionsProvider.WITH_GO_CODEGEN_COMMENT_VALUE); + verify(clientCodegen).setWithXml(GoClientOptionsProvider.WITH_XML_VALUE); + verify(clientCodegen).setWithXml(GoClientOptionsProvider.ENUM_CLASS_PREFIX_VALUE); + verify(clientCodegen).setPrependFormOrBodyParameters(GoClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE); + verify(clientCodegen).setIsGoSubmodule(GoClientOptionsProvider.IS_GO_SUBMODULE_VALUE); + verify(clientCodegen).setStructPrefix(GoClientOptionsProvider.STRUCT_PREFIX_VALUE); + verify(clientCodegen).setWithAWSV4Signature(GoClientOptionsProvider.WITH_AWSV4_SIGNATURE); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellservant/HaskellServantOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellservant/HaskellServantOptionsTest.java index 0ec2b3e59c0..769dcbedbd6 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellservant/HaskellServantOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellservant/HaskellServantOptionsTest.java @@ -17,18 +17,17 @@ package org.openapitools.codegen.haskellservant; - -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.HaskellServantCodegen; import org.openapitools.codegen.options.HaskellServantOptionsProvider; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + public class HaskellServantOptionsTest extends AbstractOptionsTest { - @Tested - private HaskellServantCodegen clientCodegen; + private HaskellServantCodegen clientCodegen = mock(HaskellServantCodegen.class, mockSettings); public HaskellServantOptionsTest() { super(new HaskellServantOptionsProvider()); @@ -40,14 +39,9 @@ public class HaskellServantOptionsTest extends AbstractOptionsTest { } @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setModelPackage(HaskellServantOptionsProvider.MODEL_PACKAGE_VALUE); - times = 1; - clientCodegen.setApiPackage(HaskellServantOptionsProvider.API_PACKAGE_VALUE); - times = 1; - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(HaskellServantOptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setModelPackage(HaskellServantOptionsProvider.MODEL_PACKAGE_VALUE); + verify(clientCodegen).setApiPackage(HaskellServantOptionsProvider.API_PACKAGE_VALUE); + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(HaskellServantOptionsProvider.SORT_PARAMS_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/lumen/PhpLumenServerOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/lumen/PhpLumenServerOptionsTest.java index 4bf8dadc0d9..4a79464569b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/lumen/PhpLumenServerOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/lumen/PhpLumenServerOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.lumen; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.PhpLumenServerCodegen; import org.openapitools.codegen.options.PhpLumenServerOptionsProvider; -public class PhpLumenServerOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private PhpLumenServerCodegen clientCodegen; +public class PhpLumenServerOptionsTest extends AbstractOptionsTest { + private PhpLumenServerCodegen clientCodegen = mock(PhpLumenServerCodegen.class, mockSettings); public PhpLumenServerOptionsTest() { super(new PhpLumenServerOptionsProvider()); @@ -40,24 +39,14 @@ public class PhpLumenServerOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(PhpLumenServerOptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - clientCodegen.setParameterNamingConvention(PhpLumenServerOptionsProvider.VARIABLE_NAMING_CONVENTION_VALUE); - clientCodegen.setModelPackage(PhpLumenServerOptionsProvider.MODEL_PACKAGE_VALUE); - times = 1; - clientCodegen.setApiPackage(PhpLumenServerOptionsProvider.API_PACKAGE_VALUE); - times = 1; - times = 1; - clientCodegen.setInvokerPackage(PhpLumenServerOptionsProvider.INVOKER_PACKAGE_VALUE); - times = 1; - clientCodegen.setPackageName(PhpLumenServerOptionsProvider.PACKAGE_NAME_VALUE); - times = 1; - clientCodegen.setSrcBasePath(PhpLumenServerOptionsProvider.SRC_BASE_PATH_VALUE); - times = 1; - clientCodegen.setArtifactVersion(PhpLumenServerOptionsProvider.ARTIFACT_VERSION_VALUE); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(PhpLumenServerOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setParameterNamingConvention(PhpLumenServerOptionsProvider.VARIABLE_NAMING_CONVENTION_VALUE); + verify(clientCodegen).setModelPackage(PhpLumenServerOptionsProvider.MODEL_PACKAGE_VALUE); + verify(clientCodegen).setApiPackage(PhpLumenServerOptionsProvider.API_PACKAGE_VALUE); + verify(clientCodegen).setInvokerPackage(PhpLumenServerOptionsProvider.INVOKER_PACKAGE_VALUE); + verify(clientCodegen).setPackageName(PhpLumenServerOptionsProvider.PACKAGE_NAME_VALUE); + verify(clientCodegen).setSrcBasePath(PhpLumenServerOptionsProvider.SRC_BASE_PATH_VALUE); + verify(clientCodegen).setArtifactVersion(PhpLumenServerOptionsProvider.ARTIFACT_VERSION_VALUE); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/mysql/MysqlSchemaOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/mysql/MysqlSchemaOptionsTest.java index e81dc3640c7..4aa7b8a5b26 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/mysql/MysqlSchemaOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/mysql/MysqlSchemaOptionsTest.java @@ -16,17 +16,16 @@ package org.openapitools.codegen.mysql; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.MysqlSchemaCodegen; import org.openapitools.codegen.options.MysqlSchemaOptionsProvider; -public class MysqlSchemaOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private MysqlSchemaCodegen clientCodegen; +public class MysqlSchemaOptionsTest extends AbstractOptionsTest { + private MysqlSchemaCodegen clientCodegen = mock(MysqlSchemaCodegen.class, mockSettings); public MysqlSchemaOptionsTest() { super(new MysqlSchemaOptionsProvider()); @@ -39,14 +38,9 @@ public class MysqlSchemaOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setDefaultDatabaseName(MysqlSchemaOptionsProvider.DEFAULT_DATABASE_NAME_VALUE); - times = 1; - clientCodegen.setJsonDataTypeEnabled(Boolean.valueOf(MysqlSchemaOptionsProvider.JSON_DATA_TYPE_ENABLED_VALUE)); - times = 1; - clientCodegen.setIdentifierNamingConvention(MysqlSchemaOptionsProvider.IDENTIFIER_NAMING_CONVENTION_VALUE); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setDefaultDatabaseName(MysqlSchemaOptionsProvider.DEFAULT_DATABASE_NAME_VALUE); + verify(clientCodegen).setJsonDataTypeEnabled(Boolean.valueOf(MysqlSchemaOptionsProvider.JSON_DATA_TYPE_ENABLED_VALUE)); + verify(clientCodegen).setIdentifierNamingConvention(MysqlSchemaOptionsProvider.IDENTIFIER_NAMING_CONVENTION_VALUE); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/objc/ObjcClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/objc/ObjcClientOptionsTest.java index 4a8ca1ae542..036891051ed 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/objc/ObjcClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/objc/ObjcClientOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.objc; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.ObjcClientCodegen; import org.openapitools.codegen.options.ObjcClientOptionsProvider; -public class ObjcClientOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private ObjcClientCodegen clientCodegen; +public class ObjcClientOptionsTest extends AbstractOptionsTest { + private ObjcClientCodegen clientCodegen = mock(ObjcClientCodegen.class, mockSettings); public ObjcClientOptionsTest() { super(new ObjcClientOptionsProvider()); @@ -40,20 +39,12 @@ public class ObjcClientOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setClassPrefix(ObjcClientOptionsProvider.CLASS_PREFIX_VALUE); - times = 1; - clientCodegen.setPodName(ObjcClientOptionsProvider.POD_NAME_VALUE); - times = 1; - clientCodegen.setPodVersion(ObjcClientOptionsProvider.POD_VERSION_VALUE); - times = 1; - clientCodegen.setAuthorName(ObjcClientOptionsProvider.AUTHOR_NAME_VALUE); - times = 1; - clientCodegen.setAuthorEmail(ObjcClientOptionsProvider.AUTHOR_EMAIL_VALUE); - times = 1; - clientCodegen.setGitRepoURL(ObjcClientOptionsProvider.GIT_REPO_URL_VALUE); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setClassPrefix(ObjcClientOptionsProvider.CLASS_PREFIX_VALUE); + verify(clientCodegen).setPodName(ObjcClientOptionsProvider.POD_NAME_VALUE); + verify(clientCodegen).setPodVersion(ObjcClientOptionsProvider.POD_VERSION_VALUE); + verify(clientCodegen).setAuthorName(ObjcClientOptionsProvider.AUTHOR_NAME_VALUE); + verify(clientCodegen).setAuthorEmail(ObjcClientOptionsProvider.AUTHOR_EMAIL_VALUE); + verify(clientCodegen).setGitRepoURL(ObjcClientOptionsProvider.GIT_REPO_URL_VALUE); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaHttpClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaHttpClientOptionsProvider.java index 7c1bea2a2ce..6c41744f23f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaHttpClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaHttpClientOptionsProvider.java @@ -29,7 +29,7 @@ public class ScalaHttpClientOptionsProvider implements OptionsProvider { 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 MODEL_PROPERTY_NAMING = "modelPropertyNaming"; + public static final String MODEL_PROPERTY_NAMING = "PascalCase"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/perl/PerlClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/perl/PerlClientOptionsTest.java index fb34c63515d..e3d951301fd 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/perl/PerlClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/perl/PerlClientOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.perl; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.PerlClientCodegen; import org.openapitools.codegen.options.PerlClientOptionsProvider; -public class PerlClientOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private PerlClientCodegen clientCodegen; +public class PerlClientOptionsTest extends AbstractOptionsTest { + private PerlClientCodegen clientCodegen = mock(PerlClientCodegen.class, mockSettings); public PerlClientOptionsTest() { super(new PerlClientOptionsProvider()); @@ -40,14 +39,9 @@ public class PerlClientOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setModuleName(PerlClientOptionsProvider.MODULE_NAME_VALUE); - times = 1; - clientCodegen.setModuleVersion(PerlClientOptionsProvider.MODULE_VERSION_VALUE); - times = 1; - clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(PerlClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setModuleName(PerlClientOptionsProvider.MODULE_NAME_VALUE); + verify(clientCodegen).setModuleVersion(PerlClientOptionsProvider.MODULE_VERSION_VALUE); + verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(PerlClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpClientOptionsTest.java index eea1f9bd330..8479c3441a4 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpClientOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.php; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.PhpClientCodegen; import org.openapitools.codegen.options.PhpClientOptionsProvider; -public class PhpClientOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private PhpClientCodegen clientCodegen; +public class PhpClientOptionsTest extends AbstractOptionsTest { + private PhpClientCodegen clientCodegen = mock(PhpClientCodegen.class, mockSettings); public PhpClientOptionsTest() { super(new PhpClientOptionsProvider()); @@ -40,24 +39,14 @@ public class PhpClientOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setModelPackage(PhpClientOptionsProvider.MODEL_PACKAGE_VALUE); - times = 1; - clientCodegen.setApiPackage(PhpClientOptionsProvider.API_PACKAGE_VALUE); - times = 1; - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(PhpClientOptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - clientCodegen.setParameterNamingConvention(PhpClientOptionsProvider.VARIABLE_NAMING_CONVENTION_VALUE); - times = 1; - clientCodegen.setInvokerPackage(PhpClientOptionsProvider.INVOKER_PACKAGE_VALUE); - times = 1; - clientCodegen.setPackageName(PhpClientOptionsProvider.PACKAGE_NAME_VALUE); - times = 1; - clientCodegen.setSrcBasePath(PhpClientOptionsProvider.SRC_BASE_PATH_VALUE); - times = 1; - clientCodegen.setArtifactVersion(PhpClientOptionsProvider.ARTIFACT_VERSION_VALUE); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setModelPackage(PhpClientOptionsProvider.MODEL_PACKAGE_VALUE); + verify(clientCodegen).setApiPackage(PhpClientOptionsProvider.API_PACKAGE_VALUE); + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(PhpClientOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setParameterNamingConvention(PhpClientOptionsProvider.VARIABLE_NAMING_CONVENTION_VALUE); + verify(clientCodegen).setInvokerPackage(PhpClientOptionsProvider.INVOKER_PACKAGE_VALUE); + verify(clientCodegen).setPackageName(PhpClientOptionsProvider.PACKAGE_NAME_VALUE); + verify(clientCodegen).setSrcBasePath(PhpClientOptionsProvider.SRC_BASE_PATH_VALUE); + verify(clientCodegen).setArtifactVersion(PhpClientOptionsProvider.ARTIFACT_VERSION_VALUE); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java index 289c7c21e22..e423c6e8584 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientOptionsTest.java @@ -17,19 +17,19 @@ package org.openapitools.codegen.python; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.PythonClientCodegen; import org.openapitools.codegen.options.PythonClientOptionsProvider; +import org.testng.Assert; import java.io.File; -public class PythonClientOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private PythonClientCodegen clientCodegen; +public class PythonClientOptionsTest extends AbstractOptionsTest { + private PythonClientCodegen clientCodegen = mock(PythonClientCodegen.class, mockSettings); public PythonClientOptionsTest() { super(new PythonClientOptionsProvider()); @@ -42,26 +42,13 @@ public class PythonClientOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setPackageName(PythonClientOptionsProvider.PACKAGE_NAME_VALUE); - times = 1; + protected void verifyOptions() { + Assert.assertEquals(clientCodegen.packagePath(), PythonClientOptionsProvider.PACKAGE_NAME_VALUE.replace('.', File.separatorChar)); - clientCodegen.setProjectName(PythonClientOptionsProvider.PROJECT_NAME_VALUE); - times = 1; - - clientCodegen.setPackageVersion(PythonClientOptionsProvider.PACKAGE_VERSION_VALUE); - times = 1; - - clientCodegen.setPackageUrl(PythonClientOptionsProvider.PACKAGE_URL_VALUE); - times = 1; - - clientCodegen.setUseNose(PythonClientOptionsProvider.USE_NOSE_VALUE); - times = 1; - - clientCodegen.packagePath(); - result = PythonClientOptionsProvider.PACKAGE_NAME_VALUE.replace('.', File.separatorChar); - minTimes = 1; - }}; + verify(clientCodegen).setPackageName(PythonClientOptionsProvider.PACKAGE_NAME_VALUE); + verify(clientCodegen).setProjectName(PythonClientOptionsProvider.PROJECT_NAME_VALUE); + verify(clientCodegen).setPackageVersion(PythonClientOptionsProvider.PACKAGE_VERSION_VALUE); + verify(clientCodegen).setPackageUrl(PythonClientOptionsProvider.PACKAGE_URL_VALUE); + verify(clientCodegen).setUseNose(PythonClientOptionsProvider.USE_NOSE_VALUE); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientOptionsTest.java index 3cd888e7974..6c338ad66b5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.ruby; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.RubyClientCodegen; import org.openapitools.codegen.options.RubyClientOptionsProvider; -public class RubyClientOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private RubyClientCodegen clientCodegen; +public class RubyClientOptionsTest extends AbstractOptionsTest { + private RubyClientCodegen clientCodegen = mock(RubyClientCodegen.class, mockSettings); public RubyClientOptionsTest() { super(new RubyClientOptionsProvider()); @@ -40,29 +39,16 @@ public class RubyClientOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setGemName(RubyClientOptionsProvider.GEM_NAME_VALUE); - times = 1; - clientCodegen.setModuleName(RubyClientOptionsProvider.MODULE_NAME_VALUE); - times = 1; - clientCodegen.setGemVersion(RubyClientOptionsProvider.GEM_VERSION_VALUE); - times = 1; - clientCodegen.setGemLicense(RubyClientOptionsProvider.GEM_LICENSE_VALUE); - times = 1; - clientCodegen.setGemRequiredRubyVersion(RubyClientOptionsProvider.GEM_REQUIRED_RUBY_VERSION_VALUE); - times = 1; - clientCodegen.setGemHomepage(RubyClientOptionsProvider.GEM_HOMEPAGE_VALUE); - times = 1; - clientCodegen.setGemDescription(RubyClientOptionsProvider.GEM_DESCRIPTION_VALUE); - times = 1; - clientCodegen.setGemSummary(RubyClientOptionsProvider.GEM_SUMMARY_VALUE); - times = 1; - clientCodegen.setGemAuthor(RubyClientOptionsProvider.GEM_AUTHOR_VALUE); - times = 1; - clientCodegen.setGemAuthorEmail(RubyClientOptionsProvider.GEM_AUTHOR_EMAIL_VALUE); - times = 1; - - }}; + protected void verifyOptions() { + verify(clientCodegen).setGemName(RubyClientOptionsProvider.GEM_NAME_VALUE); + verify(clientCodegen).setModuleName(RubyClientOptionsProvider.MODULE_NAME_VALUE); + verify(clientCodegen).setGemVersion(RubyClientOptionsProvider.GEM_VERSION_VALUE); + verify(clientCodegen).setGemLicense(RubyClientOptionsProvider.GEM_LICENSE_VALUE); + verify(clientCodegen).setGemRequiredRubyVersion(RubyClientOptionsProvider.GEM_REQUIRED_RUBY_VERSION_VALUE); + verify(clientCodegen).setGemHomepage(RubyClientOptionsProvider.GEM_HOMEPAGE_VALUE); + verify(clientCodegen).setGemDescription(RubyClientOptionsProvider.GEM_DESCRIPTION_VALUE); + verify(clientCodegen).setGemSummary(RubyClientOptionsProvider.GEM_SUMMARY_VALUE); + verify(clientCodegen).setGemAuthor(RubyClientOptionsProvider.GEM_AUTHOR_VALUE); + verify(clientCodegen).setGemAuthorEmail(RubyClientOptionsProvider.GEM_AUTHOR_EMAIL_VALUE); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/rubysinatra/RubySinatraServerOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/rubysinatra/RubySinatraServerOptionsTest.java index 7b986935ff1..33623381607 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/rubysinatra/RubySinatraServerOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/rubysinatra/RubySinatraServerOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.rubysinatra; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.RubySinatraServerCodegen; import org.openapitools.codegen.options.RubySinatraServerOptionsProvider; -public class RubySinatraServerOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private RubySinatraServerCodegen clientCodegen; +public class RubySinatraServerOptionsTest extends AbstractOptionsTest { + private RubySinatraServerCodegen clientCodegen = mock(RubySinatraServerCodegen.class, mockSettings); public RubySinatraServerOptionsTest() { super(new RubySinatraServerOptionsProvider()); @@ -40,8 +39,7 @@ public class RubySinatraServerOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - }}; + protected void verifyOptions() { + // TODO verify ruby sinatra opts } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientOptionsTest.java index 6a09e808f5e..ec56dbc8ce8 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.scalaakka; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.ScalaAkkaClientCodegen; import org.openapitools.codegen.options.ScalaAkkaClientOptionsProvider; -public class ScalaAkkaClientOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private ScalaAkkaClientCodegen clientCodegen; +public class ScalaAkkaClientOptionsTest extends AbstractOptionsTest { + private ScalaAkkaClientCodegen clientCodegen = mock(ScalaAkkaClientCodegen.class, mockSettings); public ScalaAkkaClientOptionsTest() { super(new ScalaAkkaClientOptionsProvider()); @@ -40,20 +39,12 @@ public class ScalaAkkaClientOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setModelPackage(ScalaAkkaClientOptionsProvider.MODEL_PACKAGE_VALUE); - times = 1; - clientCodegen.setApiPackage(ScalaAkkaClientOptionsProvider.API_PACKAGE_VALUE); - times = 1; - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(ScalaAkkaClientOptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - clientCodegen.setSourceFolder(ScalaAkkaClientOptionsProvider.SOURCE_FOLDER_VALUE); - times = 1; - clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(ScalaAkkaClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); - times = 1; - clientCodegen.setMainPackage(ScalaAkkaClientOptionsProvider.MAIN_PACKAGE_VALUE); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setModelPackage(ScalaAkkaClientOptionsProvider.MODEL_PACKAGE_VALUE); + verify(clientCodegen).setApiPackage(ScalaAkkaClientOptionsProvider.API_PACKAGE_VALUE); + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(ScalaAkkaClientOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setSourceFolder(ScalaAkkaClientOptionsProvider.SOURCE_FOLDER_VALUE); + verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(ScalaAkkaClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); + verify(clientCodegen).setMainPackage(ScalaAkkaClientOptionsProvider.MAIN_PACKAGE_VALUE); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalahttpclient/ScalaHttpClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalahttpclient/ScalaHttpClientOptionsTest.java index d88c112b7b0..3f31758c12d 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalahttpclient/ScalaHttpClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalahttpclient/ScalaHttpClientOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.scalahttpclient; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.ScalaHttpClientCodegen; import org.openapitools.codegen.options.ScalaHttpClientOptionsProvider; -public class ScalaHttpClientOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private ScalaHttpClientCodegen clientCodegen; +public class ScalaHttpClientOptionsTest extends AbstractOptionsTest { + private ScalaHttpClientCodegen clientCodegen = mock(ScalaHttpClientCodegen.class, mockSettings); public ScalaHttpClientOptionsTest() { super(new ScalaHttpClientOptionsProvider()); @@ -40,20 +39,12 @@ public class ScalaHttpClientOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setModelPackage(ScalaHttpClientOptionsProvider.MODEL_PACKAGE_VALUE); - times = 1; - clientCodegen.setApiPackage(ScalaHttpClientOptionsProvider.API_PACKAGE_VALUE); - times = 1; - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(ScalaHttpClientOptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - clientCodegen.setModelPropertyNaming(ScalaHttpClientOptionsProvider.MODEL_PROPERTY_NAMING); - times = 1; - clientCodegen.setSourceFolder(ScalaHttpClientOptionsProvider.SOURCE_FOLDER_VALUE); - times = 1; - clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(ScalaHttpClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setModelPackage(ScalaHttpClientOptionsProvider.MODEL_PACKAGE_VALUE); + verify(clientCodegen).setApiPackage(ScalaHttpClientOptionsProvider.API_PACKAGE_VALUE); + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(ScalaHttpClientOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setModelPropertyNaming(ScalaHttpClientOptionsProvider.MODEL_PROPERTY_NAMING); + verify(clientCodegen).setSourceFolder(ScalaHttpClientOptionsProvider.SOURCE_FOLDER_VALUE); + verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(ScalaHttpClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/silex/PhpSilexServerOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/silex/PhpSilexServerOptionsTest.java index 82ba456f7a8..d7dcc1a2801 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/silex/PhpSilexServerOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/silex/PhpSilexServerOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.silex; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.PhpSilexServerCodegen; import org.openapitools.codegen.options.PhpSilexServerOptionsProvider; -public class PhpSilexServerOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private PhpSilexServerCodegen clientCodegen; +public class PhpSilexServerOptionsTest extends AbstractOptionsTest { + private PhpSilexServerCodegen clientCodegen = mock(PhpSilexServerCodegen.class, mockSettings); public PhpSilexServerOptionsTest() { super(new PhpSilexServerOptionsProvider()); @@ -40,10 +39,7 @@ public class PhpSilexServerOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(PhpSilexServerOptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(PhpSilexServerOptionsProvider.SORT_PARAMS_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim/PhpSlimServerOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim/PhpSlimServerOptionsTest.java index ccf91c4efa2..ad6fb48b273 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim/PhpSlimServerOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim/PhpSlimServerOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.slim; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.PhpSlimServerCodegen; import org.openapitools.codegen.options.PhpSlimServerOptionsProvider; -public class PhpSlimServerOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private PhpSlimServerCodegen clientCodegen; +public class PhpSlimServerOptionsTest extends AbstractOptionsTest { + private PhpSlimServerCodegen clientCodegen = mock(PhpSlimServerCodegen.class, mockSettings); public PhpSlimServerOptionsTest() { super(new PhpSlimServerOptionsProvider()); @@ -40,24 +39,14 @@ public class PhpSlimServerOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setModelPackage(PhpSlimServerOptionsProvider.MODEL_PACKAGE_VALUE); - times = 1; - clientCodegen.setApiPackage(PhpSlimServerOptionsProvider.API_PACKAGE_VALUE); - times = 1; - clientCodegen.setParameterNamingConvention(PhpSlimServerOptionsProvider.VARIABLE_NAMING_CONVENTION_VALUE); - times = 1; - clientCodegen.setInvokerPackage(PhpSlimServerOptionsProvider.INVOKER_PACKAGE_VALUE); - times = 1; - clientCodegen.setPackageName(PhpSlimServerOptionsProvider.PACKAGE_NAME_VALUE); - times = 1; - clientCodegen.setSrcBasePath(PhpSlimServerOptionsProvider.SRC_BASE_PATH_VALUE); - times = 1; - clientCodegen.setArtifactVersion(PhpSlimServerOptionsProvider.ARTIFACT_VERSION_VALUE); - times = 1; - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(PhpSlimServerOptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setModelPackage(PhpSlimServerOptionsProvider.MODEL_PACKAGE_VALUE); + verify(clientCodegen).setApiPackage(PhpSlimServerOptionsProvider.API_PACKAGE_VALUE); + verify(clientCodegen).setParameterNamingConvention(PhpSlimServerOptionsProvider.VARIABLE_NAMING_CONVENTION_VALUE); + verify(clientCodegen).setInvokerPackage(PhpSlimServerOptionsProvider.INVOKER_PACKAGE_VALUE); + verify(clientCodegen).setPackageName(PhpSlimServerOptionsProvider.PACKAGE_NAME_VALUE); + verify(clientCodegen).setSrcBasePath(PhpSlimServerOptionsProvider.SRC_BASE_PATH_VALUE); + verify(clientCodegen).setArtifactVersion(PhpSlimServerOptionsProvider.ARTIFACT_VERSION_VALUE); + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(PhpSlimServerOptionsProvider.SORT_PARAMS_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim4/PhpSlim4ServerOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim4/PhpSlim4ServerOptionsTest.java index a06f4488b82..499e6bec639 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim4/PhpSlim4ServerOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim4/PhpSlim4ServerOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.slim4; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.PhpSlim4ServerCodegen; import org.openapitools.codegen.options.PhpSlim4ServerOptionsProvider; -public class PhpSlim4ServerOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private PhpSlim4ServerCodegen clientCodegen; +public class PhpSlim4ServerOptionsTest extends AbstractOptionsTest { + private PhpSlim4ServerCodegen clientCodegen = mock(PhpSlim4ServerCodegen.class, mockSettings); public PhpSlim4ServerOptionsTest() { super(new PhpSlim4ServerOptionsProvider()); @@ -40,27 +39,16 @@ public class PhpSlim4ServerOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setModelPackage(PhpSlim4ServerOptionsProvider.MODEL_PACKAGE_VALUE); - times = 1; - clientCodegen.setApiPackage(PhpSlim4ServerOptionsProvider.API_PACKAGE_VALUE); - times = 1; - clientCodegen.setParameterNamingConvention(PhpSlim4ServerOptionsProvider.VARIABLE_NAMING_CONVENTION_VALUE); - times = 1; - clientCodegen.setInvokerPackage(PhpSlim4ServerOptionsProvider.INVOKER_PACKAGE_VALUE); - times = 1; - clientCodegen.setPackageName(PhpSlim4ServerOptionsProvider.PACKAGE_NAME_VALUE); - times = 1; - clientCodegen.setSrcBasePath(PhpSlim4ServerOptionsProvider.SRC_BASE_PATH_VALUE); - times = 1; - clientCodegen.setArtifactVersion(PhpSlim4ServerOptionsProvider.ARTIFACT_VERSION_VALUE); - times = 1; - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(PhpSlim4ServerOptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - clientCodegen.setPsr7Implementation(PhpSlim4ServerOptionsProvider.PSR7_IMPLEMENTATION_VALUE); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setModelPackage(PhpSlim4ServerOptionsProvider.MODEL_PACKAGE_VALUE); + verify(clientCodegen).setApiPackage(PhpSlim4ServerOptionsProvider.API_PACKAGE_VALUE); + verify(clientCodegen).setParameterNamingConvention(PhpSlim4ServerOptionsProvider.VARIABLE_NAMING_CONVENTION_VALUE); + verify(clientCodegen).setInvokerPackage(PhpSlim4ServerOptionsProvider.INVOKER_PACKAGE_VALUE); + verify(clientCodegen).setPackageName(PhpSlim4ServerOptionsProvider.PACKAGE_NAME_VALUE); + verify(clientCodegen).setSrcBasePath(PhpSlim4ServerOptionsProvider.SRC_BASE_PATH_VALUE); + verify(clientCodegen).setArtifactVersion(PhpSlim4ServerOptionsProvider.ARTIFACT_VERSION_VALUE); + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(PhpSlim4ServerOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setPsr7Implementation(PhpSlim4ServerOptionsProvider.PSR7_IMPLEMENTATION_VALUE); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift3/Swift3OptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift3/Swift3OptionsTest.java index a4caa6ca8ca..9d13950613e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift3/Swift3OptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift3/Swift3OptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.swift3; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.Swift3Codegen; import org.openapitools.codegen.options.Swift3OptionsProvider; -public class Swift3OptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private Swift3Codegen clientCodegen; +public class Swift3OptionsTest extends AbstractOptionsTest { + private Swift3Codegen clientCodegen = mock(Swift3Codegen.class, mockSettings); public Swift3OptionsTest() { super(new Swift3OptionsProvider()); @@ -40,22 +39,13 @@ public class Swift3OptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(Swift3OptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - clientCodegen.setProjectName(Swift3OptionsProvider.PROJECT_NAME_VALUE); - times = 1; - clientCodegen.setResponseAs(Swift3OptionsProvider.RESPONSE_AS_VALUE.split(",")); - times = 1; - clientCodegen.setUnwrapRequired(Boolean.valueOf(Swift3OptionsProvider.UNWRAP_REQUIRED_VALUE)); - times = 1; - clientCodegen.setObjcCompatible(Boolean.valueOf(Swift3OptionsProvider.OBJC_COMPATIBLE_VALUE)); - times = 1; - clientCodegen.setLenientTypeCast(Boolean.valueOf(Swift3OptionsProvider.LENIENT_TYPE_CAST_VALUE)); - times = 1; - clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(Swift3OptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.parseBoolean(Swift3OptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setProjectName(Swift3OptionsProvider.PROJECT_NAME_VALUE); + verify(clientCodegen).setResponseAs(Swift3OptionsProvider.RESPONSE_AS_VALUE.split(",")); + verify(clientCodegen).setUnwrapRequired(Boolean.parseBoolean(Swift3OptionsProvider.UNWRAP_REQUIRED_VALUE)); + verify(clientCodegen).setObjcCompatible(Boolean.parseBoolean(Swift3OptionsProvider.OBJC_COMPATIBLE_VALUE)); + verify(clientCodegen).setLenientTypeCast(Boolean.parseBoolean(Swift3OptionsProvider.LENIENT_TYPE_CAST_VALUE)); + verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.parseBoolean(Swift3OptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4OptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4OptionsTest.java index aa2cfbda8a6..dc4aa7d0943 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4OptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4OptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.swift4; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.Swift4Codegen; import org.openapitools.codegen.options.Swift4OptionsProvider; -public class Swift4OptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private Swift4Codegen clientCodegen; +public class Swift4OptionsTest extends AbstractOptionsTest { + private Swift4Codegen clientCodegen = mock(Swift4Codegen.class, mockSettings); public Swift4OptionsTest() { super(new Swift4OptionsProvider()); @@ -40,24 +39,14 @@ public class Swift4OptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(Swift4OptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - clientCodegen.setProjectName(Swift4OptionsProvider.PROJECT_NAME_VALUE); - times = 1; - clientCodegen.setResponseAs(Swift4OptionsProvider.RESPONSE_AS_VALUE.split(",")); - times = 1; - clientCodegen.setNonPublicApi(Boolean.valueOf(Swift4OptionsProvider.NON_PUBLIC_API_REQUIRED_VALUE)); - times = 1; - clientCodegen.setUnwrapRequired(Boolean.valueOf(Swift4OptionsProvider.UNWRAP_REQUIRED_VALUE)); - times = 1; - clientCodegen.setObjcCompatible(Boolean.valueOf(Swift4OptionsProvider.OBJC_COMPATIBLE_VALUE)); - times = 1; - clientCodegen.setLenientTypeCast(Boolean.valueOf(Swift4OptionsProvider.LENIENT_TYPE_CAST_VALUE)); - times = 1; - clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(Swift4OptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(Swift4OptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setProjectName(Swift4OptionsProvider.PROJECT_NAME_VALUE); + verify(clientCodegen).setResponseAs(Swift4OptionsProvider.RESPONSE_AS_VALUE.split(",")); + verify(clientCodegen).setNonPublicApi(Boolean.parseBoolean(Swift4OptionsProvider.NON_PUBLIC_API_REQUIRED_VALUE)); + verify(clientCodegen).setUnwrapRequired(Boolean.parseBoolean(Swift4OptionsProvider.UNWRAP_REQUIRED_VALUE)); + verify(clientCodegen).setObjcCompatible(Boolean.parseBoolean(Swift4OptionsProvider.OBJC_COMPATIBLE_VALUE)); + verify(clientCodegen).setLenientTypeCast(Boolean.parseBoolean(Swift4OptionsProvider.LENIENT_TYPE_CAST_VALUE)); + verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(Swift4OptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java index e0ed42441f3..3902711776a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.swift5; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.Swift5ClientCodegen; import org.openapitools.codegen.options.Swift5OptionsProvider; -public class Swift5OptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private Swift5ClientCodegen clientCodegen; +public class Swift5OptionsTest extends AbstractOptionsTest { + private Swift5ClientCodegen clientCodegen = mock(Swift5ClientCodegen.class, mockSettings); public Swift5OptionsTest() { super(new Swift5OptionsProvider()); @@ -40,22 +39,13 @@ public class Swift5OptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(Swift5OptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - clientCodegen.setProjectName(Swift5OptionsProvider.PROJECT_NAME_VALUE); - times = 1; - clientCodegen.setResponseAs(Swift5OptionsProvider.RESPONSE_AS_VALUE.split(",")); - times = 1; - clientCodegen.setNonPublicApi(Boolean.valueOf(Swift5OptionsProvider.NON_PUBLIC_API_REQUIRED_VALUE)); - times = 1; - clientCodegen.setObjcCompatible(Boolean.valueOf(Swift5OptionsProvider.OBJC_COMPATIBLE_VALUE)); - times = 1; - clientCodegen.setLenientTypeCast(Boolean.valueOf(Swift5OptionsProvider.LENIENT_TYPE_CAST_VALUE)); - times = 1; - clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(Swift5OptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(Swift5OptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setProjectName(Swift5OptionsProvider.PROJECT_NAME_VALUE); + verify(clientCodegen).setResponseAs(Swift5OptionsProvider.RESPONSE_AS_VALUE.split(",")); + verify(clientCodegen).setNonPublicApi(Boolean.parseBoolean(Swift5OptionsProvider.NON_PUBLIC_API_REQUIRED_VALUE)); + verify(clientCodegen).setObjcCompatible(Boolean.parseBoolean(Swift5OptionsProvider.OBJC_COMPATIBLE_VALUE)); + verify(clientCodegen).setLenientTypeCast(Boolean.parseBoolean(Swift5OptionsProvider.LENIENT_TYPE_CAST_VALUE)); + verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(Swift5OptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/aurelia/TypeScriptAureliaClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/aurelia/TypeScriptAureliaClientOptionsTest.java index 24ad1b86d2a..c8e6a379abd 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/aurelia/TypeScriptAureliaClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/aurelia/TypeScriptAureliaClientOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.typescript.aurelia; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.TypeScriptAureliaClientCodegen; import org.openapitools.codegen.options.TypeScriptAureliaClientOptionsProvider; -public class TypeScriptAureliaClientOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private TypeScriptAureliaClientCodegen clientCodegen; +public class TypeScriptAureliaClientOptionsTest extends AbstractOptionsTest { + private TypeScriptAureliaClientCodegen clientCodegen = mock(TypeScriptAureliaClientCodegen.class, mockSettings); public TypeScriptAureliaClientOptionsTest() { super(new TypeScriptAureliaClientOptionsProvider()); @@ -40,16 +39,10 @@ public class TypeScriptAureliaClientOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(TypeScriptAureliaClientOptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - clientCodegen.setModelPropertyNaming(TypeScriptAureliaClientOptionsProvider.MODEL_PROPERTY_NAMING_VALUE); - times = 1; - clientCodegen.setSupportsES6(TypeScriptAureliaClientOptionsProvider.SUPPORTS_ES6_VALUE); - times = 1; - clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptAureliaClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(TypeScriptAureliaClientOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setModelPropertyNaming(TypeScriptAureliaClientOptionsProvider.MODEL_PROPERTY_NAMING_VALUE); + verify(clientCodegen).setSupportsES6(TypeScriptAureliaClientOptionsProvider.SUPPORTS_ES6_VALUE); + verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptAureliaClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java index 2b79bd0f200..ec63ae29d72 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.typescript.fetch; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.TypeScriptFetchClientCodegen; import org.openapitools.codegen.options.TypeScriptFetchClientOptionsProvider; -public class TypeScriptFetchClientOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private TypeScriptFetchClientCodegen clientCodegen; +public class TypeScriptFetchClientOptionsTest extends AbstractOptionsTest { + private TypeScriptFetchClientCodegen clientCodegen = mock(TypeScriptFetchClientCodegen.class, mockSettings); public TypeScriptFetchClientOptionsTest() { super(new TypeScriptFetchClientOptionsProvider()); @@ -40,18 +39,11 @@ public class TypeScriptFetchClientOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(TypeScriptFetchClientOptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - clientCodegen.setModelPropertyNaming(TypeScriptFetchClientOptionsProvider.MODEL_PROPERTY_NAMING_VALUE); - times = 1; - clientCodegen.setSupportsES6(TypeScriptFetchClientOptionsProvider.SUPPORTS_ES6_VALUE); - times = 1; - clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptFetchClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); - times = 1; - clientCodegen.setTypescriptThreePlus(Boolean.valueOf(TypeScriptFetchClientOptionsProvider.TYPESCRIPT_THREE_PLUS)); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(TypeScriptFetchClientOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setModelPropertyNaming(TypeScriptFetchClientOptionsProvider.MODEL_PROPERTY_NAMING_VALUE); + verify(clientCodegen).setSupportsES6(TypeScriptFetchClientOptionsProvider.SUPPORTS_ES6_VALUE); + verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptFetchClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); + verify(clientCodegen).setTypescriptThreePlus(Boolean.valueOf(TypeScriptFetchClientOptionsProvider.TYPESCRIPT_THREE_PLUS)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java index c36fac78ec0..92aa51c846d 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.typescript.typescriptangular; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.TypeScriptAngularClientCodegen; import org.openapitools.codegen.options.TypeScriptAngularClientOptionsProvider; -public class TypeScriptAngularClientOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private TypeScriptAngularClientCodegen clientCodegen; +public class TypeScriptAngularClientOptionsTest extends AbstractOptionsTest { + private TypeScriptAngularClientCodegen clientCodegen = mock(TypeScriptAngularClientCodegen.class, mockSettings); public TypeScriptAngularClientOptionsTest() { super(new TypeScriptAngularClientOptionsProvider()); @@ -40,18 +39,11 @@ public class TypeScriptAngularClientOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(TypeScriptAngularClientOptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - clientCodegen.setModelPropertyNaming(TypeScriptAngularClientOptionsProvider.MODEL_PROPERTY_NAMING_VALUE); - times = 1; - clientCodegen.setSupportsES6(Boolean.valueOf(TypeScriptAngularClientOptionsProvider.SUPPORTS_ES6_VALUE)); - times = 1; - clientCodegen.setStringEnums(Boolean.valueOf(TypeScriptAngularClientOptionsProvider.STRING_ENUMS_VALUE)); - times = 1; - clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptAngularClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(TypeScriptAngularClientOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setModelPropertyNaming(TypeScriptAngularClientOptionsProvider.MODEL_PROPERTY_NAMING_VALUE); + verify(clientCodegen).setSupportsES6(Boolean.valueOf(TypeScriptAngularClientOptionsProvider.SUPPORTS_ES6_VALUE)); + verify(clientCodegen).setStringEnums(Boolean.parseBoolean(TypeScriptAngularClientOptionsProvider.STRING_ENUMS_VALUE)); + verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptAngularClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangularjs/TypeScriptAngularJsClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangularjs/TypeScriptAngularJsClientOptionsTest.java index cbeb3142946..f966d40b21c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangularjs/TypeScriptAngularJsClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangularjs/TypeScriptAngularJsClientOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.typescript.typescriptangularjs; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.TypeScriptAngularJsClientCodegen; import org.openapitools.codegen.options.TypeScriptAngularJsClientOptionsProvider; -public class TypeScriptAngularJsClientOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private TypeScriptAngularJsClientCodegen clientCodegen; +public class TypeScriptAngularJsClientOptionsTest extends AbstractOptionsTest { + private TypeScriptAngularJsClientCodegen clientCodegen = mock(TypeScriptAngularJsClientCodegen.class, mockSettings); public TypeScriptAngularJsClientOptionsTest() { super(new TypeScriptAngularJsClientOptionsProvider()); @@ -40,16 +39,10 @@ public class TypeScriptAngularJsClientOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(TypeScriptAngularJsClientOptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - clientCodegen.setModelPropertyNaming(TypeScriptAngularJsClientOptionsProvider.MODEL_PROPERTY_NAMING_VALUE); - times = 1; - clientCodegen.setSupportsES6(Boolean.valueOf(TypeScriptAngularJsClientOptionsProvider.SUPPORTS_ES6_VALUE)); - times = 1; - clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptAngularJsClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(TypeScriptAngularJsClientOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setModelPropertyNaming(TypeScriptAngularJsClientOptionsProvider.MODEL_PROPERTY_NAMING_VALUE); + verify(clientCodegen).setSupportsES6(Boolean.valueOf(TypeScriptAngularJsClientOptionsProvider.SUPPORTS_ES6_VALUE)); + verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptAngularJsClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientOptionsTest.java index 6e3dfc01493..bf7e0509925 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientOptionsTest.java @@ -17,17 +17,16 @@ package org.openapitools.codegen.typescript.typescriptnode; -import mockit.Expectations; -import mockit.Tested; import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.TypeScriptNodeClientCodegen; import org.openapitools.codegen.options.TypeScriptNodeClientOptionsProvider; -public class TypeScriptNodeClientOptionsTest extends AbstractOptionsTest { +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; - @Tested - private TypeScriptNodeClientCodegen clientCodegen; +public class TypeScriptNodeClientOptionsTest extends AbstractOptionsTest { + private TypeScriptNodeClientCodegen clientCodegen = mock(TypeScriptNodeClientCodegen.class, mockSettings); public TypeScriptNodeClientOptionsTest() { super(new TypeScriptNodeClientOptionsProvider()); @@ -40,16 +39,10 @@ public class TypeScriptNodeClientOptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - new Expectations(clientCodegen) {{ - clientCodegen.setSortParamsByRequiredFlag(Boolean.valueOf(TypeScriptNodeClientOptionsProvider.SORT_PARAMS_VALUE)); - times = 1; - clientCodegen.setModelPropertyNaming(TypeScriptNodeClientOptionsProvider.MODEL_PROPERTY_NAMING_VALUE); - times = 1; - clientCodegen.setSupportsES6(Boolean.valueOf(TypeScriptNodeClientOptionsProvider.SUPPORTS_ES6_VALUE)); - times = 1; - clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptNodeClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); - times = 1; - }}; + protected void verifyOptions() { + verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(TypeScriptNodeClientOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setModelPropertyNaming(TypeScriptNodeClientOptionsProvider.MODEL_PROPERTY_NAMING_VALUE); + verify(clientCodegen).setSupportsES6(Boolean.valueOf(TypeScriptNodeClientOptionsProvider.SUPPORTS_ES6_VALUE)); + verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptNodeClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); } } diff --git a/new.sh b/new.sh index 52e501c4776..c3dd7f499bf 100755 --- a/new.sh +++ b/new.sh @@ -327,13 +327,11 @@ import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.languages.${lang_classname}; import org.openapitools.codegen.options.${lang_classname}OptionsProvider; -import mockit.Expectations; -import mockit.Tested; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; public class ${lang_classname}OptionsTest extends AbstractOptionsTest { - - @Tested - private ${lang_classname} codegen; + private ${lang_classname} codegen = mock(${lang_classname}.class, mockSettings); public ${lang_classname}OptionsTest() { super(new ${lang_classname}OptionsProvider()); @@ -346,11 +344,9 @@ public class ${lang_classname}OptionsTest extends AbstractOptionsTest { @SuppressWarnings("unused") @Override - protected void setExpectations() { - // TODO: Complete options - new Expectations(codegen) {{ - - }}; + protected void verifyOptions() { + // TODO: Complete options using Mockito + // verify(codegen).someMethod(arguments) } } diff --git a/pom.xml b/pom.xml index 64d0efc5fbe..5f3b845c7ce 100644 --- a/pom.xml +++ b/pom.xml @@ -160,17 +160,7 @@ none:none org.testng:testng -XX:+StartAttachListener - -javaagent:"${settings.localRepository}/org/jmockit/jmockit/${jmockit-version}/jmockit-${jmockit-version}.jar" - - - - org.jmockit - jmockit - ${jmockit-version} - compile - - maven-dependency-plugin @@ -1382,12 +1372,6 @@ ${testng-version} test - - org.jmockit - jmockit - ${jmockit-version} - test - @@ -1419,7 +1403,7 @@ 4.1.2 6.14.3 3.0.0-M3 - 1.46 0.9.10 + 3.2.0 From bcff006dc8d021a4fa0e8cf48b71649c87a9cb5b Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Wed, 22 Jan 2020 19:22:18 -0500 Subject: [PATCH 15/85] [python] Fix NPE in example generation (#5082) --- .../languages/PythonClientCodegen.java | 59 ++++++++++--------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index f605ea8dbbb..c621ebef024 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -829,36 +829,39 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig // List reqs = schema.getRequired(); // if required and optionals - List reqs = new ArrayList(); - for (Object toAdd : schema.getProperties().keySet()) - reqs.add((String)toAdd); - - Map properties = schema.getProperties(); - Set propkeys = null; - if (properties != null) propkeys = properties.keySet(); - if (toExclude != null && reqs.contains(toExclude)) { - reqs.remove(toExclude); - } - for (String toRemove : included_schemas) { - if (reqs.contains(toRemove)) { - reqs.remove(toRemove); + List reqs = new ArrayList<>(); + if (schema.getProperties() != null && !schema.getProperties().isEmpty()) { + for (Object toAdd : schema.getProperties().keySet()) { + reqs.add((String) toAdd); } - } - if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { - included_schemas.add(schema.getTitle()); - } - if (null != schema.getRequired()) for (Object toAdd : schema.getRequired()) { - reqs.add((String)toAdd); - } - if (null!=propkeys) for (String propname : propkeys) { - Schema schema2 = properties.get(propname); - if (reqs.contains(propname)) { - String refTitle = schema2.getTitle(); - if (StringUtils.isBlank(refTitle) || "null".equals(refTitle)) { - schema2.setTitle(propname); + + Map properties = schema.getProperties(); + Set propkeys = null; + if (properties != null) propkeys = properties.keySet(); + if (toExclude != null && reqs.contains(toExclude)) { + reqs.remove(toExclude); + } + for (String toRemove : included_schemas) { + if (reqs.contains(toRemove)) { + reqs.remove(toRemove); + } + } + if (StringUtils.isNotBlank(schema.getTitle()) && !"null".equals(schema.getTitle())) { + included_schemas.add(schema.getTitle()); + } + if (null != schema.getRequired()) for (Object toAdd : schema.getRequired()) { + reqs.add((String) toAdd); + } + if (null != propkeys) for (String propname : propkeys) { + Schema schema2 = properties.get(propname); + if (reqs.contains(propname)) { + String refTitle = schema2.getTitle(); + if (StringUtils.isBlank(refTitle) || "null".equals(refTitle)) { + schema2.setTitle(propname); + } + example += "\n" + indentation_string + underscore(propname) + " = " + + toExampleValueRecursive(schema2, included_schemas, indentation + 1) + ", "; } - example += "\n" + indentation_string + underscore(propname) + " = "+ - toExampleValueRecursive(schema2, included_schemas, indentation+1)+", "; } } example +=")"; From 0366e946ba9d1a30a777cf085f24cffd7f404211 Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Thu, 23 Jan 2020 11:18:18 +0300 Subject: [PATCH 16/85] [Slim4] Add string formats support to Data Mocker (#4975) * [Slim4] Support byte data format * [Slim4] Support date and date-time data formats * [Slim4] Support password data format * [Slim4] Support uuid data format * [Slim4] Fix test of password format mocking '00000' is numeric type, because PHPUnit doesn't make strict type comparison. * [Slim4] Fix data format key in object mocking * [Slim4] Support binary data format * [Slim4] Support email data format * [Slim4] Base64 encode binary format output Raw bytes string breaks PHP stdout output, so I've decided to use base64 encoding format for binary format too. * [Slim4] Refresh samples --- .../openapi_data_mocker.mustache | 88 ++++++++- .../openapi_data_mocker_test.mustache | 186 +++++++++++++++++- .../php-slim4/lib/Mock/OpenApiDataMocker.php | 88 ++++++++- .../test/Mock/OpenApiDataMockerTest.php | 186 +++++++++++++++++- 4 files changed, 544 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker.mustache index 5d101d2cf29..5cb7ec947f4 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker.mustache @@ -36,6 +36,7 @@ namespace {{mockPackage}}; use {{mockPackage}}\{{interfaceNamePrefix}}OpenApiDataMocker{{interfaceNameSuffix}} as IMocker; use {{utilsPackage}}\{{traitNamePrefix}}ModelUtils{{traitNameSuffix}}; use StdClass; +use DateTime; use InvalidArgumentException; /** @@ -193,6 +194,26 @@ final class OpenApiDataMocker implements IMocker $enum = null, $pattern = null ) { + $str = ''; + $getLoremIpsum = function ($length) { + return str_pad( + '', + $length, + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ', + \STR_PAD_RIGHT + ); + }; + $truncateOrPad = function ($text, $min = null, $max = null, $glue = '') { + if ($max !== null && mb_strlen($text) > $max) { + // truncate + $text = substr($text, 0, $max); + } elseif ($min !== null && mb_strlen($text) < $min) { + // pad + $text = str_pad('', $min, $text . $glue, \STR_PAD_RIGHT); + } + return $text; + }; + if ($enum !== null) { if ( is_array($enum) === false @@ -231,7 +252,72 @@ final class OpenApiDataMocker implements IMocker throw new InvalidArgumentException('"maxLength" value cannot be less than "minLength"'); } - return str_pad('', mt_rand($minLength, $maxLength), 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ', \STR_PAD_RIGHT); + switch ($dataFormat) { + case IMocker::DATA_FORMAT_BYTE: + case IMocker::DATA_FORMAT_BINARY: + // base64 encoded string + $inputLength = 1; + $str = base64_encode($getLoremIpsum($inputLength)); + while (mb_strlen($str) < $minLength) { + $inputLength++; + $str = base64_encode($getLoremIpsum($inputLength)); + } + + // base64 encoding produces strings devided by 4, so resulted string can exceed maxLength parameter + // I think truncated(invalid) base64 string is better than oversized, cause this data is fake anyway + $str = $truncateOrPad($str, null, $maxLength, '. '); + break; + case IMocker::DATA_FORMAT_DATE: + case IMocker::DATA_FORMAT_DATE_TIME: + // min unix timestamp is 0 and max is 2147483647 for 32bit systems which equals 2038-01-19 03:14:07 + $date = DateTime::createFromFormat('U', mt_rand(0, 2147483647)); + $str = ($dataFormat === IMocker::DATA_FORMAT_DATE) ? $date->format('Y-m-d') : $date->format('Y-m-d\TH:i:sP'); + + // truncate or pad datestring to fit minLength and maxLength + $str = $truncateOrPad($str, $minLength, $maxLength, ' '); + break; + case IMocker::DATA_FORMAT_PASSWORD: + // use list of most popular passwords + $obviousPassList = [ + 'qwerty', + 'qwerty12345', + 'hello', + '12345', + '0000', + 'qwerty12345!', + 'qwertyuiop[]', + ]; + $str = $obviousPassList[mt_rand(0, count($obviousPassList) - 1)]; + + // truncate or pad password to fit minLength and maxLength + $str = $truncateOrPad($str, $minLength, $maxLength); + break; + case IMocker::DATA_FORMAT_UUID: + // use php built-in uniqid function + $str = uniqid(); + + // truncate or pad password to fit minLength and maxLength + $str = $truncateOrPad($str, $minLength, $maxLength); + break; + case IMocker::DATA_FORMAT_EMAIL: + // just for visionary purpose, not related to real persons + $fakeEmailList = [ + 'johndoe', + 'lhoswald', + 'ojsimpson', + 'mlking', + 'jfkennedy', + ]; + $str = $fakeEmailList[mt_rand(0, count($fakeEmailList) - 1)] . '@example.com'; + + // truncate or pad email to fit minLength and maxLength + $str = $truncateOrPad($str, $minLength, $maxLength); + break; + default: + $str = $getLoremIpsum(mt_rand($minLength, $maxLength)); + } + + return $str; } /** diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker_test.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker_test.mustache index c6e70d781af..e02fa3ed3c9 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker_test.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/openapi_data_mocker_test.mustache @@ -342,7 +342,6 @@ class OpenApiDataMockerTest extends TestCase IsType::TYPE_STRING, ]; $notTypes = [ - IsType::TYPE_NUMERIC, IsType::TYPE_FLOAT, IsType::TYPE_INT, IsType::TYPE_ARRAY, @@ -363,6 +362,22 @@ class OpenApiDataMockerTest extends TestCase [null, null, null, null, $types, $notTypes], [null, null, null, ['foobar', 'foobaz', 'hello world'], $types, $notTypes], [null, null, null, ['foobar'], $types, $notTypes], + [IMocker::DATA_FORMAT_PASSWORD, 0, null, null, $types, $notTypes], + [IMocker::DATA_FORMAT_PASSWORD, 10, null, null, $types, $notTypes], + [IMocker::DATA_FORMAT_PASSWORD, 0, 100, null, $types, $notTypes], + [IMocker::DATA_FORMAT_PASSWORD, 10, 50, null, $types, $notTypes], + [IMocker::DATA_FORMAT_PASSWORD, 10, 10, null, $types, $notTypes], + [IMocker::DATA_FORMAT_PASSWORD, 0, 0, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, null, null, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, 10, null, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, 10, 10, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, null, 8, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, 16, null, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, 25, null, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, 25, 25, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, null, 20, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, 30, null, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, 1, 1, null, $types, $notTypes], ]; } @@ -398,6 +413,175 @@ class OpenApiDataMockerTest extends TestCase ]; } + /** + * @covers ::mock + * @covers ::mockString + * @dataProvider provideMockStringByteFormatArguments + */ + public function testMockStringWithByteFormat( + $dataFormat, + $minLength, + $maxLength + ) { + $mocker = new OpenApiDataMocker(); + $str = $mocker->mockString($dataFormat, $minLength, $maxLength); + $str2 = $mocker->mock(IMocker::DATA_TYPE_STRING, $dataFormat, ['minLength' => $minLength, 'maxLength' => $maxLength]); + $base64pattern = '/^[\w\+\/\=]*$/'; + $this->assertRegExp($base64pattern, $str); + $this->assertRegExp($base64pattern, $str2); + if ($minLength !== null) { + $this->assertGreaterThanOrEqual($minLength, mb_strlen($str)); + $this->assertGreaterThanOrEqual($minLength, mb_strlen($str2)); + } + if ($maxLength !== null) { + $this->assertLessThanOrEqual($maxLength, mb_strlen($str)); + $this->assertLessThanOrEqual($maxLength, mb_strlen($str2)); + } + } + + public function provideMockStringByteFormatArguments() + { + return [ + [IMocker::DATA_FORMAT_BYTE, null, null], + [IMocker::DATA_FORMAT_BYTE, 10, null], + [IMocker::DATA_FORMAT_BYTE, 10, 10], + [IMocker::DATA_FORMAT_BYTE, null, 12], + ]; + } + + /** + * @covers ::mock + * @covers ::mockString + * @dataProvider provideMockStringBinaryFormatArguments + */ + public function testMockStringWithBinaryFormat( + $dataFormat, + $minLength, + $maxLength + ) { + $mocker = new OpenApiDataMocker(); + $str = $mocker->mockString($dataFormat, $minLength, $maxLength); + $str2 = $mocker->mock(IMocker::DATA_TYPE_STRING, $dataFormat, ['minLength' => $minLength, 'maxLength' => $maxLength]); + if ($minLength !== null) { + $this->assertGreaterThanOrEqual($minLength, strlen($str)); + $this->assertGreaterThanOrEqual($minLength, strlen($str2)); + } + if ($maxLength !== null) { + $this->assertLessThanOrEqual($maxLength, strlen($str)); + $this->assertLessThanOrEqual($maxLength, strlen($str2)); + } + } + + public function provideMockStringBinaryFormatArguments() + { + return [ + [IMocker::DATA_FORMAT_BINARY, 0, null], + [IMocker::DATA_FORMAT_BINARY, 10, null], + [IMocker::DATA_FORMAT_BINARY, 0, 100], + [IMocker::DATA_FORMAT_BINARY, 10, 50], + [IMocker::DATA_FORMAT_BINARY, 10, 10], + [IMocker::DATA_FORMAT_BINARY, 0, 0], + ]; + } + + /** + * @covers ::mock + * @covers ::mockString + * @dataProvider provideMockStringDateFormatArguments + */ + public function testMockStringWithDateAndDateTimeFormat( + $dataFormat, + $minLength, + $maxLength, + $dtFormat + ) { + $mocker = new OpenApiDataMocker(); + $str = $mocker->mockString($dataFormat, $minLength, $maxLength); + $str2 = $mocker->mock(IMocker::DATA_TYPE_STRING, $dataFormat, ['minLength' => $minLength, 'maxLength' => $maxLength]); + + if ($dtFormat !== null) { + $date = DateTime::createFromFormat($dtFormat, $str); + $date2 = DateTime::createFromFormat($dtFormat, $str2); + $this->assertInstanceOf(DateTime::class, $date); + $this->assertInstanceOf(DateTime::class, $date2); + } + if ($minLength !== null) { + $this->assertGreaterThanOrEqual($minLength, mb_strlen($str)); + $this->assertGreaterThanOrEqual($minLength, mb_strlen($str2)); + } + if ($maxLength !== null) { + $this->assertLessThanOrEqual($maxLength, mb_strlen($str)); + $this->assertLessThanOrEqual($maxLength, mb_strlen($str2)); + } + } + + public function provideMockStringDateFormatArguments() + { + return [ + [IMocker::DATA_FORMAT_DATE, null, null, 'Y-m-d'], + [IMocker::DATA_FORMAT_DATE, 10, null, 'Y-m-d'], + [IMocker::DATA_FORMAT_DATE, 10, 10, 'Y-m-d'], + [IMocker::DATA_FORMAT_DATE, null, 8, null], + [IMocker::DATA_FORMAT_DATE, 16, null, null], + [IMocker::DATA_FORMAT_DATE_TIME, null, null, 'Y-m-d\TH:i:sP'], + [IMocker::DATA_FORMAT_DATE_TIME, 25, null, 'Y-m-d\TH:i:sP'], + [IMocker::DATA_FORMAT_DATE_TIME, 25, 25, 'Y-m-d\TH:i:sP'], + [IMocker::DATA_FORMAT_DATE_TIME, null, 20, null], + [IMocker::DATA_FORMAT_DATE_TIME, 30, null, null], + ]; + } + + /** + * @covers ::mock + * @covers ::mockString + * @dataProvider provideMockStringUuidFormatArguments + */ + public function testMockStringWithUuidFormat( + $minLength, + $maxLength + ) { + $mocker = new OpenApiDataMocker(); + $arr = []; + $arr2 = []; + $hexPattern = '/^[a-f0-9]*$/'; + + while (count($arr) < 100 && count($arr2) < 100) { + $str = $mocker->mockString(IMocker::DATA_FORMAT_UUID, $minLength, $maxLength); + $str2 = $mocker->mock(IMocker::DATA_TYPE_STRING, IMocker::DATA_FORMAT_UUID, ['minLength' => $minLength, 'maxLength' => $maxLength]); + $arr[] = $str; + $arr2[] = $str2; + + $this->assertRegExp($hexPattern, $str); + $this->assertRegExp($hexPattern, $str2); + + if ($minLength !== null) { + $this->assertGreaterThanOrEqual($minLength, mb_strlen($str)); + $this->assertGreaterThanOrEqual($minLength, mb_strlen($str2)); + } + if ($maxLength !== null) { + $this->assertLessThanOrEqual($maxLength, mb_strlen($str)); + $this->assertLessThanOrEqual($maxLength, mb_strlen($str2)); + } + } + } + + public function provideMockStringUuidFormatArguments() + { + return [ + [null, null], + [10, null], + [10, 10], + [null, 8], + [16, null], + [null, null], + [25, null], + [25, 25], + [null, 20], + [30, null], + [1, 1], + ]; + } + /** * @covers ::mockBoolean */ diff --git a/samples/server/petstore/php-slim4/lib/Mock/OpenApiDataMocker.php b/samples/server/petstore/php-slim4/lib/Mock/OpenApiDataMocker.php index facf17f0ef2..662cfcca9d5 100644 --- a/samples/server/petstore/php-slim4/lib/Mock/OpenApiDataMocker.php +++ b/samples/server/petstore/php-slim4/lib/Mock/OpenApiDataMocker.php @@ -28,6 +28,7 @@ namespace OpenAPIServer\Mock; use OpenAPIServer\Mock\OpenApiDataMockerInterface as IMocker; use OpenAPIServer\Utils\ModelUtilsTrait; use StdClass; +use DateTime; use InvalidArgumentException; /** @@ -185,6 +186,26 @@ final class OpenApiDataMocker implements IMocker $enum = null, $pattern = null ) { + $str = ''; + $getLoremIpsum = function ($length) { + return str_pad( + '', + $length, + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ', + \STR_PAD_RIGHT + ); + }; + $truncateOrPad = function ($text, $min = null, $max = null, $glue = '') { + if ($max !== null && mb_strlen($text) > $max) { + // truncate + $text = substr($text, 0, $max); + } elseif ($min !== null && mb_strlen($text) < $min) { + // pad + $text = str_pad('', $min, $text . $glue, \STR_PAD_RIGHT); + } + return $text; + }; + if ($enum !== null) { if ( is_array($enum) === false @@ -223,7 +244,72 @@ final class OpenApiDataMocker implements IMocker throw new InvalidArgumentException('"maxLength" value cannot be less than "minLength"'); } - return str_pad('', mt_rand($minLength, $maxLength), 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ', \STR_PAD_RIGHT); + switch ($dataFormat) { + case IMocker::DATA_FORMAT_BYTE: + case IMocker::DATA_FORMAT_BINARY: + // base64 encoded string + $inputLength = 1; + $str = base64_encode($getLoremIpsum($inputLength)); + while (mb_strlen($str) < $minLength) { + $inputLength++; + $str = base64_encode($getLoremIpsum($inputLength)); + } + + // base64 encoding produces strings devided by 4, so resulted string can exceed maxLength parameter + // I think truncated(invalid) base64 string is better than oversized, cause this data is fake anyway + $str = $truncateOrPad($str, null, $maxLength, '. '); + break; + case IMocker::DATA_FORMAT_DATE: + case IMocker::DATA_FORMAT_DATE_TIME: + // min unix timestamp is 0 and max is 2147483647 for 32bit systems which equals 2038-01-19 03:14:07 + $date = DateTime::createFromFormat('U', mt_rand(0, 2147483647)); + $str = ($dataFormat === IMocker::DATA_FORMAT_DATE) ? $date->format('Y-m-d') : $date->format('Y-m-d\TH:i:sP'); + + // truncate or pad datestring to fit minLength and maxLength + $str = $truncateOrPad($str, $minLength, $maxLength, ' '); + break; + case IMocker::DATA_FORMAT_PASSWORD: + // use list of most popular passwords + $obviousPassList = [ + 'qwerty', + 'qwerty12345', + 'hello', + '12345', + '0000', + 'qwerty12345!', + 'qwertyuiop[]', + ]; + $str = $obviousPassList[mt_rand(0, count($obviousPassList) - 1)]; + + // truncate or pad password to fit minLength and maxLength + $str = $truncateOrPad($str, $minLength, $maxLength); + break; + case IMocker::DATA_FORMAT_UUID: + // use php built-in uniqid function + $str = uniqid(); + + // truncate or pad password to fit minLength and maxLength + $str = $truncateOrPad($str, $minLength, $maxLength); + break; + case IMocker::DATA_FORMAT_EMAIL: + // just for visionary purpose, not related to real persons + $fakeEmailList = [ + 'johndoe', + 'lhoswald', + 'ojsimpson', + 'mlking', + 'jfkennedy', + ]; + $str = $fakeEmailList[mt_rand(0, count($fakeEmailList) - 1)] . '@example.com'; + + // truncate or pad email to fit minLength and maxLength + $str = $truncateOrPad($str, $minLength, $maxLength); + break; + default: + $str = $getLoremIpsum(mt_rand($minLength, $maxLength)); + } + + return $str; } /** diff --git a/samples/server/petstore/php-slim4/test/Mock/OpenApiDataMockerTest.php b/samples/server/petstore/php-slim4/test/Mock/OpenApiDataMockerTest.php index 87777551d08..eeb95d67d6e 100644 --- a/samples/server/petstore/php-slim4/test/Mock/OpenApiDataMockerTest.php +++ b/samples/server/petstore/php-slim4/test/Mock/OpenApiDataMockerTest.php @@ -334,7 +334,6 @@ class OpenApiDataMockerTest extends TestCase IsType::TYPE_STRING, ]; $notTypes = [ - IsType::TYPE_NUMERIC, IsType::TYPE_FLOAT, IsType::TYPE_INT, IsType::TYPE_ARRAY, @@ -355,6 +354,22 @@ class OpenApiDataMockerTest extends TestCase [null, null, null, null, $types, $notTypes], [null, null, null, ['foobar', 'foobaz', 'hello world'], $types, $notTypes], [null, null, null, ['foobar'], $types, $notTypes], + [IMocker::DATA_FORMAT_PASSWORD, 0, null, null, $types, $notTypes], + [IMocker::DATA_FORMAT_PASSWORD, 10, null, null, $types, $notTypes], + [IMocker::DATA_FORMAT_PASSWORD, 0, 100, null, $types, $notTypes], + [IMocker::DATA_FORMAT_PASSWORD, 10, 50, null, $types, $notTypes], + [IMocker::DATA_FORMAT_PASSWORD, 10, 10, null, $types, $notTypes], + [IMocker::DATA_FORMAT_PASSWORD, 0, 0, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, null, null, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, 10, null, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, 10, 10, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, null, 8, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, 16, null, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, 25, null, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, 25, 25, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, null, 20, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, 30, null, null, $types, $notTypes], + [IMocker::DATA_FORMAT_EMAIL, 1, 1, null, $types, $notTypes], ]; } @@ -390,6 +405,175 @@ class OpenApiDataMockerTest extends TestCase ]; } + /** + * @covers ::mock + * @covers ::mockString + * @dataProvider provideMockStringByteFormatArguments + */ + public function testMockStringWithByteFormat( + $dataFormat, + $minLength, + $maxLength + ) { + $mocker = new OpenApiDataMocker(); + $str = $mocker->mockString($dataFormat, $minLength, $maxLength); + $str2 = $mocker->mock(IMocker::DATA_TYPE_STRING, $dataFormat, ['minLength' => $minLength, 'maxLength' => $maxLength]); + $base64pattern = '/^[\w\+\/\=]*$/'; + $this->assertRegExp($base64pattern, $str); + $this->assertRegExp($base64pattern, $str2); + if ($minLength !== null) { + $this->assertGreaterThanOrEqual($minLength, mb_strlen($str)); + $this->assertGreaterThanOrEqual($minLength, mb_strlen($str2)); + } + if ($maxLength !== null) { + $this->assertLessThanOrEqual($maxLength, mb_strlen($str)); + $this->assertLessThanOrEqual($maxLength, mb_strlen($str2)); + } + } + + public function provideMockStringByteFormatArguments() + { + return [ + [IMocker::DATA_FORMAT_BYTE, null, null], + [IMocker::DATA_FORMAT_BYTE, 10, null], + [IMocker::DATA_FORMAT_BYTE, 10, 10], + [IMocker::DATA_FORMAT_BYTE, null, 12], + ]; + } + + /** + * @covers ::mock + * @covers ::mockString + * @dataProvider provideMockStringBinaryFormatArguments + */ + public function testMockStringWithBinaryFormat( + $dataFormat, + $minLength, + $maxLength + ) { + $mocker = new OpenApiDataMocker(); + $str = $mocker->mockString($dataFormat, $minLength, $maxLength); + $str2 = $mocker->mock(IMocker::DATA_TYPE_STRING, $dataFormat, ['minLength' => $minLength, 'maxLength' => $maxLength]); + if ($minLength !== null) { + $this->assertGreaterThanOrEqual($minLength, strlen($str)); + $this->assertGreaterThanOrEqual($minLength, strlen($str2)); + } + if ($maxLength !== null) { + $this->assertLessThanOrEqual($maxLength, strlen($str)); + $this->assertLessThanOrEqual($maxLength, strlen($str2)); + } + } + + public function provideMockStringBinaryFormatArguments() + { + return [ + [IMocker::DATA_FORMAT_BINARY, 0, null], + [IMocker::DATA_FORMAT_BINARY, 10, null], + [IMocker::DATA_FORMAT_BINARY, 0, 100], + [IMocker::DATA_FORMAT_BINARY, 10, 50], + [IMocker::DATA_FORMAT_BINARY, 10, 10], + [IMocker::DATA_FORMAT_BINARY, 0, 0], + ]; + } + + /** + * @covers ::mock + * @covers ::mockString + * @dataProvider provideMockStringDateFormatArguments + */ + public function testMockStringWithDateAndDateTimeFormat( + $dataFormat, + $minLength, + $maxLength, + $dtFormat + ) { + $mocker = new OpenApiDataMocker(); + $str = $mocker->mockString($dataFormat, $minLength, $maxLength); + $str2 = $mocker->mock(IMocker::DATA_TYPE_STRING, $dataFormat, ['minLength' => $minLength, 'maxLength' => $maxLength]); + + if ($dtFormat !== null) { + $date = DateTime::createFromFormat($dtFormat, $str); + $date2 = DateTime::createFromFormat($dtFormat, $str2); + $this->assertInstanceOf(DateTime::class, $date); + $this->assertInstanceOf(DateTime::class, $date2); + } + if ($minLength !== null) { + $this->assertGreaterThanOrEqual($minLength, mb_strlen($str)); + $this->assertGreaterThanOrEqual($minLength, mb_strlen($str2)); + } + if ($maxLength !== null) { + $this->assertLessThanOrEqual($maxLength, mb_strlen($str)); + $this->assertLessThanOrEqual($maxLength, mb_strlen($str2)); + } + } + + public function provideMockStringDateFormatArguments() + { + return [ + [IMocker::DATA_FORMAT_DATE, null, null, 'Y-m-d'], + [IMocker::DATA_FORMAT_DATE, 10, null, 'Y-m-d'], + [IMocker::DATA_FORMAT_DATE, 10, 10, 'Y-m-d'], + [IMocker::DATA_FORMAT_DATE, null, 8, null], + [IMocker::DATA_FORMAT_DATE, 16, null, null], + [IMocker::DATA_FORMAT_DATE_TIME, null, null, 'Y-m-d\TH:i:sP'], + [IMocker::DATA_FORMAT_DATE_TIME, 25, null, 'Y-m-d\TH:i:sP'], + [IMocker::DATA_FORMAT_DATE_TIME, 25, 25, 'Y-m-d\TH:i:sP'], + [IMocker::DATA_FORMAT_DATE_TIME, null, 20, null], + [IMocker::DATA_FORMAT_DATE_TIME, 30, null, null], + ]; + } + + /** + * @covers ::mock + * @covers ::mockString + * @dataProvider provideMockStringUuidFormatArguments + */ + public function testMockStringWithUuidFormat( + $minLength, + $maxLength + ) { + $mocker = new OpenApiDataMocker(); + $arr = []; + $arr2 = []; + $hexPattern = '/^[a-f0-9]*$/'; + + while (count($arr) < 100 && count($arr2) < 100) { + $str = $mocker->mockString(IMocker::DATA_FORMAT_UUID, $minLength, $maxLength); + $str2 = $mocker->mock(IMocker::DATA_TYPE_STRING, IMocker::DATA_FORMAT_UUID, ['minLength' => $minLength, 'maxLength' => $maxLength]); + $arr[] = $str; + $arr2[] = $str2; + + $this->assertRegExp($hexPattern, $str); + $this->assertRegExp($hexPattern, $str2); + + if ($minLength !== null) { + $this->assertGreaterThanOrEqual($minLength, mb_strlen($str)); + $this->assertGreaterThanOrEqual($minLength, mb_strlen($str2)); + } + if ($maxLength !== null) { + $this->assertLessThanOrEqual($maxLength, mb_strlen($str)); + $this->assertLessThanOrEqual($maxLength, mb_strlen($str2)); + } + } + } + + public function provideMockStringUuidFormatArguments() + { + return [ + [null, null], + [10, null], + [10, 10], + [null, 8], + [16, null], + [null, null], + [25, null], + [25, 25], + [null, 20], + [30, null], + [1, 1], + ]; + } + /** * @covers ::mockBoolean */ From 138232d557e5c7b39427b6e351993b85cc5df93c Mon Sep 17 00:00:00 2001 From: sunn <33183834+etherealjoy@users.noreply.github.com> Date: Thu, 23 Jan 2020 20:43:40 +0100 Subject: [PATCH 17/85] [C++] [Qt5] Add request compression and handling identity (#5088) * Add request and response compression and handling identity * Minor updates for identity and if conditions --- .../cpp-qt5-client/HttpRequest.cpp.mustache | 92 +++++++++++++++++-- .../cpp-qt5-client/HttpRequest.h.mustache | 11 ++- .../cpp-qt5-client/api-body.mustache | 16 +++- .../cpp-qt5-client/api-header.mustache | 6 +- .../cpp-qt5/client/PFXHttpRequest.cpp | 39 ++++++-- .../petstore/cpp-qt5/client/PFXHttpRequest.h | 11 ++- .../petstore/cpp-qt5/client/PFXPetApi.cpp | 19 ++-- .../petstore/cpp-qt5/client/PFXPetApi.h | 6 +- .../petstore/cpp-qt5/client/PFXStoreApi.cpp | 15 +-- .../petstore/cpp-qt5/client/PFXStoreApi.h | 6 +- .../petstore/cpp-qt5/client/PFXUserApi.cpp | 19 ++-- .../petstore/cpp-qt5/client/PFXUserApi.h | 6 +- 12 files changed, 182 insertions(+), 64 deletions(-) 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 933bb0c1698..719de8de5b2 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 @@ -96,8 +96,12 @@ void {{prefix}}HttpRequestWorker::setWorkingDirectory(const QString &path) { } } -void {{prefix}}HttpRequestWorker::setCompressionEnabled(bool enable) { - isCompressionEnabled = enable; +void {{prefix}}HttpRequestWorker::setResponseCompressionEnabled(bool enable) { + isResponseCompressionEnabled = enable; +} + +void {{prefix}}HttpRequestWorker::setRequestCompressionEnabled(bool enable) { + isRequestCompressionEnabled = enable; } QString {{prefix}}HttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) { @@ -285,7 +289,11 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) { if (input->request_body.size() > 0) { qDebug() << "got a request body"; request_content.clear(); - request_content.append(input->request_body); + if(!isFormData && (input->var_layout != MULTIPART) && isRequestCompressionEnabled){ + request_content.append(compress(input->request_body, 7, {{prefix}}CompressionType::Gzip)); + } else { + request_content.append(input->request_body); + } } // prepare connection @@ -302,14 +310,19 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) { } else { request.setHeader(QNetworkRequest::ContentTypeHeader, input->headers.value("Content-Type")); } + if(isRequestCompressionEnabled){ + request.setRawHeader("Content-Encoding", "gzip"); + } } else if (input->var_layout == URL_ENCODED) { request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); } else if (input->var_layout == MULTIPART) { request.setHeader(QNetworkRequest::ContentTypeHeader, "multipart/form-data; boundary=" + boundary); } - if(isCompressionEnabled){ - request.setRawHeader("Accept-Encoding", "deflate, gzip"); + if(isResponseCompressionEnabled){ + request.setRawHeader("Accept-Encoding", "gzip"); + } else { + request.setRawHeader("Accept-Encoding", "identity"); } if (input->http_method == "GET") { @@ -391,6 +404,8 @@ void {{prefix}}HttpRequestWorker::process_response(QNetworkReply *reply) { auto compressionTypes = encoding.first().split(',', QString::SkipEmptyParts); if(compressionTypes.contains("gzip", Qt::CaseInsensitive) || compressionTypes.contains("deflate", Qt::CaseInsensitive)){ response = decompress(reply->readAll()); + } else if(compressionTypes.contains("identity", Qt::CaseInsensitive)){ + response = reply->readAll(); } } } @@ -402,11 +417,11 @@ void {{prefix}}HttpRequestWorker::process_response(QNetworkReply *reply) { } QByteArray {{prefix}}HttpRequestWorker::decompress(const QByteArray& data){ - QByteArray result; - bool sts = false;{{#contentCompression}} + {{#contentCompression}}QByteArray result; + bool sts = false; do{ z_stream strm{}; - static const int CHUNK_SIZE = 2048; + static const int CHUNK_SIZE = 8*1024; char out[CHUNK_SIZE]; if (data.size() <= 4) { break; @@ -427,8 +442,65 @@ QByteArray {{prefix}}HttpRequestWorker::decompress(const QByteArray& data){ sts = true; } while (strm.avail_out == 0); inflateEnd(&strm); - } while(false);{{/contentCompression}} - return sts ? result : QByteArray(); + } while(false); + return sts ? result : QByteArray();{{/contentCompression}}{{^contentCompression}} + Q_UNUSED(data); + return QByteArray();{{/contentCompression}} +} + +QByteArray {{prefix}}HttpRequestWorker::compress(const QByteArray& input, int level, {{prefix}}CompressionType compressType) { + {{#contentCompression}}QByteArray output; + static const int GZIP_WINDOW_BIT = 15+16; + static const int ZLIB_WINDOW_BIT = 15; + static const int CHUNK_SIZE = 8*1024; + int windowBits; + if( compressType == {{prefix}}CompressionType::Gzip ){ + windowBits = GZIP_WINDOW_BIT; + } else if ( compressType == {{prefix}}CompressionType::Zlib ){ + windowBits = ZLIB_WINDOW_BIT; + } + do{ + int flush = 0, ret = 0; + bool error_sts = false; + z_stream strm{}; + if(input.length() <= 0) { + break; + } + if (deflateInit2(&strm, qMax(-1, qMin(9, level)), Z_DEFLATED, windowBits, 8, Z_DEFAULT_STRATEGY) != Z_OK){ + break; + } + output.clear(); + auto input_data = input.data(); + int input_data_left = input.length(); + do { + int chunk_size = qMin(CHUNK_SIZE, input_data_left); + strm.next_in = (unsigned char*)input_data; + strm.avail_in = chunk_size; + input_data += chunk_size; + input_data_left -= chunk_size; + flush = (input_data_left <= 0 ? Z_FINISH : Z_NO_FLUSH); + do { + char out[CHUNK_SIZE]; + strm.next_out = (unsigned char*)out; + strm.avail_out = CHUNK_SIZE; + ret = deflate(&strm, flush); + if(ret == Z_STREAM_ERROR) { + error_sts = true; + break; + } + auto have = (CHUNK_SIZE - strm.avail_out); + if(have > 0){ + output.append((char*)out, have); + } + } while (strm.avail_out == 0); + } while ((flush != Z_FINISH) && !(error_sts)); + deflateEnd(&strm); + } while(false); + return output;{{/contentCompression}}{{^contentCompression}} + Q_UNUSED(input); + Q_UNUSED(level); + Q_UNUSED(compressType); + return QByteArray();{{/contentCompression}} } QSslConfiguration *{{prefix}}HttpRequestWorker::sslDefaultConfiguration; diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache index 9df29d4f24b..dea2d3090ef 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 @@ -63,21 +63,28 @@ public: void setWorkingDirectory(const QString &path); {{prefix}}HttpFileElement getHttpFileElement(const QString &fieldname = QString()); QByteArray *getMultiPartField(const QString &fieldname = QString()); - void setCompressionEnabled(bool enable); + void setResponseCompressionEnabled(bool enable); + void setRequestCompressionEnabled(bool enable); signals: void on_execution_finished({{prefix}}HttpRequestWorker *worker); private: + enum {{prefix}}CompressionType{ + Zlib, + Gzip + }; QNetworkAccessManager *manager; QMap headers; QMap files; QMap multiPartFields; QString workingDirectory; int _timeOut; - bool isCompressionEnabled; + bool isResponseCompressionEnabled; + bool isRequestCompressionEnabled; void on_manager_timeout(QNetworkReply *reply); void process_response(QNetworkReply *reply); QByteArray decompress(const QByteArray& data); + QByteArray compress(const QByteArray& input, int level, {{prefix}}CompressionType compressType); private slots: void on_manager_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 451e05b6a18..311afc60b95 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 @@ -15,7 +15,8 @@ namespace {{this}} { _port(port), _basePath(basePath), _timeOut(timeOut), - _compress(false) {} + isResponseCompressionEnabled(false), + isRequestCompressionEnabled(false) {} {{classname}}::~{{classname}}() { } @@ -48,8 +49,12 @@ void {{classname}}::addHeaders(const QString &key, const QString &value) { defaultHeaders.insert(key, value); } -void {{classname}}::enableContentCompression() { - _compress = true; +void {{classname}}::enableRequestCompression() { + isRequestCompressionEnabled = true; +} + +void {{classname}}::enableResponseCompression() { + isResponseCompressionEnabled = true; } {{#operations}} @@ -113,8 +118,9 @@ void {{classname}}::{{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName {{/collectionFormat}}{{/queryParams}} {{prefix}}HttpRequestWorker *worker = new {{prefix}}HttpRequestWorker(this); worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); + worker->setWorkingDirectory(_workingDirectory);{{#contentCompression}} + worker->setResponseCompressionEnabled(isResponseCompressionEnabled); + worker->setRequestCompressionEnabled(isRequestCompressionEnabled);{{/contentCompression}} {{prefix}}HttpRequestInput input(fullPath, "{{httpMethod}}"); {{#formParams}}{{^isFile}} input.add_var("{{baseName}}", ::{{cppNamespace}}::toStringValue({{paramName}}));{{/isFile}}{{#isFile}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache index 07a33698b58..9fdf7b80c61 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache @@ -27,7 +27,8 @@ public: void setTimeOut(const int timeOut); void setWorkingDirectory(const QString &path); void addHeaders(const QString &key, const QString &value); - void enableContentCompression(); + void enableRequestCompression(); + void enableResponseCompression(); {{#operations}}{{#operation}} void {{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/operation}}{{/operations}} @@ -38,7 +39,8 @@ private: int _timeOut; QString _workingDirectory; QMap defaultHeaders; - bool _compress; + bool isResponseCompressionEnabled; + bool isRequestCompressionEnabled; {{#operations}}{{#operation}} void {{nickname}}Callback({{prefix}}HttpRequestWorker *worker);{{/operation}}{{/operations}} diff --git a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp index 27152077769..091e075291d 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp @@ -103,8 +103,12 @@ void PFXHttpRequestWorker::setWorkingDirectory(const QString &path) { } } -void PFXHttpRequestWorker::setCompressionEnabled(bool enable) { - isCompressionEnabled = enable; +void PFXHttpRequestWorker::setResponseCompressionEnabled(bool enable) { + isResponseCompressionEnabled = enable; +} + +void PFXHttpRequestWorker::setRequestCompressionEnabled(bool enable) { + isRequestCompressionEnabled = enable; } QString PFXHttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) { @@ -292,7 +296,11 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) { if (input->request_body.size() > 0) { qDebug() << "got a request body"; request_content.clear(); - request_content.append(input->request_body); + if(!isFormData && (input->var_layout != MULTIPART) && isRequestCompressionEnabled){ + request_content.append(compress(input->request_body, 7, PFXCompressionType::Gzip)); + } else { + request_content.append(input->request_body); + } } // prepare connection @@ -309,14 +317,19 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) { } else { request.setHeader(QNetworkRequest::ContentTypeHeader, input->headers.value("Content-Type")); } + if(isRequestCompressionEnabled){ + request.setRawHeader("Content-Encoding", "gzip"); + } } else if (input->var_layout == URL_ENCODED) { request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); } else if (input->var_layout == MULTIPART) { request.setHeader(QNetworkRequest::ContentTypeHeader, "multipart/form-data; boundary=" + boundary); } - if(isCompressionEnabled){ - request.setRawHeader("Accept-Encoding", "deflate, gzip"); + if(isResponseCompressionEnabled){ + request.setRawHeader("Accept-Encoding", "gzip"); + } else { + request.setRawHeader("Accept-Encoding", "identity"); } if (input->http_method == "GET") { @@ -398,6 +411,8 @@ void PFXHttpRequestWorker::process_response(QNetworkReply *reply) { auto compressionTypes = encoding.first().split(',', QString::SkipEmptyParts); if(compressionTypes.contains("gzip", Qt::CaseInsensitive) || compressionTypes.contains("deflate", Qt::CaseInsensitive)){ response = decompress(reply->readAll()); + } else if(compressionTypes.contains("identity", Qt::CaseInsensitive)){ + response = reply->readAll(); } } } @@ -409,9 +424,17 @@ void PFXHttpRequestWorker::process_response(QNetworkReply *reply) { } QByteArray PFXHttpRequestWorker::decompress(const QByteArray& data){ - QByteArray result; - bool sts = false; - return sts ? result : QByteArray(); + + Q_UNUSED(data); + return QByteArray(); +} + +QByteArray PFXHttpRequestWorker::compress(const QByteArray& input, int level, PFXCompressionType compressType) { + + Q_UNUSED(input); + Q_UNUSED(level); + Q_UNUSED(compressType); + return QByteArray(); } QSslConfiguration *PFXHttpRequestWorker::sslDefaultConfiguration; diff --git a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h index c7f4c2a7f0b..9f9aeee72fd 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h +++ b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h @@ -71,21 +71,28 @@ public: void setWorkingDirectory(const QString &path); PFXHttpFileElement getHttpFileElement(const QString &fieldname = QString()); QByteArray *getMultiPartField(const QString &fieldname = QString()); - void setCompressionEnabled(bool enable); + void setResponseCompressionEnabled(bool enable); + void setRequestCompressionEnabled(bool enable); signals: void on_execution_finished(PFXHttpRequestWorker *worker); private: + enum PFXCompressionType{ + Zlib, + Gzip + }; QNetworkAccessManager *manager; QMap headers; QMap files; QMap multiPartFields; QString workingDirectory; int _timeOut; - bool isCompressionEnabled; + bool isResponseCompressionEnabled; + bool isRequestCompressionEnabled; void on_manager_timeout(QNetworkReply *reply); void process_response(QNetworkReply *reply); QByteArray decompress(const QByteArray& data); + QByteArray compress(const QByteArray& input, int level, PFXCompressionType compressType); private slots: void on_manager_finished(QNetworkReply *reply); }; diff --git a/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp index 9230379520c..ca1579559c7 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp @@ -23,7 +23,8 @@ PFXPetApi::PFXPetApi(const QString &scheme, const QString &host, int port, const _port(port), _basePath(basePath), _timeOut(timeOut), - _compress(false) {} + isResponseCompressionEnabled(false), + isRequestCompressionEnabled(false) {} PFXPetApi::~PFXPetApi() { } @@ -56,8 +57,12 @@ void PFXPetApi::addHeaders(const QString &key, const QString &value) { defaultHeaders.insert(key, value); } -void PFXPetApi::enableContentCompression() { - _compress = true; +void PFXPetApi::enableRequestCompression() { + isRequestCompressionEnabled = true; +} + +void PFXPetApi::enableResponseCompression() { + isResponseCompressionEnabled = true; } void PFXPetApi::addPet(const PFXPet &body) { @@ -71,7 +76,6 @@ void PFXPetApi::addPet(const PFXPet &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); QString output = body.asJson(); @@ -120,7 +124,6 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const QString &api_key) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "DELETE"); if (api_key != nullptr) { @@ -205,7 +208,6 @@ void PFXPetApi::findPetsByStatus(const QList &status) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -296,7 +298,6 @@ void PFXPetApi::findPetsByTags(const QList &tags) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -352,7 +353,6 @@ void PFXPetApi::getPetById(const qint64 &pet_id) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -396,7 +396,6 @@ void PFXPetApi::updatePet(const PFXPet &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "PUT"); QString output = body.asJson(); @@ -445,7 +444,6 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const QString &name, con PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); input.add_var("name", ::test_namespace::toStringValue(name)); @@ -493,7 +491,6 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const QString &additional_metad PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); input.add_var("additionalMetadata", ::test_namespace::toStringValue(additional_metadata)); diff --git a/samples/client/petstore/cpp-qt5/client/PFXPetApi.h b/samples/client/petstore/cpp-qt5/client/PFXPetApi.h index 7d2c00175c5..9d31bf46d65 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXPetApi.h +++ b/samples/client/petstore/cpp-qt5/client/PFXPetApi.h @@ -37,7 +37,8 @@ public: void setTimeOut(const int timeOut); void setWorkingDirectory(const QString &path); void addHeaders(const QString &key, const QString &value); - void enableContentCompression(); + void enableRequestCompression(); + void enableResponseCompression(); void addPet(const PFXPet &body); void deletePet(const qint64 &pet_id, const QString &api_key); @@ -55,7 +56,8 @@ private: int _timeOut; QString _workingDirectory; QMap defaultHeaders; - bool _compress; + bool isResponseCompressionEnabled; + bool isRequestCompressionEnabled; void addPetCallback(PFXHttpRequestWorker *worker); void deletePetCallback(PFXHttpRequestWorker *worker); diff --git a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp index 05ee1622f0b..b63ec811f70 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp @@ -23,7 +23,8 @@ PFXStoreApi::PFXStoreApi(const QString &scheme, const QString &host, int port, c _port(port), _basePath(basePath), _timeOut(timeOut), - _compress(false) {} + isResponseCompressionEnabled(false), + isRequestCompressionEnabled(false) {} PFXStoreApi::~PFXStoreApi() { } @@ -56,8 +57,12 @@ void PFXStoreApi::addHeaders(const QString &key, const QString &value) { defaultHeaders.insert(key, value); } -void PFXStoreApi::enableContentCompression() { - _compress = true; +void PFXStoreApi::enableRequestCompression() { + isRequestCompressionEnabled = true; +} + +void PFXStoreApi::enableResponseCompression() { + isResponseCompressionEnabled = true; } void PFXStoreApi::deleteOrder(const QString &order_id) { @@ -74,7 +79,6 @@ void PFXStoreApi::deleteOrder(const QString &order_id) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "DELETE"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -117,7 +121,6 @@ void PFXStoreApi::getInventory() { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -173,7 +176,6 @@ void PFXStoreApi::getOrderById(const qint64 &order_id) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -217,7 +219,6 @@ void PFXStoreApi::placeOrder(const PFXOrder &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); QString output = body.asJson(); diff --git a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h index b61fc684b28..c983a15c881 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h +++ b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h @@ -36,7 +36,8 @@ public: void setTimeOut(const int timeOut); void setWorkingDirectory(const QString &path); void addHeaders(const QString &key, const QString &value); - void enableContentCompression(); + void enableRequestCompression(); + void enableResponseCompression(); void deleteOrder(const QString &order_id); void getInventory(); @@ -50,7 +51,8 @@ private: int _timeOut; QString _workingDirectory; QMap defaultHeaders; - bool _compress; + bool isResponseCompressionEnabled; + bool isRequestCompressionEnabled; void deleteOrderCallback(PFXHttpRequestWorker *worker); void getInventoryCallback(PFXHttpRequestWorker *worker); diff --git a/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp index 44d8c2dee1f..f5a440adc3b 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp @@ -23,7 +23,8 @@ PFXUserApi::PFXUserApi(const QString &scheme, const QString &host, int port, con _port(port), _basePath(basePath), _timeOut(timeOut), - _compress(false) {} + isResponseCompressionEnabled(false), + isRequestCompressionEnabled(false) {} PFXUserApi::~PFXUserApi() { } @@ -56,8 +57,12 @@ void PFXUserApi::addHeaders(const QString &key, const QString &value) { defaultHeaders.insert(key, value); } -void PFXUserApi::enableContentCompression() { - _compress = true; +void PFXUserApi::enableRequestCompression() { + isRequestCompressionEnabled = true; +} + +void PFXUserApi::enableResponseCompression() { + isResponseCompressionEnabled = true; } void PFXUserApi::createUser(const PFXUser &body) { @@ -71,7 +76,6 @@ void PFXUserApi::createUser(const PFXUser &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); QString output = body.asJson(); @@ -117,7 +121,6 @@ void PFXUserApi::createUsersWithArrayInput(const QList &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); QJsonDocument doc(::test_namespace::toJsonValue(body).toArray()); @@ -164,7 +167,6 @@ void PFXUserApi::createUsersWithListInput(const QList &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); QJsonDocument doc(::test_namespace::toJsonValue(body).toArray()); @@ -214,7 +216,6 @@ void PFXUserApi::deleteUser(const QString &username) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "DELETE"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -260,7 +261,6 @@ void PFXUserApi::getUserByName(const QString &username) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -316,7 +316,6 @@ void PFXUserApi::loginUser(const QString &username, const QString &password) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -361,7 +360,6 @@ void PFXUserApi::logoutUser() { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -407,7 +405,6 @@ void PFXUserApi::updateUser(const QString &username, const PFXUser &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); - worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "PUT"); QString output = body.asJson(); diff --git a/samples/client/petstore/cpp-qt5/client/PFXUserApi.h b/samples/client/petstore/cpp-qt5/client/PFXUserApi.h index 4ca836a7895..3b3db0279f9 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXUserApi.h +++ b/samples/client/petstore/cpp-qt5/client/PFXUserApi.h @@ -36,7 +36,8 @@ public: void setTimeOut(const int timeOut); void setWorkingDirectory(const QString &path); void addHeaders(const QString &key, const QString &value); - void enableContentCompression(); + void enableRequestCompression(); + void enableResponseCompression(); void createUser(const PFXUser &body); void createUsersWithArrayInput(const QList &body); @@ -54,7 +55,8 @@ private: int _timeOut; QString _workingDirectory; QMap defaultHeaders; - bool _compress; + bool isResponseCompressionEnabled; + bool isRequestCompressionEnabled; void createUserCallback(PFXHttpRequestWorker *worker); void createUsersWithArrayInputCallback(PFXHttpRequestWorker *worker); From 75d5569e92ede1e79df194225f1e872ec2da9b40 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Thu, 23 Jan 2020 17:54:26 -0800 Subject: [PATCH 18/85] [go] Fix multiple go compilation errors and enable go integration test in pom.xml (#5075) * fix go compilation error for properties of type map and array * fix go compilation error for properties of type date and datetime * add missing shell script to bin/utils/ensure-up-to-date * add missing shell script to bin/utils/ensure-up-to-date * add missing shell script to bin/utils/ensure-up-to-date * fix issue with 'date' type * fix time import problem * Add missing pom.xml files for golang * Add missing unit test files for golang * Add missing unit test files for golang. Must use class name prefix for enums * Fix unit tests for go-experimental in OAS3 * Fix unit tests for go-experimental in OAS3 * Add code comments in codegen * Fix compilation errors of generated go code * Fix compilation errors of generated go code * remove antihax from go-experimental, it is no longer used * copy python testfile for ut purpose * add error checkout in unit tests * add unit tests * add code comments * move test foo.png file to correct location * run samples scripts * run samples scripts --- bin/openapi3/go-experimental-petstore.sh | 4 +- bin/openapi3/go-petstore.sh | 4 +- bin/utils/ensure-up-to-date | 1 + .../openapitools/codegen/CodegenModel.java | 8 + .../openapitools/codegen/CodegenProperty.java | 4 +- .../GoClientExperimentalCodegen.java | 18 +- .../codegen/utils/ModelUtils.java | 11 +- .../resources/go-experimental/README.mustache | 1 - .../resources/go-experimental/go.mod.mustache | 1 - .../src/main/resources/go/api.mustache | 16 +- pom.xml | 2 + .../go-experimental/go-petstore/README.md | 1 - .../go-experimental/go-petstore/go.mod | 1 - .../petstore/go-experimental/pet_api_test.go | 10 +- .../client/petstore/go-experimental/pom.xml | 14 - .../go-experimental/testfiles/foo.png | Bin 0 -> 43280 bytes .../go/go-petstore-withXml/api_fake.go | 16 +- .../petstore/go/go-petstore/api_fake.go | 16 +- samples/client/petstore/go/pet_api_test.go | 10 +- samples/client/petstore/go/testfiles/foo.png | Bin 0 -> 43280 bytes .../petstore/go-experimental/auth_test.go | 259 +++++++++++++++ .../petstore/go-experimental/fake_api_test.go | 28 ++ .../go-experimental/go-petstore/README.md | 5 +- .../go-petstore/api_another_fake.go | 2 +- .../go-petstore/api_default.go | 2 +- .../go-experimental/go-petstore/api_fake.go | 34 +- .../go-petstore/api_fake_classname_tags123.go | 2 +- .../go-experimental/go-petstore/api_pet.go | 2 +- .../go-experimental/go-petstore/api_store.go | 2 +- .../go-experimental/go-petstore/api_user.go | 2 +- .../go-experimental/go-petstore/client.go | 2 +- .../go-petstore/configuration.go | 2 +- .../go-petstore/docs/NullableClass.md | 50 +-- .../go-experimental/go-petstore/go.mod | 1 - .../go-petstore/model_200_response.go | 2 +- .../go-petstore/model__special_model_name_.go | 2 +- .../model_additional_properties_class.go | 2 +- .../go-petstore/model_animal.go | 2 +- .../go-petstore/model_api_response.go | 2 +- .../model_array_of_array_of_number_only.go | 2 +- .../go-petstore/model_array_of_number_only.go | 2 +- .../go-petstore/model_array_test_.go | 2 +- .../go-petstore/model_capitalization.go | 2 +- .../go-experimental/go-petstore/model_cat.go | 2 +- .../go-petstore/model_cat_all_of.go | 2 +- .../go-petstore/model_category.go | 2 +- .../go-petstore/model_class_model.go | 2 +- .../go-petstore/model_client.go | 2 +- .../go-experimental/go-petstore/model_dog.go | 2 +- .../go-petstore/model_dog_all_of.go | 2 +- .../go-petstore/model_enum_arrays.go | 2 +- .../go-petstore/model_enum_class.go | 8 +- .../go-petstore/model_enum_test_.go | 2 +- .../go-experimental/go-petstore/model_file.go | 2 +- .../model_file_schema_test_class.go | 2 +- .../go-experimental/go-petstore/model_foo.go | 2 +- .../go-petstore/model_format_test_.go | 2 +- .../go-petstore/model_has_only_read_only.go | 2 +- .../go-petstore/model_health_check_result.go | 2 +- .../go-petstore/model_inline_object.go | 2 +- .../go-petstore/model_inline_object_1.go | 2 +- .../go-petstore/model_inline_object_2.go | 2 +- .../go-petstore/model_inline_object_3.go | 2 +- .../go-petstore/model_inline_object_4.go | 2 +- .../go-petstore/model_inline_object_5.go | 2 +- .../model_inline_response_default.go | 2 +- .../go-experimental/go-petstore/model_list.go | 2 +- .../go-petstore/model_map_test_.go | 2 +- ...perties_and_additional_properties_class.go | 2 +- .../go-experimental/go-petstore/model_name.go | 2 +- .../go-petstore/model_nullable_class.go | 73 +++-- .../go-petstore/model_number_only.go | 2 +- .../go-petstore/model_order.go | 2 +- .../go-petstore/model_outer_composite.go | 2 +- .../go-petstore/model_outer_enum.go | 8 +- .../model_outer_enum_default_value.go | 8 +- .../go-petstore/model_outer_enum_integer.go | 8 +- .../model_outer_enum_integer_default_value.go | 8 +- .../go-experimental/go-petstore/model_pet.go | 2 +- .../go-petstore/model_read_only_first.go | 2 +- .../go-petstore/model_return.go | 2 +- .../go-experimental/go-petstore/model_tag.go | 2 +- .../go-experimental/go-petstore/model_user.go | 2 +- .../go-experimental/go-petstore/response.go | 2 +- .../go-experimental/go-petstore/utils.go | 2 +- .../petstore/go-experimental/pet_api_test.go | 292 +++++++++++++++++ .../client/petstore/go-experimental/pom.xml | 89 +++++ .../go-experimental/store_api_test.go | 37 +++ .../go-experimental/testfiles/foo.png | Bin 0 -> 43280 bytes .../petstore/go-experimental/user_api_test.go | 153 +++++++++ .../openapi3/client/petstore/go/auth_test.go | 254 +++++++++++++++ .../client/petstore/go/fake_api_test.go | 28 ++ .../petstore/go/go-petstore/api_fake.go | 32 +- .../go/go-petstore/model_enum_class.go | 6 +- .../go/go-petstore/model_outer_enum.go | 6 +- .../model_outer_enum_default_value.go | 6 +- .../go-petstore/model_outer_enum_integer.go | 6 +- .../model_outer_enum_integer_default_value.go | 6 +- .../client/petstore/go/pet_api_test.go | 303 ++++++++++++++++++ samples/openapi3/client/petstore/go/pom.xml | 103 ++++++ .../client/petstore/go/store_api_test.go | 37 +++ .../client/petstore/go/testfiles/foo.png | Bin 0 -> 43280 bytes .../client/petstore/go/user_api_test.go | 153 +++++++++ 103 files changed, 2010 insertions(+), 235 deletions(-) create mode 100644 samples/client/petstore/go-experimental/testfiles/foo.png create mode 100644 samples/client/petstore/go/testfiles/foo.png create mode 100644 samples/openapi3/client/petstore/go-experimental/auth_test.go create mode 100644 samples/openapi3/client/petstore/go-experimental/fake_api_test.go create mode 100644 samples/openapi3/client/petstore/go-experimental/pet_api_test.go create mode 100644 samples/openapi3/client/petstore/go-experimental/pom.xml create mode 100644 samples/openapi3/client/petstore/go-experimental/store_api_test.go create mode 100644 samples/openapi3/client/petstore/go-experimental/testfiles/foo.png create mode 100644 samples/openapi3/client/petstore/go-experimental/user_api_test.go create mode 100644 samples/openapi3/client/petstore/go/auth_test.go create mode 100644 samples/openapi3/client/petstore/go/fake_api_test.go create mode 100644 samples/openapi3/client/petstore/go/pet_api_test.go create mode 100644 samples/openapi3/client/petstore/go/pom.xml create mode 100644 samples/openapi3/client/petstore/go/store_api_test.go create mode 100644 samples/openapi3/client/petstore/go/testfiles/foo.png create mode 100644 samples/openapi3/client/petstore/go/user_api_test.go diff --git a/bin/openapi3/go-experimental-petstore.sh b/bin/openapi3/go-experimental-petstore.sh index db24ff5d6c8..46c7841a280 100755 --- a/bin/openapi3/go-experimental-petstore.sh +++ b/bin/openapi3/go-experimental-petstore.sh @@ -34,6 +34,8 @@ rm -rf $STUB_DIR # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/$GENERATOR -i $SPEC -g $GENERATOR -o $STUB_DIR -DpackageName=petstore $@" +ags="generate -t modules/openapi-generator/src/main/resources/$GENERATOR -i $SPEC -g $GENERATOR -o $STUB_DIR" +ags="$ags --additional-properties enumClassPrefix=true,packageName=petstore" +ags="$ags $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/go-petstore.sh b/bin/openapi3/go-petstore.sh index ad921deae9c..f67ecfbbb6d 100755 --- a/bin/openapi3/go-petstore.sh +++ b/bin/openapi3/go-petstore.sh @@ -34,6 +34,8 @@ rm -rf $STUB_DIR # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/go -i $SPEC -g $GENERATOR -o $STUB_DIR --additional-properties packageName=petstore $@" +ags="generate -t modules/openapi-generator/src/main/resources/go -i $SPEC -g $GENERATOR -o $STUB_DIR" +ags="$ags --additional-properties enumClassPrefix=true,packageName=petstore" +ags="$ags $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/utils/ensure-up-to-date b/bin/utils/ensure-up-to-date index 4bb9ee79b4f..b2a8c19ab4a 100755 --- a/bin/utils/ensure-up-to-date +++ b/bin/utils/ensure-up-to-date @@ -66,6 +66,7 @@ declare -a samples=( "${root}/bin/csharp-netcore-petstore-all.sh" "${root}/bin/elixir-petstore.sh" "${root}/bin/openapi3/go-petstore.sh" +"${root}/bin/openapi3/go-experimental-petstore.sh" "${root}/bin/go-experimental-petstore.sh" "${root}/bin/go-petstore.sh" "${root}/bin/go-petstore-withxml.sh" 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 37a1230f98c..36557914bb1 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 @@ -24,8 +24,16 @@ import java.util.*; @JsonIgnoreProperties({"parentModel", "interfaceModels"}) public class CodegenModel implements IJsonSchemaValidationProperties { + // The parent model name from the schemas. The parent is determined by inspecting the allOf, anyOf and + // oneOf attributes in the OAS. First codegen inspects 'allOf', then 'anyOf', then 'oneOf'. + // If there are multiple object references in the attribute ('allOf', 'anyOf', 'oneOf'), and one of the + // object is a discriminator, that object is set as the parent. If no discriminator is specified, + // codegen returns the first one in the list, i.e. there is no obvious parent in the OpenAPI specification. + // When possible, the mustache templates should use 'allParents' to handle multiple parents. public String parent, parentSchema; public List interfaces; + // The list of parent model name from the schemas. In order of preference, the parent is obtained + // from the 'allOf' attribute, then 'anyOf', and finally 'oneOf'. public List allParents; // References to parent and interface CodegenModels. Only set when code generator supports inheritance. 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 da32ae09c53..d2f0a5ee3b1 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 @@ -70,8 +70,8 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti public boolean isBinary; public boolean isFile; public boolean isBoolean; - public boolean isDate; - public boolean isDateTime; + public boolean isDate; // full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21 + public boolean isDateTime; // the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z public boolean isUuid; public boolean isUri; public boolean isEmail; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java index 29e7f558602..5edabbefbd1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java @@ -71,7 +71,6 @@ public class GoClientExperimentalCodegen extends GoClientCodegen { @Override public Map postProcessModels(Map objs) { - objs = super.postProcessModels(objs); List> models = (List>) objs.get("models"); for (Map m : models) { @@ -83,16 +82,27 @@ public class GoClientExperimentalCodegen extends GoClientCodegen { } for (CodegenProperty param : model.vars) { - if (!param.isNullable) { + if (!param.isNullable || param.isMapContainer || param.isListContainer) { continue; } - - param.dataType = "Nullable" + Character.toUpperCase(param.dataType.charAt(0)) + if (param.isDateTime) { + // Note this could have been done by adding the following line in processOpts(), + // however, we only want to represent the DateTime object as NullableTime if + // it's marked as nullable in the spec. + // typeMapping.put("DateTime", "NullableTime"); + param.dataType = "NullableTime"; + } else { + param.dataType = "Nullable" + Character.toUpperCase(param.dataType.charAt(0)) + param.dataType.substring(1); + } } } } + // The superclass determines the list of required golang imports. The actual list of imports + // depends on which types are used, which is done in the code above. So super.postProcessModels + // must be invoked at the end of this method. + objs = super.postProcessModels(objs); return objs; } } 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 08c878b21c6..cf2ca082caa 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 @@ -921,7 +921,8 @@ public class ModelUtils { } /** - * Get the the parent model name from the schemas (allOf, anyOf, oneOf) + * Get the parent model name from the schemas (allOf, anyOf, oneOf). + * If there are multiple parents, return the first one. * * @param composedSchema schema (alias or direct reference) * @param allSchemas all schemas @@ -965,6 +966,14 @@ public class ModelUtils { return null; } + /** + * Get the list of parent model names from the schemas (allOf, anyOf, oneOf). + * + * @param composedSchema schema (alias or direct reference) + * @param allSchemas all schemas + * @param includeAncestors if true, include the indirect ancestors in the return value. If false, return the direct parents. + * @return the name of the parent model + */ public static List getAllParentsName(ComposedSchema composedSchema, Map allSchemas, boolean includeAncestors) { List interfaces = getInterfaces(composedSchema); List names = new ArrayList(); diff --git a/modules/openapi-generator/src/main/resources/go-experimental/README.mustache b/modules/openapi-generator/src/main/resources/go-experimental/README.mustache index cdb72d59099..777abc5d06e 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/README.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/README.mustache @@ -25,7 +25,6 @@ Install the following dependencies: go get github.com/stretchr/testify/assert go get golang.org/x/oauth2 go get golang.org/x/net/context -go get github.com/antihax/optional ``` Put the package under your project folder and add the following in import: diff --git a/modules/openapi-generator/src/main/resources/go-experimental/go.mod.mustache b/modules/openapi-generator/src/main/resources/go-experimental/go.mod.mustache index d7aeada7577..3b7d202ac4f 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/go.mod.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/go.mod.mustache @@ -3,6 +3,5 @@ module {{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}} go 1.13 require ( - github.com/antihax/optional v1.0.0 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 ) diff --git a/modules/openapi-generator/src/main/resources/go/api.mustache b/modules/openapi-generator/src/main/resources/go/api.mustache index 503e3fcac4c..a59dfd8a46e 100644 --- a/modules/openapi-generator/src/main/resources/go/api.mustache +++ b/modules/openapi-generator/src/main/resources/go/api.mustache @@ -135,14 +135,16 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams {{#queryParams}} {{#required}} {{#isCollectionFormatMulti}} - t:={{paramName}} - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + { + t:={{paramName}} + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + } + } else { + localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) } - } else { - localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) } {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} diff --git a/pom.xml b/pom.xml index 5f3b845c7ce..c4fb85ca131 100644 --- a/pom.xml +++ b/pom.xml @@ -1087,6 +1087,8 @@ samples/client/petstore/go samples/client/petstore/go-experimental + samples/openapi3/client/petstore/go-experimental + samples/openapi3/client/petstore/go samples/client/petstore/scala-httpclient diff --git a/samples/client/petstore/go-experimental/go-petstore/README.md b/samples/client/petstore/go-experimental/go-petstore/README.md index 9ce303bc885..ad2c0aa80de 100644 --- a/samples/client/petstore/go-experimental/go-petstore/README.md +++ b/samples/client/petstore/go-experimental/go-petstore/README.md @@ -17,7 +17,6 @@ Install the following dependencies: go get github.com/stretchr/testify/assert go get golang.org/x/oauth2 go get golang.org/x/net/context -go get github.com/antihax/optional ``` Put the package under your project folder and add the following in import: diff --git a/samples/client/petstore/go-experimental/go-petstore/go.mod b/samples/client/petstore/go-experimental/go-petstore/go.mod index b80383b722c..f9811556cc5 100644 --- a/samples/client/petstore/go-experimental/go-petstore/go.mod +++ b/samples/client/petstore/go-experimental/go-petstore/go.mod @@ -3,6 +3,5 @@ module github.com/GIT_USER_ID/GIT_REPO_ID go 1.13 require ( - github.com/antihax/optional v1.0.0 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 ) diff --git a/samples/client/petstore/go-experimental/pet_api_test.go b/samples/client/petstore/go-experimental/pet_api_test.go index 6cc33a62e1c..57afd2923c5 100644 --- a/samples/client/petstore/go-experimental/pet_api_test.go +++ b/samples/client/petstore/go-experimental/pet_api_test.go @@ -139,7 +139,10 @@ func TestFindPetsByStatus(t *testing.T) { } func TestUploadFile(t *testing.T) { - file, _ := os.Open("../python/testfiles/foo.png") + file, err1 := os.Open("testfiles/foo.png") + if err1 != nil { + t.Fatalf("Error opening file: %v", err1) + } _, r, err := client.PetApi.UploadFile(context.Background(), 12830).AdditionalMetadata("golang").File(file).Execute() @@ -154,7 +157,10 @@ func TestUploadFile(t *testing.T) { func TestUploadFileRequired(t *testing.T) { return // remove when server supports this endpoint - file, _ := os.Open("../python/testfiles/foo.png") + file, err1 := os.Open("testfiles/foo.png") + if err1 != nil { + t.Fatalf("Error opening file: %v", err1) + } _, r, err := client.PetApi.UploadFileWithRequiredFile(context.Background(), 12830).RequiredFile(file).AdditionalMetadata("golang").Execute() diff --git a/samples/client/petstore/go-experimental/pom.xml b/samples/client/petstore/go-experimental/pom.xml index 91e3da8c34b..9c62bbb9554 100644 --- a/samples/client/petstore/go-experimental/pom.xml +++ b/samples/client/petstore/go-experimental/pom.xml @@ -68,20 +68,6 @@ - - go-get-optional - pre-integration-test - - exec - - - go - - get - github.com/antihax/optional - - - go-test integration-test diff --git a/samples/client/petstore/go-experimental/testfiles/foo.png b/samples/client/petstore/go-experimental/testfiles/foo.png new file mode 100644 index 0000000000000000000000000000000000000000..a9b12cf5927ac757b054dd875ee137c2581f69bb GIT binary patch literal 43280 zcmV*%KsdjNP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+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yc@ literal 0 HcmV?d00001 diff --git a/samples/client/petstore/go/go-petstore-withXml/api_fake.go b/samples/client/petstore/go/go-petstore-withXml/api_fake.go index 264c49951e3..bad36447bd8 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake.go @@ -1217,14 +1217,16 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) localVarQueryParams.Add("http", parameterToString(http, "space")) localVarQueryParams.Add("url", parameterToString(url, "csv")) - t:=context - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + { + t:=context + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("context", parameterToString(t, "multi")) } - } else { - localVarQueryParams.Add("context", parameterToString(t, "multi")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index 9c23b7d5023..61f9d2ed9ec 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -1216,14 +1216,16 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) localVarQueryParams.Add("http", parameterToString(http, "space")) localVarQueryParams.Add("url", parameterToString(url, "csv")) - t:=context - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + { + t:=context + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("context", parameterToString(t, "multi")) } - } else { - localVarQueryParams.Add("context", parameterToString(t, "multi")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/samples/client/petstore/go/pet_api_test.go b/samples/client/petstore/go/pet_api_test.go index 969fab1f667..cda4f457855 100644 --- a/samples/client/petstore/go/pet_api_test.go +++ b/samples/client/petstore/go/pet_api_test.go @@ -142,7 +142,10 @@ func TestFindPetsByStatus(t *testing.T) { } func TestUploadFile(t *testing.T) { - file, _ := os.Open("../python/testfiles/foo.png") + file, err1 := os.Open("testfiles/foo.png") + if err1 != nil { + t.Fatalf("Error opening file: %v", err1) + } _, r, err := client.PetApi.UploadFile(context.Background(), 12830, &sw.UploadFileOpts{ AdditionalMetadata: optional.NewString("golang"), @@ -160,7 +163,10 @@ func TestUploadFile(t *testing.T) { func TestUploadFileRequired(t *testing.T) { return // remove when server supports this endpoint - file, _ := os.Open("../python/testfiles/foo.png") + file, err1 := os.Open("testfiles/foo.png") + if err1 != nil { + t.Fatalf("Error opening file: %v", err1) + } _, r, err := client.PetApi.UploadFileWithRequiredFile(context.Background(), 12830, file, diff --git a/samples/client/petstore/go/testfiles/foo.png b/samples/client/petstore/go/testfiles/foo.png new file mode 100644 index 0000000000000000000000000000000000000000..a9b12cf5927ac757b054dd875ee137c2581f69bb GIT binary patch literal 43280 zcmV*%KsdjNP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7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GWrRMS8mnU^n`$K=wx=C798(tmfFFzAvK8 zhOJ1?+GX=Ao^F=jD=HlEE-EMTH1-nPHfQiBkN?|f*s+>eW=t$5X;zzR6r?0~w_y|k z5fZ6X_`QGz%yI3+e~kj+mR=C_wj#-SHU0H#^yyac@#!0d-`Dda?LOVN`?&Jc(K@Ll z53t^sUYW3e*{&}uba^bY89i<5NmcEPpbgi&FNuAGD)PFbW}@geffM7v#0~^t+lN+~ zRnoUyE14Pqw9y2PNgc~(zSEoBjuoK~V}@!V6bi?5&*A61GP4}6}Ppa2}EMMZ(pSS5#2i*)da_r30C@K3p+&Zw6I5gU;Eerkae@ka< z@<*zS4yt+s)l>K!d`?Mf{a-pu_kO14)(KF%^aGCGOL71yG+~sCkr`smRV8nej$*cT zxB{*5ND?i^*}#~gB6db7m3vU!*sqE^Y?ml z54}mLC`NkNkS-#iD~3$^^ZVB}*qbkf|LdDD>%X&B=S~IRj)DCD^7pkU%y-K1#46xw z#FJM(HZ_ifVxD0mzn!i($$;1Qjq_sdqCDf2?ACOItnm=|AFwt{ZY_hiF*{@k{Ez^@ zfPiOR(KAE6LOoqw!KWI|xGa1Q;=KWI}Wu0j*|X@)o?TT7{nJ?dH$ zbJeTrO^X!6 ze*pUgcp=V|mF1P4$JtYAVob0VVH_wZtFGqi>+kPx;CZ5#```cR)&0S~e|O+J)Ry(B z#yvjvseD=E_;hrHKS4MA>b=67hd4AMA|geeo4q#y5XoOBZ3=E%{lV&hj(=P5^y%Xb z0ppO{8X*RYZ(+%!qO4`Rs^GA4mvR5G#=`V9pDsRjPErznDCpL55{ZIv#L$t_=3=x$ mA0V|)``=#uC)qLnml?uml0Z=v_!9*IU+OB_j~X9ZMg0%bqvyc@ literal 0 HcmV?d00001 diff --git a/samples/openapi3/client/petstore/go-experimental/auth_test.go b/samples/openapi3/client/petstore/go-experimental/auth_test.go new file mode 100644 index 00000000000..aec544c2f26 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/auth_test.go @@ -0,0 +1,259 @@ +package main + +import ( + "context" + "net/http" + "net/http/httputil" + "strings" + "testing" + "time" + + "golang.org/x/oauth2" + + sw "./go-petstore" +) + +func TestOAuth2(t *testing.T) { + // Setup some fake oauth2 configuration + cfg := &oauth2.Config{ + ClientID: "1234567", + ClientSecret: "SuperSecret", + Endpoint: oauth2.Endpoint{ + AuthURL: "https://devnull", + TokenURL: "https://devnull", + }, + RedirectURL: "https://devnull", + } + + // and a fake token + tok := oauth2.Token{ + AccessToken: "FAKE", + RefreshToken: "So Fake", + Expiry: time.Now().Add(time.Hour * 100000), + TokenType: "Bearer", + } + + // then a fake tokenSource + tokenSource := cfg.TokenSource(createContext(nil), &tok) + auth := context.WithValue(context.Background(), sw.ContextOAuth2, tokenSource) + + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + + r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + r, err = client.PetApi.DeletePet(auth, 12992).Execute() + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + reqb, _ := httputil.DumpRequest(r.Request, true) + + if !strings.Contains((string)(reqb), "Authorization: Bearer FAKE") { + t.Errorf("OAuth2 Authentication is missing") + } +} + +func TestBasicAuth(t *testing.T) { + + auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "fakeUser", + Password: "f4k3p455", + }) + + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + + r, err := client.PetApi.AddPet(auth).Pet(newPet).Execute() + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + r, err = client.PetApi.DeletePet(auth, 12992).Execute() + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Authorization: Basic ZmFrZVVzZXI6ZjRrM3A0NTU") { + t.Errorf("Basic Authentication is missing") + } +} + +func TestAccessToken(t *testing.T) { + auth := context.WithValue(context.Background(), sw.ContextAccessToken, "TESTFAKEACCESSTOKENISFAKE") + + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + + r, err := client.PetApi.AddPet(nil).Pet(newPet).Execute() + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + r, err = client.PetApi.DeletePet(auth, 12992).Execute() + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Authorization: Bearer TESTFAKEACCESSTOKENISFAKE") { + t.Errorf("AccessToken Authentication is missing") + } +} + +func TestAPIKeyNoPrefix(t *testing.T) { + auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": sw.APIKey{Key: "TEST123"}}) + + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + + r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + _, r, err = client.PetApi.GetPetById(auth, 12992).Execute() + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Api_key: TEST123") { + t.Errorf("APIKey Authentication is missing") + } + + r, err = client.PetApi.DeletePet(auth, 12992).Execute() + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestAPIKeyWithPrefix(t *testing.T) { + auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": sw.APIKey{Key: "TEST123", Prefix: "Bearer"}}) + + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + + r, err := client.PetApi.AddPet(nil).Pet(newPet).Execute() + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + _, r, err = client.PetApi.GetPetById(auth, 12992).Execute() + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Api_key: Bearer TEST123") { + t.Errorf("APIKey Authentication is missing") + } + + r, err = client.PetApi.DeletePet(auth, 12992).Execute() + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestDefaultHeader(t *testing.T) { + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + + r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + r, err = client.PetApi.DeletePet(context.Background(), 12992).Execute() + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Testheader: testvalue") { + t.Errorf("Default Header is missing") + } +} + +func TestHostOverride(t *testing.T) { + _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() + + if err != nil { + t.Fatalf("Error while finding pets by status: %v", err) + } + + if r.Request.URL.Host != testHost { + t.Errorf("Request Host is %v, expected %v", r.Request.Host, testHost) + } +} + +func TestSchemeOverride(t *testing.T) { + _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() + + if err != nil { + t.Fatalf("Error while finding pets by status: %v", err) + } + + if r.Request.URL.Scheme != testScheme { + t.Errorf("Request Scheme is %v, expected %v", r.Request.URL.Scheme, testScheme) + } +} + +// Add custom clients to the context. +func createContext(httpClient *http.Client) context.Context { + parent := oauth2.NoContext + ctx := context.WithValue(parent, oauth2.HTTPClient, httpClient) + return ctx +} diff --git a/samples/openapi3/client/petstore/go-experimental/fake_api_test.go b/samples/openapi3/client/petstore/go-experimental/fake_api_test.go new file mode 100644 index 00000000000..97910bf3cf7 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/fake_api_test.go @@ -0,0 +1,28 @@ +package main + +import ( + "context" + "testing" + + sw "./go-petstore" +) + +// TestPutBodyWithFileSchema ensures a model with the name 'File' +// gets converted properly to the petstore.File struct vs. *os.File +// as specified in typeMapping for 'File'. +func TestPutBodyWithFileSchema(t *testing.T) { + return // early return to test compilation + + schema := sw.FileSchemaTestClass{ + File: &sw.File{SourceURI: sw.PtrString("https://example.com/image.png")}, + Files: &[]sw.File{{SourceURI: sw.PtrString("https://example.com/image.png")}}} + + r, err := client.FakeApi.TestBodyWithFileSchema(context.Background()).FileSchemaTestClass(schema).Execute() + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md index d030bad9835..9c0050a2352 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md @@ -1,4 +1,4 @@ -# Go API client for openapi +# Go API client for petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ @@ -17,13 +17,12 @@ Install the following dependencies: go get github.com/stretchr/testify/assert go get golang.org/x/oauth2 go get golang.org/x/net/context -go get github.com/antihax/optional ``` Put the package under your project folder and add the following in import: ```golang -import sw "./openapi" +import sw "./petstore" ``` ## Configuration of Server URL diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go index 16dc072e967..c9d4a11585e 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( _context "context" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go index 6fce4e6b2eb..68147dc1782 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( _context "context" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go index 11699dfe9af..a0fd91dcc8d 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( _context "context" @@ -1767,26 +1767,30 @@ func (r apiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Respo return nil, reportError("context is required and must be specified") } - t := *r.pipe - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("pipe", parameterToString(s.Index(i), "multi")) + { + t := *r.pipe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("pipe", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("pipe", parameterToString(t, "multi")) } - } else { - localVarQueryParams.Add("pipe", parameterToString(t, "multi")) } localVarQueryParams.Add("ioutil", parameterToString(*r.ioutil, "csv")) localVarQueryParams.Add("http", parameterToString(*r.http, "space")) localVarQueryParams.Add("url", parameterToString(*r.url, "csv")) - t := *r.context - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + { + t := *r.context + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("context", parameterToString(t, "multi")) } - } else { - localVarQueryParams.Add("context", parameterToString(t, "multi")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go index d305d41b1e4..aa8378a85e4 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( _context "context" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go index d3043440519..664c9f0df4c 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( _context "context" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go index 3e82fd51a70..3b29aa69730 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( _context "context" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go index 318759017aa..e877bf7d265 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( _context "context" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/client.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/client.go index 6b2ddc386d5..01ee73b79ec 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/client.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/client.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/configuration.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/configuration.go index 58f47a49687..a6bbfbeff96 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/configuration.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/configuration.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "context" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NullableClass.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NullableClass.md index 5b8efc3fd89..0aed469d7c7 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NullableClass.md +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NullableClass.md @@ -9,12 +9,12 @@ Name | Type | Description | Notes **BooleanProp** | Pointer to **NullableBool** | | [optional] **StringProp** | Pointer to **NullableString** | | [optional] **DateProp** | Pointer to **NullableString** | | [optional] -**DatetimeProp** | Pointer to [**NullableTime.Time**](time.Time.md) | | [optional] -**ArrayNullableProp** | Pointer to [**Nullable[]map[string]interface{}**](map[string]interface{}.md) | | [optional] -**ArrayAndItemsNullableProp** | Pointer to [**Nullable[]map[string]interface{}**](map[string]interface{}.md) | | [optional] +**DatetimeProp** | Pointer to [**NullableTime**](time.Time.md) | | [optional] +**ArrayNullableProp** | Pointer to [**[]map[string]interface{}**](map[string]interface{}.md) | | [optional] +**ArrayAndItemsNullableProp** | Pointer to [**[]map[string]interface{}**](map[string]interface{}.md) | | [optional] **ArrayItemsNullable** | Pointer to [**[]map[string]interface{}**](map[string]interface{}.md) | | [optional] -**ObjectNullableProp** | Pointer to [**NullableMap[string]map[string]interface{}**](map[string]interface{}.md) | | [optional] -**ObjectAndItemsNullableProp** | Pointer to [**NullableMap[string]map[string]interface{}**](map[string]interface{}.md) | | [optional] +**ObjectNullableProp** | Pointer to [**map[string]map[string]interface{}**](map[string]interface{}.md) | | [optional] +**ObjectAndItemsNullableProp** | Pointer to [**map[string]map[string]interface{}**](map[string]interface{}.md) | | [optional] **ObjectItemsNullable** | Pointer to [**map[string]map[string]interface{}**](map[string]interface{}.md) | | [optional] ## Methods @@ -181,13 +181,13 @@ when serializing to JSON (pass true as argument to set this, false to unset) The DateProp value is set to nil even if false is passed ### GetDatetimeProp -`func (o *NullableClass) GetDatetimeProp() NullableTime.Time` +`func (o *NullableClass) GetDatetimeProp() NullableTime` GetDatetimeProp returns the DatetimeProp field if non-nil, zero value otherwise. ### GetDatetimePropOk -`func (o *NullableClass) GetDatetimePropOk() (NullableTime.Time, bool)` +`func (o *NullableClass) GetDatetimePropOk() (NullableTime, bool)` GetDatetimePropOk returns a tuple with the DatetimeProp field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. @@ -200,9 +200,9 @@ HasDatetimeProp returns a boolean if a field has been set. ### SetDatetimeProp -`func (o *NullableClass) SetDatetimeProp(v NullableTime.Time)` +`func (o *NullableClass) SetDatetimeProp(v NullableTime)` -SetDatetimeProp gets a reference to the given NullableTime.Time and assigns it to the DatetimeProp field. +SetDatetimeProp gets a reference to the given NullableTime and assigns it to the DatetimeProp field. ### SetDatetimePropExplicitNull @@ -213,13 +213,13 @@ when serializing to JSON (pass true as argument to set this, false to unset) The DatetimeProp value is set to nil even if false is passed ### GetArrayNullableProp -`func (o *NullableClass) GetArrayNullableProp() Nullable[]map[string]interface{}` +`func (o *NullableClass) GetArrayNullableProp() []map[string]interface{}` GetArrayNullableProp returns the ArrayNullableProp field if non-nil, zero value otherwise. ### GetArrayNullablePropOk -`func (o *NullableClass) GetArrayNullablePropOk() (Nullable[]map[string]interface{}, bool)` +`func (o *NullableClass) GetArrayNullablePropOk() ([]map[string]interface{}, bool)` GetArrayNullablePropOk returns a tuple with the ArrayNullableProp field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. @@ -232,9 +232,9 @@ HasArrayNullableProp returns a boolean if a field has been set. ### SetArrayNullableProp -`func (o *NullableClass) SetArrayNullableProp(v Nullable[]map[string]interface{})` +`func (o *NullableClass) SetArrayNullableProp(v []map[string]interface{})` -SetArrayNullableProp gets a reference to the given Nullable[]map[string]interface{} and assigns it to the ArrayNullableProp field. +SetArrayNullableProp gets a reference to the given []map[string]interface{} and assigns it to the ArrayNullableProp field. ### SetArrayNullablePropExplicitNull @@ -245,13 +245,13 @@ when serializing to JSON (pass true as argument to set this, false to unset) The ArrayNullableProp value is set to nil even if false is passed ### GetArrayAndItemsNullableProp -`func (o *NullableClass) GetArrayAndItemsNullableProp() Nullable[]map[string]interface{}` +`func (o *NullableClass) GetArrayAndItemsNullableProp() []map[string]interface{}` GetArrayAndItemsNullableProp returns the ArrayAndItemsNullableProp field if non-nil, zero value otherwise. ### GetArrayAndItemsNullablePropOk -`func (o *NullableClass) GetArrayAndItemsNullablePropOk() (Nullable[]map[string]interface{}, bool)` +`func (o *NullableClass) GetArrayAndItemsNullablePropOk() ([]map[string]interface{}, bool)` GetArrayAndItemsNullablePropOk returns a tuple with the ArrayAndItemsNullableProp field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. @@ -264,9 +264,9 @@ HasArrayAndItemsNullableProp returns a boolean if a field has been set. ### SetArrayAndItemsNullableProp -`func (o *NullableClass) SetArrayAndItemsNullableProp(v Nullable[]map[string]interface{})` +`func (o *NullableClass) SetArrayAndItemsNullableProp(v []map[string]interface{})` -SetArrayAndItemsNullableProp gets a reference to the given Nullable[]map[string]interface{} and assigns it to the ArrayAndItemsNullableProp field. +SetArrayAndItemsNullableProp gets a reference to the given []map[string]interface{} and assigns it to the ArrayAndItemsNullableProp field. ### SetArrayAndItemsNullablePropExplicitNull @@ -302,13 +302,13 @@ SetArrayItemsNullable gets a reference to the given []map[string]interface{} and ### GetObjectNullableProp -`func (o *NullableClass) GetObjectNullableProp() NullableMap[string]map[string]interface{}` +`func (o *NullableClass) GetObjectNullableProp() map[string]map[string]interface{}` GetObjectNullableProp returns the ObjectNullableProp field if non-nil, zero value otherwise. ### GetObjectNullablePropOk -`func (o *NullableClass) GetObjectNullablePropOk() (NullableMap[string]map[string]interface{}, bool)` +`func (o *NullableClass) GetObjectNullablePropOk() (map[string]map[string]interface{}, bool)` GetObjectNullablePropOk returns a tuple with the ObjectNullableProp field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. @@ -321,9 +321,9 @@ HasObjectNullableProp returns a boolean if a field has been set. ### SetObjectNullableProp -`func (o *NullableClass) SetObjectNullableProp(v NullableMap[string]map[string]interface{})` +`func (o *NullableClass) SetObjectNullableProp(v map[string]map[string]interface{})` -SetObjectNullableProp gets a reference to the given NullableMap[string]map[string]interface{} and assigns it to the ObjectNullableProp field. +SetObjectNullableProp gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectNullableProp field. ### SetObjectNullablePropExplicitNull @@ -334,13 +334,13 @@ when serializing to JSON (pass true as argument to set this, false to unset) The ObjectNullableProp value is set to nil even if false is passed ### GetObjectAndItemsNullableProp -`func (o *NullableClass) GetObjectAndItemsNullableProp() NullableMap[string]map[string]interface{}` +`func (o *NullableClass) GetObjectAndItemsNullableProp() map[string]map[string]interface{}` GetObjectAndItemsNullableProp returns the ObjectAndItemsNullableProp field if non-nil, zero value otherwise. ### GetObjectAndItemsNullablePropOk -`func (o *NullableClass) GetObjectAndItemsNullablePropOk() (NullableMap[string]map[string]interface{}, bool)` +`func (o *NullableClass) GetObjectAndItemsNullablePropOk() (map[string]map[string]interface{}, bool)` GetObjectAndItemsNullablePropOk returns a tuple with the ObjectAndItemsNullableProp field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. @@ -353,9 +353,9 @@ HasObjectAndItemsNullableProp returns a boolean if a field has been set. ### SetObjectAndItemsNullableProp -`func (o *NullableClass) SetObjectAndItemsNullableProp(v NullableMap[string]map[string]interface{})` +`func (o *NullableClass) SetObjectAndItemsNullableProp(v map[string]map[string]interface{})` -SetObjectAndItemsNullableProp gets a reference to the given NullableMap[string]map[string]interface{} and assigns it to the ObjectAndItemsNullableProp field. +SetObjectAndItemsNullableProp gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectAndItemsNullableProp field. ### SetObjectAndItemsNullablePropExplicitNull diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/go.mod b/samples/openapi3/client/petstore/go-experimental/go-petstore/go.mod index b80383b722c..f9811556cc5 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/go.mod +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/go.mod @@ -3,6 +3,5 @@ module github.com/GIT_USER_ID/GIT_REPO_ID go 1.13 require ( - github.com/antihax/optional v1.0.0 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 ) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_200_response.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_200_response.go index f746eb97c50..b4e9becc59c 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_200_response.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_200_response.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model__special_model_name_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model__special_model_name_.go index a327da2f86f..e1827cee896 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model__special_model_name_.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model__special_model_name_.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go index 2448275032b..d224074b290 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_animal.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_animal.go index bec70d7337a..b54f59dbe61 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_animal.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_animal.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_api_response.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_api_response.go index 94b4983c8b3..0b9eab9f759 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_api_response.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_api_response.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go index 02cbaaae246..f2dbbb1f21e 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go index dca9e7022ab..9268a2ae608 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_test_.go index b4566967aaf..84123ef137b 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_test_.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_test_.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_capitalization.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_capitalization.go index a4489cc259c..8288d903b7b 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_capitalization.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_capitalization.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go index 952bf040204..a9f83cc8c40 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat_all_of.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat_all_of.go index 53da305ec11..60ba5b0259f 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat_all_of.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat_all_of.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_category.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_category.go index f942863971d..0bf8c0a2fd2 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_category.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_category.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_class_model.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_class_model.go index 9ac228a5eba..1621fc4acbd 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_class_model.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_class_model.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_client.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_client.go index 5d959e49a77..45f3fce18b4 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_client.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_client.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go index 9cf3882d97c..eb2d7f05d41 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog_all_of.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog_all_of.go index 19e81717139..c88dfaca2e0 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog_all_of.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog_all_of.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_arrays.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_arrays.go index 104d4a22b39..181a9287220 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_arrays.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_arrays.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go index 4f97b16b8ef..826172fc39b 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" @@ -19,9 +19,9 @@ type EnumClass string // List of EnumClass const ( - ABC EnumClass = "_abc" - EFG EnumClass = "-efg" - XYZ EnumClass = "(xyz)" + ENUMCLASS_ABC EnumClass = "_abc" + ENUMCLASS_EFG EnumClass = "-efg" + ENUMCLASS_XYZ EnumClass = "(xyz)" ) type NullableEnumClass struct { diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go index 426a4bfe988..e17990e0e8a 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file.go index 72ba963d094..23da628abcc 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go index 6520daf2599..50145af1223 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_foo.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_foo.go index 7aed18852c6..4d62649a7fc 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_foo.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_foo.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_format_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_format_test_.go index 55d40bd04b7..9bf313a01f6 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_format_test_.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_format_test_.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go index ba4d6b6bc0f..5394aa4007d 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_health_check_result.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_health_check_result.go index d6b450bb910..ad87c93a74c 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_health_check_result.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_health_check_result.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object.go index 05152802669..c789be40281 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_1.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_1.go index b718912b270..f4ad400f832 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_1.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_1.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_2.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_2.go index fe7e129e3f5..2734be44f5d 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_2.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_2.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_3.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_3.go index e840bc4d75c..dece4ad604b 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_3.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_3.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_4.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_4.go index 8a17ec87e22..837e8f423bf 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_4.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_4.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_5.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_5.go index 8f4553ae280..6673d413276 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_5.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_5.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_response_default.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_response_default.go index 9caab8b3791..3d8d72130c5 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_response_default.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_response_default.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_list.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_list.go index 18ef3c182ad..6259d7507a3 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_list.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_list.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_map_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_map_test_.go index f4e3ea57c90..820f2641347 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_map_test_.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_map_test_.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go index 1a0d83380c7..c4a7dba8182 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_name.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_name.go index 6256aa5c2b3..2f3716aad24 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_name.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_name.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_nullable_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_nullable_class.go index 74d39932b11..2a51bd6a123 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_nullable_class.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_nullable_class.go @@ -7,12 +7,11 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" "encoding/json" - "time" ) // NullableClass struct for NullableClass @@ -22,12 +21,12 @@ type NullableClass struct { BooleanProp *NullableBool `json:"boolean_prop,omitempty"` StringProp *NullableString `json:"string_prop,omitempty"` DateProp *NullableString `json:"date_prop,omitempty"` - DatetimeProp *NullableTime.Time `json:"datetime_prop,omitempty"` - ArrayNullableProp *Nullable[]map[string]interface{} `json:"array_nullable_prop,omitempty"` - ArrayAndItemsNullableProp *Nullable[]map[string]interface{} `json:"array_and_items_nullable_prop,omitempty"` + DatetimeProp *NullableTime `json:"datetime_prop,omitempty"` + ArrayNullableProp *[]map[string]interface{} `json:"array_nullable_prop,omitempty"` + ArrayAndItemsNullableProp *[]map[string]interface{} `json:"array_and_items_nullable_prop,omitempty"` ArrayItemsNullable *[]map[string]interface{} `json:"array_items_nullable,omitempty"` - ObjectNullableProp *NullableMap[string]map[string]interface{} `json:"object_nullable_prop,omitempty"` - ObjectAndItemsNullableProp *NullableMap[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"` + ObjectNullableProp *map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"` + ObjectAndItemsNullableProp *map[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"` ObjectItemsNullable *map[string]map[string]interface{} `json:"object_items_nullable,omitempty"` } @@ -197,9 +196,9 @@ func (o *NullableClass) SetDateProp(v NullableString) { } // GetDatetimeProp returns the DatetimeProp field value if set, zero value otherwise. -func (o *NullableClass) GetDatetimeProp() NullableTime.Time { +func (o *NullableClass) GetDatetimeProp() NullableTime { if o == nil || o.DatetimeProp == nil { - var ret NullableTime.Time + var ret NullableTime return ret } return *o.DatetimeProp @@ -207,9 +206,9 @@ func (o *NullableClass) GetDatetimeProp() NullableTime.Time { // GetDatetimePropOk returns a tuple with the DatetimeProp field value if set, zero value otherwise // and a boolean to check if the value has been set. -func (o *NullableClass) GetDatetimePropOk() (NullableTime.Time, bool) { +func (o *NullableClass) GetDatetimePropOk() (NullableTime, bool) { if o == nil || o.DatetimeProp == nil { - var ret NullableTime.Time + var ret NullableTime return ret, false } return *o.DatetimeProp, true @@ -224,15 +223,15 @@ func (o *NullableClass) HasDatetimeProp() bool { return false } -// SetDatetimeProp gets a reference to the given NullableTime.Time and assigns it to the DatetimeProp field. -func (o *NullableClass) SetDatetimeProp(v NullableTime.Time) { +// SetDatetimeProp gets a reference to the given NullableTime and assigns it to the DatetimeProp field. +func (o *NullableClass) SetDatetimeProp(v NullableTime) { o.DatetimeProp = &v } // GetArrayNullableProp returns the ArrayNullableProp field value if set, zero value otherwise. -func (o *NullableClass) GetArrayNullableProp() Nullable[]map[string]interface{} { +func (o *NullableClass) GetArrayNullableProp() []map[string]interface{} { if o == nil || o.ArrayNullableProp == nil { - var ret Nullable[]map[string]interface{} + var ret []map[string]interface{} return ret } return *o.ArrayNullableProp @@ -240,9 +239,9 @@ func (o *NullableClass) GetArrayNullableProp() Nullable[]map[string]interface{} // GetArrayNullablePropOk returns a tuple with the ArrayNullableProp field value if set, zero value otherwise // and a boolean to check if the value has been set. -func (o *NullableClass) GetArrayNullablePropOk() (Nullable[]map[string]interface{}, bool) { +func (o *NullableClass) GetArrayNullablePropOk() ([]map[string]interface{}, bool) { if o == nil || o.ArrayNullableProp == nil { - var ret Nullable[]map[string]interface{} + var ret []map[string]interface{} return ret, false } return *o.ArrayNullableProp, true @@ -257,15 +256,15 @@ func (o *NullableClass) HasArrayNullableProp() bool { return false } -// SetArrayNullableProp gets a reference to the given Nullable[]map[string]interface{} and assigns it to the ArrayNullableProp field. -func (o *NullableClass) SetArrayNullableProp(v Nullable[]map[string]interface{}) { +// SetArrayNullableProp gets a reference to the given []map[string]interface{} and assigns it to the ArrayNullableProp field. +func (o *NullableClass) SetArrayNullableProp(v []map[string]interface{}) { o.ArrayNullableProp = &v } // GetArrayAndItemsNullableProp returns the ArrayAndItemsNullableProp field value if set, zero value otherwise. -func (o *NullableClass) GetArrayAndItemsNullableProp() Nullable[]map[string]interface{} { +func (o *NullableClass) GetArrayAndItemsNullableProp() []map[string]interface{} { if o == nil || o.ArrayAndItemsNullableProp == nil { - var ret Nullable[]map[string]interface{} + var ret []map[string]interface{} return ret } return *o.ArrayAndItemsNullableProp @@ -273,9 +272,9 @@ func (o *NullableClass) GetArrayAndItemsNullableProp() Nullable[]map[string]inte // GetArrayAndItemsNullablePropOk returns a tuple with the ArrayAndItemsNullableProp field value if set, zero value otherwise // and a boolean to check if the value has been set. -func (o *NullableClass) GetArrayAndItemsNullablePropOk() (Nullable[]map[string]interface{}, bool) { +func (o *NullableClass) GetArrayAndItemsNullablePropOk() ([]map[string]interface{}, bool) { if o == nil || o.ArrayAndItemsNullableProp == nil { - var ret Nullable[]map[string]interface{} + var ret []map[string]interface{} return ret, false } return *o.ArrayAndItemsNullableProp, true @@ -290,8 +289,8 @@ func (o *NullableClass) HasArrayAndItemsNullableProp() bool { return false } -// SetArrayAndItemsNullableProp gets a reference to the given Nullable[]map[string]interface{} and assigns it to the ArrayAndItemsNullableProp field. -func (o *NullableClass) SetArrayAndItemsNullableProp(v Nullable[]map[string]interface{}) { +// SetArrayAndItemsNullableProp gets a reference to the given []map[string]interface{} and assigns it to the ArrayAndItemsNullableProp field. +func (o *NullableClass) SetArrayAndItemsNullableProp(v []map[string]interface{}) { o.ArrayAndItemsNullableProp = &v } @@ -329,9 +328,9 @@ func (o *NullableClass) SetArrayItemsNullable(v []map[string]interface{}) { } // GetObjectNullableProp returns the ObjectNullableProp field value if set, zero value otherwise. -func (o *NullableClass) GetObjectNullableProp() NullableMap[string]map[string]interface{} { +func (o *NullableClass) GetObjectNullableProp() map[string]map[string]interface{} { if o == nil || o.ObjectNullableProp == nil { - var ret NullableMap[string]map[string]interface{} + var ret map[string]map[string]interface{} return ret } return *o.ObjectNullableProp @@ -339,9 +338,9 @@ func (o *NullableClass) GetObjectNullableProp() NullableMap[string]map[string]in // GetObjectNullablePropOk returns a tuple with the ObjectNullableProp field value if set, zero value otherwise // and a boolean to check if the value has been set. -func (o *NullableClass) GetObjectNullablePropOk() (NullableMap[string]map[string]interface{}, bool) { +func (o *NullableClass) GetObjectNullablePropOk() (map[string]map[string]interface{}, bool) { if o == nil || o.ObjectNullableProp == nil { - var ret NullableMap[string]map[string]interface{} + var ret map[string]map[string]interface{} return ret, false } return *o.ObjectNullableProp, true @@ -356,15 +355,15 @@ func (o *NullableClass) HasObjectNullableProp() bool { return false } -// SetObjectNullableProp gets a reference to the given NullableMap[string]map[string]interface{} and assigns it to the ObjectNullableProp field. -func (o *NullableClass) SetObjectNullableProp(v NullableMap[string]map[string]interface{}) { +// SetObjectNullableProp gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectNullableProp field. +func (o *NullableClass) SetObjectNullableProp(v map[string]map[string]interface{}) { o.ObjectNullableProp = &v } // GetObjectAndItemsNullableProp returns the ObjectAndItemsNullableProp field value if set, zero value otherwise. -func (o *NullableClass) GetObjectAndItemsNullableProp() NullableMap[string]map[string]interface{} { +func (o *NullableClass) GetObjectAndItemsNullableProp() map[string]map[string]interface{} { if o == nil || o.ObjectAndItemsNullableProp == nil { - var ret NullableMap[string]map[string]interface{} + var ret map[string]map[string]interface{} return ret } return *o.ObjectAndItemsNullableProp @@ -372,9 +371,9 @@ func (o *NullableClass) GetObjectAndItemsNullableProp() NullableMap[string]map[s // GetObjectAndItemsNullablePropOk returns a tuple with the ObjectAndItemsNullableProp field value if set, zero value otherwise // and a boolean to check if the value has been set. -func (o *NullableClass) GetObjectAndItemsNullablePropOk() (NullableMap[string]map[string]interface{}, bool) { +func (o *NullableClass) GetObjectAndItemsNullablePropOk() (map[string]map[string]interface{}, bool) { if o == nil || o.ObjectAndItemsNullableProp == nil { - var ret NullableMap[string]map[string]interface{} + var ret map[string]map[string]interface{} return ret, false } return *o.ObjectAndItemsNullableProp, true @@ -389,8 +388,8 @@ func (o *NullableClass) HasObjectAndItemsNullableProp() bool { return false } -// SetObjectAndItemsNullableProp gets a reference to the given NullableMap[string]map[string]interface{} and assigns it to the ObjectAndItemsNullableProp field. -func (o *NullableClass) SetObjectAndItemsNullableProp(v NullableMap[string]map[string]interface{}) { +// SetObjectAndItemsNullableProp gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectAndItemsNullableProp field. +func (o *NullableClass) SetObjectAndItemsNullableProp(v map[string]map[string]interface{}) { o.ObjectAndItemsNullableProp = &v } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_number_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_number_only.go index db549197413..afa9c1b403a 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_number_only.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_number_only.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_order.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_order.go index b90caa6101e..448d6a975a4 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_order.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_order.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_composite.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_composite.go index cd40b710988..423d3e5ad37 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_composite.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_composite.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go index 8e7b562c1e5..b24d4b48d71 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" @@ -19,9 +19,9 @@ type OuterEnum string // List of OuterEnum const ( - PLACED OuterEnum = "placed" - APPROVED OuterEnum = "approved" - DELIVERED OuterEnum = "delivered" + OUTERENUM_PLACED OuterEnum = "placed" + OUTERENUM_APPROVED OuterEnum = "approved" + OUTERENUM_DELIVERED OuterEnum = "delivered" ) type NullableOuterEnum struct { diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go index 3305aa215fe..a9514cdfaf9 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" @@ -19,9 +19,9 @@ type OuterEnumDefaultValue string // List of OuterEnumDefaultValue const ( - PLACED OuterEnumDefaultValue = "placed" - APPROVED OuterEnumDefaultValue = "approved" - DELIVERED OuterEnumDefaultValue = "delivered" + OUTERENUMDEFAULTVALUE_PLACED OuterEnumDefaultValue = "placed" + OUTERENUMDEFAULTVALUE_APPROVED OuterEnumDefaultValue = "approved" + OUTERENUMDEFAULTVALUE_DELIVERED OuterEnumDefaultValue = "delivered" ) type NullableOuterEnumDefaultValue struct { diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go index 2d144b70d55..6555f0a9822 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" @@ -19,9 +19,9 @@ type OuterEnumInteger int32 // List of OuterEnumInteger const ( - _0 OuterEnumInteger = 0 - _1 OuterEnumInteger = 1 - _2 OuterEnumInteger = 2 + OUTERENUMINTEGER__0 OuterEnumInteger = 0 + OUTERENUMINTEGER__1 OuterEnumInteger = 1 + OUTERENUMINTEGER__2 OuterEnumInteger = 2 ) type NullableOuterEnumInteger struct { diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go index d7290302094..022dd527ec0 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" @@ -19,9 +19,9 @@ type OuterEnumIntegerDefaultValue int32 // List of OuterEnumIntegerDefaultValue const ( - _0 OuterEnumIntegerDefaultValue = 0 - _1 OuterEnumIntegerDefaultValue = 1 - _2 OuterEnumIntegerDefaultValue = 2 + OUTERENUMINTEGERDEFAULTVALUE__0 OuterEnumIntegerDefaultValue = 0 + OUTERENUMINTEGERDEFAULTVALUE__1 OuterEnumIntegerDefaultValue = 1 + OUTERENUMINTEGERDEFAULTVALUE__2 OuterEnumIntegerDefaultValue = 2 ) type NullableOuterEnumIntegerDefaultValue struct { diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_pet.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_pet.go index 0986a674066..7c1228c8b61 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_pet.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_pet.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_read_only_first.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_read_only_first.go index 24f821d7bdf..424ef8b81f3 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_read_only_first.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_read_only_first.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_return.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_return.go index c5b2d1aaecc..785303c992d 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_return.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_return.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_tag.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_tag.go index f50a11101e4..bcb30265ab2 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_tag.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_tag.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_user.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_user.go index dc7234de91b..a427f7f7c24 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_user.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_user.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/response.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/response.go index 77346c8c1e3..c16f181f4e9 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/response.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/response.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "net/http" diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/utils.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/utils.go index 2bfa04d4e48..3a3303b2445 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/utils.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/utils.go @@ -7,7 +7,7 @@ * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ -package openapi +package petstore import ( "bytes" diff --git a/samples/openapi3/client/petstore/go-experimental/pet_api_test.go b/samples/openapi3/client/petstore/go-experimental/pet_api_test.go new file mode 100644 index 00000000000..9f0a154f96a --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/pet_api_test.go @@ -0,0 +1,292 @@ +package main + +import ( + "context" + "fmt" + "os" + "testing" + + "github.com/stretchr/testify/assert" + + sw "./go-petstore" +) + +var client *sw.APIClient + +const testHost = "petstore.swagger.io:80" +const testScheme = "http" + +func TestMain(m *testing.M) { + cfg := sw.NewConfiguration() + cfg.AddDefaultHeader("testheader", "testvalue") + cfg.Host = testHost + cfg.Scheme = testScheme + client = sw.NewAPIClient(cfg) + retCode := m.Run() + os.Exit(retCode) +} + +func TestAddPet(t *testing.T) { + newPet := (sw.Pet{Id: sw.PtrInt64(12830), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + + r, err := client.PetApi.AddPet(context.Background()).Pet(newPet).Execute() + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestFindPetsByStatusWithMissingParam(t *testing.T) { + _, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status(nil).Execute() + + if err != nil { + t.Fatalf("Error while testing TestFindPetsByStatusWithMissingParam: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestGetPetById(t *testing.T) { + isPetCorrect(t, 12830, "gopher", "pending") +} + +func TestGetPetByIdWithInvalidID(t *testing.T) { + resp, r, err := client.PetApi.GetPetById(context.Background(), 999999999).Execute() + if r != nil && r.StatusCode == 404 { + assertedError, ok := err.(sw.GenericOpenAPIError) + a := assert.New(t) + a.True(ok) + a.Contains(string(assertedError.Body()), "type") + + a.Contains(assertedError.Error(), "Not Found") + } else if err != nil { + t.Fatalf("Error while getting pet by invalid id: %v", err) + t.Log(r) + } else { + t.Log(resp) + } +} + +func TestUpdatePetWithForm(t *testing.T) { + r, err := client.PetApi.UpdatePetWithForm(context.Background(), 12830).Name("golang").Status("available").Execute() + if err != nil { + t.Fatalf("Error while updating pet by id: %v", err) + t.Log(r) + } + if r.StatusCode != 200 { + t.Log(r) + } + + // get the pet with id 12830 from server to verify the update + isPetCorrect(t, 12830, "golang", "available") +} + +func TestFindPetsByTag(t *testing.T) { + var found = false + resp, r, err := client.PetApi.FindPetsByTags(context.Background()).Tags([]string{"tag2"}).Execute() + if err != nil { + t.Fatalf("Error while getting pet by tag: %v", err) + t.Log(r) + } else { + if len(resp) == 0 { + t.Errorf("Error no pets returned") + } else { + + assert := assert.New(t) + for i := 0; i < len(resp); i++ { + if *resp[i].Id == 12830 { + assert.Equal(*resp[i].Status, "available", "Pet status should be `pending`") + found = true + } + } + } + + if found == false { + t.Errorf("Error while getting pet by tag could not find 12830") + } + + if r.StatusCode != 200 { + t.Log(r) + } + } +} + +func TestFindPetsByStatus(t *testing.T) { + resp, r, err := client.PetApi.FindPetsByStatus(context.Background()).Status([]string{"available"}).Execute() + if err != nil { + t.Fatalf("Error while getting pet by id: %v", err) + t.Log(r) + } else { + if len(resp) == 0 { + t.Errorf("Error no pets returned") + } else { + assert := assert.New(t) + for i := 0; i < len(resp); i++ { + assert.Equal(*resp[i].Status, "available", "Pet status should be `available`") + } + } + + if r.StatusCode != 200 { + t.Log(r) + } + } +} + +func TestUploadFile(t *testing.T) { + file, err1 := os.Open("testfiles/foo.png") + if err1 != nil { + t.Fatalf("Error opening file: %v", err1) + } + + _, r, err := client.PetApi.UploadFile(context.Background(), 12830).AdditionalMetadata("golang").File(file).Execute() + + if err != nil { + t.Fatalf("Error while uploading file: %v", err) + } + + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestUploadFileRequired(t *testing.T) { + return // remove when server supports this endpoint + file, err1 := os.Open("testfiles/foo.png") + if err1 != nil { + t.Fatalf("Error opening file: %v", err1) + } + + _, r, err := client.PetApi.UploadFileWithRequiredFile(context.Background(), 12830).RequiredFile(file).AdditionalMetadata("golang").Execute() + + if err != nil { + t.Fatalf("Error while uploading file: %v", err) + } + + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestDeletePet(t *testing.T) { + r, err := client.PetApi.DeletePet(context.Background(), 12830).Execute() + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +/* +// Test we can concurrently create, retrieve, update, and delete. +func TestConcurrency(t *testing.T) { + errc := make(chan error) + + newPets := []sw.Pet{ + sw.Pet{Id: 912345, Name: "gopherFred", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, + sw.Pet{Id: 912346, Name: "gopherDan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, + sw.Pet{Id: 912347, Name: "gopherRick", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "mia"}, + sw.Pet{Id: 912348, Name: "gopherJohn", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, + sw.Pet{Id: 912349, Name: "gopherAlf", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, + sw.Pet{Id: 912350, Name: "gopherRob", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, + sw.Pet{Id: 912351, Name: "gopherIan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, + } + + // Add the pets. + for _, pet := range newPets { + go func(newPet sw.Pet) { + r, err := client.PetApi.AddPet(nil, newPet) + if r.StatusCode != 200 { + t.Log(r) + } + errc <- err + }(pet) + } + waitOnFunctions(t, errc, len(newPets)) + + // Verify they are correct. + for _, pet := range newPets { + go func(pet sw.Pet) { + isPetCorrect(t, pet.Id, pet.Name, pet.Status) + errc <- nil + }(pet) + } + + waitOnFunctions(t, errc, len(newPets)) + + // Update all to active with the name gopherDan + for _, pet := range newPets { + go func(id int64) { + r, err := client.PetApi.UpdatePet(nil, sw.Pet{Id: (int64)(id), Name: "gopherDan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}) + if r.StatusCode != 200 { + t.Log(r) + } + errc <- err + }(pet.Id) + } + waitOnFunctions(t, errc, len(newPets)) + + // Verify they are correct. + for _, pet := range newPets { + go func(pet sw.Pet) { + isPetCorrect(t, pet.Id, "gopherDan", "active") + errc <- nil + }(pet) + } + + waitOnFunctions(t, errc, len(newPets)) + + // Delete them all. + for _, pet := range newPets { + go func(id int64) { + deletePet(t, (int64)(id)) + errc <- nil + }(pet.Id) + } + waitOnFunctions(t, errc, len(newPets)) +} +*/ + +func waitOnFunctions(t *testing.T, errc chan error, n int) { + for i := 0; i < n; i++ { + err := <-errc + if err != nil { + t.Fatalf("Error performing concurrent test: %v", err) + } + } +} + +func deletePet(t *testing.T, id int64) { + r, err := client.PetApi.DeletePet(context.Background(), id).Execute() + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func isPetCorrect(t *testing.T, id int64, name string, status string) { + assert := assert.New(t) + resp, r, err := client.PetApi.GetPetById(context.Background(), id).Execute() + if err != nil { + t.Fatalf("Error while getting pet by id: %v", err) + } else { + assert.Equal(*resp.Id, int64(id), "Pet id should be equal") + assert.Equal(resp.Name, name, fmt.Sprintf("Pet name should be %s", name)) + assert.Equal(*resp.Status, status, fmt.Sprintf("Pet status should be %s", status)) + + //t.Log(resp) + } + if r.StatusCode != 200 { + t.Log(r) + } +} diff --git a/samples/openapi3/client/petstore/go-experimental/pom.xml b/samples/openapi3/client/petstore/go-experimental/pom.xml new file mode 100644 index 00000000000..2f84e8bbfe7 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/pom.xml @@ -0,0 +1,89 @@ + + 4.0.0 + org.openapitools + GoExperimentalOAS3Petstore + pom + 1.0.0 + Go Experimental OpenAPI3 Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + go-get-testify + pre-integration-test + + exec + + + go + + get + github.com/stretchr/testify/assert + + + + + go-get-oauth2 + pre-integration-test + + exec + + + go + + get + golang.org/x/oauth2 + + + + + go-get-context + pre-integration-test + + exec + + + go + + get + golang.org/x/net/context + + + + + go-test + integration-test + + exec + + + go + + test + -v + + + + + + + + diff --git a/samples/openapi3/client/petstore/go-experimental/store_api_test.go b/samples/openapi3/client/petstore/go-experimental/store_api_test.go new file mode 100644 index 00000000000..fc0cdec9699 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/store_api_test.go @@ -0,0 +1,37 @@ +package main + +import ( + "context" + "regexp" + "testing" + "time" + + sw "./go-petstore" +) + +func TestPlaceOrder(t *testing.T) { + newOrder := sw.Order{ + Id: sw.PtrInt64(0), + PetId: sw.PtrInt64(0), + Quantity: sw.PtrInt32(0), + ShipDate: sw.PtrTime(time.Now().UTC()), + Status: sw.PtrString("placed"), + Complete: sw.PtrBool(false)} + + _, r, err := client.StoreApi.PlaceOrder(context.Background()).Order(newOrder).Execute() + + if err != nil { + // Skip parsing time error due to error in Petstore Test Server + // https://github.com/OpenAPITools/openapi-generator/issues/1292 + if regexp. + MustCompile(`^parsing time.+cannot parse "\+0000"" as "Z07:00"$`). + MatchString(err.Error()) { + t.Log("Skipping error for parsing time with `+0000` UTC offset as Petstore Test Server does not return valid RFC 3339 datetime") + } else { + t.Fatalf("Error while placing order: %v", err) + } + } + if r.StatusCode != 200 { + t.Log(r) + } +} diff --git a/samples/openapi3/client/petstore/go-experimental/testfiles/foo.png b/samples/openapi3/client/petstore/go-experimental/testfiles/foo.png new file mode 100644 index 0000000000000000000000000000000000000000..a9b12cf5927ac757b054dd875ee137c2581f69bb GIT binary patch literal 43280 zcmV*%KsdjNP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ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t+s)l>K!d`?Mf{a-pu_kO14)(KF%^aGCGOL71yG+~sCkr`smRV8nej$*cT zxB{*5ND?i^*}#~gB6db7m3vU!*sqE^Y?ml z54}mLC`NkNkS-#iD~3$^^ZVB}*qbkf|LdDD>%X&B=S~IRj)DCD^7pkU%y-K1#46xw z#FJM(HZ_ifVxD0mzn!i($$;1Qjq_sdqCDf2?ACOItnm=|AFwt{ZY_hiF*{@k{Ez^@ zfPiOR(KAE6LOoqw!KWI|xGa1Q;=KWI}Wu0j*|X@)o?TT7{nJ?dH$ zbJeTrO^X!6 ze*pUgcp=V|mF1P4$JtYAVob0VVH_wZtFGqi>+kPx;CZ5#```cR)&0S~e|O+J)Ry(B z#yvjvseD=E_;hrHKS4MA>b=67hd4AMA|geeo4q#y5XoOBZ3=E%{lV&hj(=P5^y%Xb z0ppO{8X*RYZ(+%!qO4`Rs^GA4mvR5G#=`V9pDsRjPErznDCpL55{ZIv#L$t_=3=x$ mA0V|)``=#uC)qLnml?uml0Z=v_!9*IU+OB_j~X9ZMg0%bqvyc@ literal 0 HcmV?d00001 diff --git a/samples/openapi3/client/petstore/go-experimental/user_api_test.go b/samples/openapi3/client/petstore/go-experimental/user_api_test.go new file mode 100644 index 00000000000..f7652aea456 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/user_api_test.go @@ -0,0 +1,153 @@ +package main + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + + sw "./go-petstore" +) + +func TestCreateUser(t *testing.T) { + newUser := sw.User{ + Id: sw.PtrInt64(1000), + FirstName: sw.PtrString("gopher"), + LastName: sw.PtrString("lang"), + Username: sw.PtrString("gopher"), + Password: sw.PtrString("lang"), + Email: sw.PtrString("lang@test.com"), + Phone: sw.PtrString("5101112222"), + UserStatus: sw.PtrInt32(1)} + + apiResponse, err := client.UserApi.CreateUser(context.Background()).User(newUser).Execute() + + if err != nil { + t.Fatalf("Error while adding user: %v", err) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } +} + +//adding x to skip the test, currently it is failing +func TestCreateUsersWithArrayInput(t *testing.T) { + newUsers := []sw.User{ + sw.User{ + Id: sw.PtrInt64(1001), + FirstName: sw.PtrString("gopher1"), + LastName: sw.PtrString("lang1"), + Username: sw.PtrString("gopher1"), + Password: sw.PtrString("lang1"), + Email: sw.PtrString("lang1@test.com"), + Phone: sw.PtrString("5101112222"), + UserStatus: sw.PtrInt32(1), + }, + sw.User{ + Id: sw.PtrInt64(1002), + FirstName: sw.PtrString("gopher2"), + LastName: sw.PtrString("lang2"), + Username: sw.PtrString("gopher2"), + Password: sw.PtrString("lang2"), + Email: sw.PtrString("lang2@test.com"), + Phone: sw.PtrString("5101112222"), + UserStatus: sw.PtrInt32(1), + }, + } + + apiResponse, err := client.UserApi.CreateUsersWithArrayInput(context.Background()).User(newUsers).Execute() + if err != nil { + t.Fatalf("Error while adding users: %v", err) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } + + //tear down + _, err1 := client.UserApi.DeleteUser(context.Background(), "gopher1").Execute() + if err1 != nil { + t.Errorf("Error while deleting user") + t.Log(err1) + } + + _, err2 := client.UserApi.DeleteUser(context.Background(), "gopher2").Execute() + if err2 != nil { + t.Errorf("Error while deleting user") + t.Log(err2) + } +} + +func TestGetUserByName(t *testing.T) { + assert := assert.New(t) + + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher").Execute() + if err != nil { + t.Fatalf("Error while getting user by id: %v", err) + } else { + assert.Equal(*resp.Id, int64(1000), "User id should be equal") + assert.Equal(*resp.Username, "gopher", "User name should be gopher") + assert.Equal(*resp.LastName, "lang", "Last name should be lang") + //t.Log(resp) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } +} + +func TestGetUserByNameWithInvalidID(t *testing.T) { + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "999999999").Execute() + if apiResponse != nil && apiResponse.StatusCode == 404 { + return // This is a pass condition. API will return with a 404 error. + } else if err != nil { + t.Fatalf("Error while getting user by invalid id: %v", err) + t.Log(apiResponse) + } else { + t.Log(resp) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } +} + +func TestUpdateUser(t *testing.T) { + assert := assert.New(t) + + newUser := sw.User{ + Id: sw.PtrInt64(1000), + FirstName: sw.PtrString("gopher20"), + LastName: sw.PtrString("lang20"), + Username: sw.PtrString("gopher"), + Password: sw.PtrString("lang"), + Email: sw.PtrString("lang@test.com"), + Phone: sw.PtrString("5101112222"), + UserStatus: sw.PtrInt32(1)} + + apiResponse, err := client.UserApi.UpdateUser(context.Background(), "gopher").User(newUser).Execute() + if err != nil { + t.Fatalf("Error while deleting user by id: %v", err) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } + + //verify changings are correct + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher").Execute() + if err != nil { + t.Fatalf("Error while getting user by id: %v", err) + } else { + assert.Equal(*resp.Id, int64(1000), "User id should be equal") + assert.Equal(*resp.FirstName, "gopher20", "User name should be gopher") + assert.Equal(*resp.Password, "lang", "User name should be the same") + } +} + +func TestDeleteUser(t *testing.T) { + apiResponse, err := client.UserApi.DeleteUser(context.Background(), "gopher").Execute() + + if err != nil { + t.Fatalf("Error while deleting user: %v", err) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } +} diff --git a/samples/openapi3/client/petstore/go/auth_test.go b/samples/openapi3/client/petstore/go/auth_test.go new file mode 100644 index 00000000000..5f817703a88 --- /dev/null +++ b/samples/openapi3/client/petstore/go/auth_test.go @@ -0,0 +1,254 @@ +package main + +import ( + "context" + "net/http" + "net/http/httputil" + "strings" + "testing" + "time" + + "golang.org/x/oauth2" + + sw "./go-petstore" +) + +func TestOAuth2(t *testing.T) { + // Setup some fake oauth2 configuration + cfg := &oauth2.Config{ + ClientID: "1234567", + ClientSecret: "SuperSecret", + Endpoint: oauth2.Endpoint{ + AuthURL: "https://devnull", + TokenURL: "https://devnull", + }, + RedirectURL: "https://devnull", + } + + // and a fake token + tok := oauth2.Token{ + AccessToken: "FAKE", + RefreshToken: "So Fake", + Expiry: time.Now().Add(time.Hour * 100000), + TokenType: "Bearer", + } + + // then a fake tokenSource + tokenSource := cfg.TokenSource(createContext(nil), &tok) + auth := context.WithValue(context.Background(), sw.ContextOAuth2, tokenSource) + + newPet := (sw.Pet{Id: 12992, Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + + r, err := client.PetApi.AddPet(context.Background(), newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + r, err = client.PetApi.DeletePet(auth, 12992, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + reqb, _ := httputil.DumpRequest(r.Request, true) + + if !strings.Contains((string)(reqb), "Authorization: Bearer FAKE") { + t.Errorf("OAuth2 Authentication is missing") + } +} + +func TestBasicAuth(t *testing.T) { + + auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "fakeUser", + Password: "f4k3p455", + }) + + newPet := (sw.Pet{Id: 12992, Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + + r, err := client.PetApi.AddPet(auth, newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + r, err = client.PetApi.DeletePet(auth, 12992, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Authorization: Basic ZmFrZVVzZXI6ZjRrM3A0NTU") { + t.Errorf("Basic Authentication is missing") + } +} + +func TestAccessToken(t *testing.T) { + auth := context.WithValue(context.Background(), sw.ContextAccessToken, "TESTFAKEACCESSTOKENISFAKE") + + newPet := (sw.Pet{Id: 12992, Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + + r, err := client.PetApi.AddPet(nil, newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + r, err = client.PetApi.DeletePet(auth, 12992, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Authorization: Bearer TESTFAKEACCESSTOKENISFAKE") { + t.Errorf("AccessToken Authentication is missing") + } +} + +func TestAPIKeyNoPrefix(t *testing.T) { + auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{Key: "TEST123"}) + + newPet := (sw.Pet{Id: 12992, Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + + r, err := client.PetApi.AddPet(context.Background(), newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + _, r, err = client.PetApi.GetPetById(auth, 12992) + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Api_key: TEST123") { + t.Errorf("APIKey Authentication is missing") + } + + r, err = client.PetApi.DeletePet(auth, 12992, nil) + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestAPIKeyWithPrefix(t *testing.T) { + auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{Key: "TEST123", Prefix: "Bearer"}) + + newPet := (sw.Pet{Id: 12992, Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + + r, err := client.PetApi.AddPet(nil, newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + _, r, err = client.PetApi.GetPetById(auth, 12992) + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Api_key: Bearer TEST123") { + t.Errorf("APIKey Authentication is missing") + } + + r, err = client.PetApi.DeletePet(auth, 12992, nil) + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestDefaultHeader(t *testing.T) { + + newPet := (sw.Pet{Id: 12992, Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + + r, err := client.PetApi.AddPet(context.Background(), newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + r, err = client.PetApi.DeletePet(context.Background(), 12992, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Testheader: testvalue") { + t.Errorf("Default Header is missing") + } +} + +func TestHostOverride(t *testing.T) { + _, r, err := client.PetApi.FindPetsByStatus(context.Background(), nil) + + if err != nil { + t.Fatalf("Error while finding pets by status: %v", err) + } + + if r.Request.URL.Host != testHost { + t.Errorf("Request Host is %v, expected %v", r.Request.Host, testHost) + } +} + +func TestSchemeOverride(t *testing.T) { + _, r, err := client.PetApi.FindPetsByStatus(context.Background(), nil) + + if err != nil { + t.Fatalf("Error while finding pets by status: %v", err) + } + + if r.Request.URL.Scheme != testScheme { + t.Errorf("Request Scheme is %v, expected %v", r.Request.URL.Scheme, testScheme) + } +} + +// Add custom clients to the context. +func createContext(httpClient *http.Client) context.Context { + parent := oauth2.NoContext + ctx := context.WithValue(parent, oauth2.HTTPClient, httpClient) + return ctx +} diff --git a/samples/openapi3/client/petstore/go/fake_api_test.go b/samples/openapi3/client/petstore/go/fake_api_test.go new file mode 100644 index 00000000000..f4242b5048c --- /dev/null +++ b/samples/openapi3/client/petstore/go/fake_api_test.go @@ -0,0 +1,28 @@ +package main + +import ( + "testing" + + sw "./go-petstore" + "golang.org/x/net/context" +) + +// TestPutBodyWithFileSchema ensures a model with the name 'File' +// gets converted properly to the petstore.File struct vs. *os.File +// as specified in typeMapping for 'File'. +func TestPutBodyWithFileSchema(t *testing.T) { + return // early return to test compilation + + schema := sw.FileSchemaTestClass{ + File: sw.File{SourceURI: "https://example.com/image.png"}, + Files: []sw.File{{SourceURI: "https://example.com/image.png"}}} + + r, err := client.FakeApi.TestBodyWithFileSchema(context.Background(), schema) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} diff --git a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go index b22a4bf9248..387dda7fee6 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go @@ -1236,26 +1236,30 @@ func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} - t:=pipe - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("pipe", parameterToString(s.Index(i), "multi")) + { + t:=pipe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("pipe", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("pipe", parameterToString(t, "multi")) } - } else { - localVarQueryParams.Add("pipe", parameterToString(t, "multi")) } localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) localVarQueryParams.Add("http", parameterToString(http, "space")) localVarQueryParams.Add("url", parameterToString(url, "csv")) - t:=context - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + { + t:=context + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("context", parameterToString(t, "multi")) } - } else { - localVarQueryParams.Add("context", parameterToString(t, "multi")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_enum_class.go b/samples/openapi3/client/petstore/go/go-petstore/model_enum_class.go index 8b7e1ee8959..7470d644d0a 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_enum_class.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_enum_class.go @@ -13,7 +13,7 @@ type EnumClass string // List of EnumClass const ( - ABC EnumClass = "_abc" - EFG EnumClass = "-efg" - XYZ EnumClass = "(xyz)" + ENUMCLASS_ABC EnumClass = "_abc" + ENUMCLASS_EFG EnumClass = "-efg" + ENUMCLASS_XYZ EnumClass = "(xyz)" ) diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum.go index efefaf1b784..b9233fa91df 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum.go @@ -13,7 +13,7 @@ type OuterEnum string // List of OuterEnum const ( - PLACED OuterEnum = "placed" - APPROVED OuterEnum = "approved" - DELIVERED OuterEnum = "delivered" + OUTERENUM_PLACED OuterEnum = "placed" + OUTERENUM_APPROVED OuterEnum = "approved" + OUTERENUM_DELIVERED OuterEnum = "delivered" ) diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_default_value.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_default_value.go index e150f03864f..6ab39166338 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_default_value.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_default_value.go @@ -13,7 +13,7 @@ type OuterEnumDefaultValue string // List of OuterEnumDefaultValue const ( - PLACED OuterEnumDefaultValue = "placed" - APPROVED OuterEnumDefaultValue = "approved" - DELIVERED OuterEnumDefaultValue = "delivered" + OUTERENUMDEFAULTVALUE_PLACED OuterEnumDefaultValue = "placed" + OUTERENUMDEFAULTVALUE_APPROVED OuterEnumDefaultValue = "approved" + OUTERENUMDEFAULTVALUE_DELIVERED OuterEnumDefaultValue = "delivered" ) diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer.go index bae14df0f7d..d8c4d36926d 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer.go @@ -13,7 +13,7 @@ type OuterEnumInteger int32 // List of OuterEnumInteger const ( - _0 OuterEnumInteger = 0 - _1 OuterEnumInteger = 1 - _2 OuterEnumInteger = 2 + OUTERENUMINTEGER__0 OuterEnumInteger = 0 + OUTERENUMINTEGER__1 OuterEnumInteger = 1 + OUTERENUMINTEGER__2 OuterEnumInteger = 2 ) diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer_default_value.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer_default_value.go index b882d7aee2c..27a68a9d6ef 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer_default_value.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer_default_value.go @@ -13,7 +13,7 @@ type OuterEnumIntegerDefaultValue int32 // List of OuterEnumIntegerDefaultValue const ( - _0 OuterEnumIntegerDefaultValue = 0 - _1 OuterEnumIntegerDefaultValue = 1 - _2 OuterEnumIntegerDefaultValue = 2 + OUTERENUMINTEGERDEFAULTVALUE__0 OuterEnumIntegerDefaultValue = 0 + OUTERENUMINTEGERDEFAULTVALUE__1 OuterEnumIntegerDefaultValue = 1 + OUTERENUMINTEGERDEFAULTVALUE__2 OuterEnumIntegerDefaultValue = 2 ) diff --git a/samples/openapi3/client/petstore/go/pet_api_test.go b/samples/openapi3/client/petstore/go/pet_api_test.go new file mode 100644 index 00000000000..cda4f457855 --- /dev/null +++ b/samples/openapi3/client/petstore/go/pet_api_test.go @@ -0,0 +1,303 @@ +package main + +import ( + "context" + "fmt" + "os" + "testing" + + "github.com/antihax/optional" + "github.com/stretchr/testify/assert" + + sw "./go-petstore" +) + +var client *sw.APIClient + +const testHost = "petstore.swagger.io:80" +const testScheme = "http" + +func TestMain(m *testing.M) { + cfg := sw.NewConfiguration() + cfg.AddDefaultHeader("testheader", "testvalue") + cfg.Host = testHost + cfg.Scheme = testScheme + client = sw.NewAPIClient(cfg) + retCode := m.Run() + os.Exit(retCode) +} + +func TestAddPet(t *testing.T) { + newPet := (sw.Pet{Id: 12830, Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + + r, err := client.PetApi.AddPet(context.Background(), newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestFindPetsByStatusWithMissingParam(t *testing.T) { + _, r, err := client.PetApi.FindPetsByStatus(context.Background(), nil) + + if err != nil { + t.Fatalf("Error while testing TestFindPetsByStatusWithMissingParam: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestGetPetById(t *testing.T) { + isPetCorrect(t, 12830, "gopher", "pending") +} + +func TestGetPetByIdWithInvalidID(t *testing.T) { + resp, r, err := client.PetApi.GetPetById(context.Background(), 999999999) + if r != nil && r.StatusCode == 404 { + assertedError, ok := err.(sw.GenericOpenAPIError) + a := assert.New(t) + a.True(ok) + a.Contains(string(assertedError.Body()), "type") + + a.Contains(assertedError.Error(), "Not Found") + } else if err != nil { + t.Fatalf("Error while getting pet by invalid id: %v", err) + t.Log(r) + } else { + t.Log(resp) + } +} + +func TestUpdatePetWithForm(t *testing.T) { + r, err := client.PetApi.UpdatePetWithForm(context.Background(), 12830, &sw.UpdatePetWithFormOpts{ + Name: optional.NewString("golang"), + Status: optional.NewString("available"), + }) + if err != nil { + t.Fatalf("Error while updating pet by id: %v", err) + t.Log(r) + } + if r.StatusCode != 200 { + t.Log(r) + } + + // get the pet with id 12830 from server to verify the update + isPetCorrect(t, 12830, "golang", "available") +} + +func TestFindPetsByTag(t *testing.T) { + var found = false + resp, r, err := client.PetApi.FindPetsByTags(context.Background(), []string{"tag2"}) + if err != nil { + t.Fatalf("Error while getting pet by tag: %v", err) + t.Log(r) + } else { + if len(resp) == 0 { + t.Errorf("Error no pets returned") + } else { + + assert := assert.New(t) + for i := 0; i < len(resp); i++ { + if resp[i].Id == 12830 { + assert.Equal(resp[i].Status, "available", "Pet status should be `pending`") + found = true + } + } + } + + if found == false { + t.Errorf("Error while getting pet by tag could not find 12830") + } + + if r.StatusCode != 200 { + t.Log(r) + } + } +} + +func TestFindPetsByStatus(t *testing.T) { + resp, r, err := client.PetApi.FindPetsByStatus(context.Background(), []string{"available"}) + if err != nil { + t.Fatalf("Error while getting pet by id: %v", err) + t.Log(r) + } else { + if len(resp) == 0 { + t.Errorf("Error no pets returned") + } else { + assert := assert.New(t) + for i := 0; i < len(resp); i++ { + assert.Equal(resp[i].Status, "available", "Pet status should be `available`") + } + } + + if r.StatusCode != 200 { + t.Log(r) + } + } +} + +func TestUploadFile(t *testing.T) { + file, err1 := os.Open("testfiles/foo.png") + if err1 != nil { + t.Fatalf("Error opening file: %v", err1) + } + + _, r, err := client.PetApi.UploadFile(context.Background(), 12830, &sw.UploadFileOpts{ + AdditionalMetadata: optional.NewString("golang"), + File: optional.NewInterface(file), + }) + + if err != nil { + t.Fatalf("Error while uploading file: %v", err) + } + + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestUploadFileRequired(t *testing.T) { + return // remove when server supports this endpoint + file, err1 := os.Open("testfiles/foo.png") + if err1 != nil { + t.Fatalf("Error opening file: %v", err1) + } + + _, r, err := client.PetApi.UploadFileWithRequiredFile(context.Background(), 12830, + file, + &sw.UploadFileWithRequiredFileOpts{ + AdditionalMetadata: optional.NewString("golang"), + }) + + if err != nil { + t.Fatalf("Error while uploading file: %v", err) + } + + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestDeletePet(t *testing.T) { + r, err := client.PetApi.DeletePet(context.Background(), 12830, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +/* +// Test we can concurrently create, retrieve, update, and delete. +func TestConcurrency(t *testing.T) { + errc := make(chan error) + + newPets := []sw.Pet{ + sw.Pet{Id: 912345, Name: "gopherFred", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, + sw.Pet{Id: 912346, Name: "gopherDan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, + sw.Pet{Id: 912347, Name: "gopherRick", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "mia"}, + sw.Pet{Id: 912348, Name: "gopherJohn", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, + sw.Pet{Id: 912349, Name: "gopherAlf", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, + sw.Pet{Id: 912350, Name: "gopherRob", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, + sw.Pet{Id: 912351, Name: "gopherIan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, + } + + // Add the pets. + for _, pet := range newPets { + go func(newPet sw.Pet) { + r, err := client.PetApi.AddPet(nil, newPet) + if r.StatusCode != 200 { + t.Log(r) + } + errc <- err + }(pet) + } + waitOnFunctions(t, errc, len(newPets)) + + // Verify they are correct. + for _, pet := range newPets { + go func(pet sw.Pet) { + isPetCorrect(t, pet.Id, pet.Name, pet.Status) + errc <- nil + }(pet) + } + + waitOnFunctions(t, errc, len(newPets)) + + // Update all to active with the name gopherDan + for _, pet := range newPets { + go func(id int64) { + r, err := client.PetApi.UpdatePet(nil, sw.Pet{Id: (int64)(id), Name: "gopherDan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}) + if r.StatusCode != 200 { + t.Log(r) + } + errc <- err + }(pet.Id) + } + waitOnFunctions(t, errc, len(newPets)) + + // Verify they are correct. + for _, pet := range newPets { + go func(pet sw.Pet) { + isPetCorrect(t, pet.Id, "gopherDan", "active") + errc <- nil + }(pet) + } + + waitOnFunctions(t, errc, len(newPets)) + + // Delete them all. + for _, pet := range newPets { + go func(id int64) { + deletePet(t, (int64)(id)) + errc <- nil + }(pet.Id) + } + waitOnFunctions(t, errc, len(newPets)) +} +*/ + +func waitOnFunctions(t *testing.T, errc chan error, n int) { + for i := 0; i < n; i++ { + err := <-errc + if err != nil { + t.Fatalf("Error performing concurrent test: %v", err) + } + } +} + +func deletePet(t *testing.T, id int64) { + r, err := client.PetApi.DeletePet(context.Background(), id, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func isPetCorrect(t *testing.T, id int64, name string, status string) { + assert := assert.New(t) + resp, r, err := client.PetApi.GetPetById(context.Background(), id) + if err != nil { + t.Fatalf("Error while getting pet by id: %v", err) + } else { + assert.Equal(resp.Id, int64(id), "Pet id should be equal") + assert.Equal(resp.Name, name, fmt.Sprintf("Pet name should be %s", name)) + assert.Equal(resp.Status, status, fmt.Sprintf("Pet status should be %s", status)) + + //t.Log(resp) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + diff --git a/samples/openapi3/client/petstore/go/pom.xml b/samples/openapi3/client/petstore/go/pom.xml new file mode 100644 index 00000000000..222de294b3d --- /dev/null +++ b/samples/openapi3/client/petstore/go/pom.xml @@ -0,0 +1,103 @@ + + 4.0.0 + org.openapitools + GoOAS3Petstore + pom + 1.0.0 + Go OpenAPI3 Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + go-get-testify + pre-integration-test + + exec + + + go + + get + github.com/stretchr/testify/assert + + + + + go-get-oauth2 + pre-integration-test + + exec + + + go + + get + golang.org/x/oauth2 + + + + + go-get-context + pre-integration-test + + exec + + + go + + get + golang.org/x/net/context + + + + + go-get-optional + pre-integration-test + + exec + + + go + + get + github.com/antihax/optional + + + + + go-test + integration-test + + exec + + + go + + test + -v + + + + + + + + diff --git a/samples/openapi3/client/petstore/go/store_api_test.go b/samples/openapi3/client/petstore/go/store_api_test.go new file mode 100644 index 00000000000..3088adf7b40 --- /dev/null +++ b/samples/openapi3/client/petstore/go/store_api_test.go @@ -0,0 +1,37 @@ +package main + +import ( + "context" + "regexp" + "testing" + "time" + + sw "./go-petstore" +) + +func TestPlaceOrder(t *testing.T) { + newOrder := sw.Order{ + Id: 0, + PetId: 0, + Quantity: 0, + ShipDate: time.Now().UTC(), + Status: "placed", + Complete: false} + + _, r, err := client.StoreApi.PlaceOrder(context.Background(), newOrder) + + if err != nil { + // Skip parsing time error due to error in Petstore Test Server + // https://github.com/OpenAPITools/openapi-generator/issues/1292 + if regexp. + MustCompile(`^parsing time.+cannot parse "\+0000"" as "Z07:00"$`). + MatchString(err.Error()) { + t.Log("Skipping error for parsing time with `+0000` UTC offset as Petstore Test Server does not return valid RFC 3339 datetime") + } else { + t.Fatalf("Error while placing order: %v", err) + } + } + if r.StatusCode != 200 { + t.Log(r) + } +} diff --git a/samples/openapi3/client/petstore/go/testfiles/foo.png b/samples/openapi3/client/petstore/go/testfiles/foo.png new file mode 100644 index 0000000000000000000000000000000000000000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E_;hrHKS4MA>b=67hd4AMA|geeo4q#y5XoOBZ3=E%{lV&hj(=P5^y%Xb z0ppO{8X*RYZ(+%!qO4`Rs^GA4mvR5G#=`V9pDsRjPErznDCpL55{ZIv#L$t_=3=x$ mA0V|)``=#uC)qLnml?uml0Z=v_!9*IU+OB_j~X9ZMg0%bqvyc@ literal 0 HcmV?d00001 diff --git a/samples/openapi3/client/petstore/go/user_api_test.go b/samples/openapi3/client/petstore/go/user_api_test.go new file mode 100644 index 00000000000..012c608fab6 --- /dev/null +++ b/samples/openapi3/client/petstore/go/user_api_test.go @@ -0,0 +1,153 @@ +package main + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + + sw "./go-petstore" +) + +func TestCreateUser(t *testing.T) { + newUser := sw.User{ + Id: 1000, + FirstName: "gopher", + LastName: "lang", + Username: "gopher", + Password: "lang", + Email: "lang@test.com", + Phone: "5101112222", + UserStatus: 1} + + apiResponse, err := client.UserApi.CreateUser(context.Background(), newUser) + + if err != nil { + t.Fatalf("Error while adding user: %v", err) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } +} + +//adding x to skip the test, currently it is failing +func TestCreateUsersWithArrayInput(t *testing.T) { + newUsers := []sw.User{ + sw.User{ + Id: int64(1001), + FirstName: "gopher1", + LastName: "lang1", + Username: "gopher1", + Password: "lang1", + Email: "lang1@test.com", + Phone: "5101112222", + UserStatus: int32(1), + }, + sw.User{ + Id: int64(1002), + FirstName: "gopher2", + LastName: "lang2", + Username: "gopher2", + Password: "lang2", + Email: "lang2@test.com", + Phone: "5101112222", + UserStatus: int32(1), + }, + } + + apiResponse, err := client.UserApi.CreateUsersWithArrayInput(context.Background(), newUsers) + if err != nil { + t.Fatalf("Error while adding users: %v", err) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } + + //tear down + _, err1 := client.UserApi.DeleteUser(context.Background(), "gopher1") + if err1 != nil { + t.Errorf("Error while deleting user") + t.Log(err1) + } + + _, err2 := client.UserApi.DeleteUser(context.Background(), "gopher2") + if err2 != nil { + t.Errorf("Error while deleting user") + t.Log(err2) + } +} + +func TestGetUserByName(t *testing.T) { + assert := assert.New(t) + + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher") + if err != nil { + t.Fatalf("Error while getting user by id: %v", err) + } else { + assert.Equal(resp.Id, int64(1000), "User id should be equal") + assert.Equal(resp.Username, "gopher", "User name should be gopher") + assert.Equal(resp.LastName, "lang", "Last name should be lang") + //t.Log(resp) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } +} + +func TestGetUserByNameWithInvalidID(t *testing.T) { + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "999999999") + if apiResponse != nil && apiResponse.StatusCode == 404 { + return // This is a pass condition. API will return with a 404 error. + } else if err != nil { + t.Fatalf("Error while getting user by invalid id: %v", err) + t.Log(apiResponse) + } else { + t.Log(resp) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } +} + +func TestUpdateUser(t *testing.T) { + assert := assert.New(t) + + newUser := sw.User{ + Id: 1000, + FirstName: "gopher20", + LastName: "lang20", + Username: "gopher", + Password: "lang", + Email: "lang@test.com", + Phone: "5101112222", + UserStatus: 1} + + apiResponse, err := client.UserApi.UpdateUser(context.Background(), "gopher", newUser) + if err != nil { + t.Fatalf("Error while deleting user by id: %v", err) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } + + //verify changings are correct + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher") + if err != nil { + t.Fatalf("Error while getting user by id: %v", err) + } else { + assert.Equal(resp.Id, int64(1000), "User id should be equal") + assert.Equal(resp.FirstName, "gopher20", "User name should be gopher") + assert.Equal(resp.Password, "lang", "User name should be the same") + } +} + +func TestDeleteUser(t *testing.T) { + apiResponse, err := client.UserApi.DeleteUser(context.Background(), "gopher") + + if err != nil { + t.Fatalf("Error while deleting user: %v", err) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } +} From 327ffc10bb7bb496add13ec8dd15911f8a05afd5 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Thu, 23 Jan 2020 18:35:56 -0800 Subject: [PATCH 19/85] [HttpBasicAuth] Use positive isBasicBasic tag instead of negative isBasicBearer (#5095) * use positive isBasicBasic tag instead of negative isBasicBearer * use positive isBasicBasic tag instead of negative isBasicBearer --- .../src/main/resources/Javascript/ApiClient.mustache | 4 ++-- .../src/main/resources/Javascript/README.mustache | 8 ++++---- .../src/main/resources/Javascript/api_doc.mustache | 4 ++-- .../src/main/resources/Javascript/es6/ApiClient.mustache | 4 ++-- .../src/main/resources/Javascript/es6/README.mustache | 8 ++++---- .../src/main/resources/Javascript/es6/api_doc.mustache | 4 ++-- .../main/resources/asciidoc-documentation/index.mustache | 2 +- .../src/main/resources/kotlin-client/api_doc.mustache | 4 ++-- .../jvm-okhttp/infrastructure/ApiClient.kt.mustache | 4 ++-- .../src/main/resources/perl/ApiClient.mustache | 4 ++-- .../src/main/resources/perl/api_doc.mustache | 4 ++-- .../src/main/resources/php/README.mustache | 4 ++-- .../openapi-generator/src/main/resources/php/api.mustache | 4 ++-- .../src/main/resources/php/php_doc_auth_partial.mustache | 4 ++-- .../src/main/resources/python/api_doc.mustache | 4 ++-- .../src/main/resources/python/common_README.mustache | 4 ++-- .../src/main/resources/python/configuration.mustache | 4 ++-- .../python/python-experimental/README_common.mustache | 4 ++-- .../resources/python/python-experimental/api_doc.mustache | 4 ++-- .../resources/python/python_doc_auth_partial.mustache | 4 ++-- .../src/main/resources/ruby-client/README.mustache | 8 ++++---- .../src/main/resources/ruby-client/api_doc.mustache | 4 ++-- .../src/main/resources/ruby-client/configuration.mustache | 4 ++-- .../src/main/resources/rust/reqwest/api.mustache | 4 ++-- .../resources/typescript-angular/api.service.mustache | 4 ++-- 25 files changed, 55 insertions(+), 55 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache index 64c0fab0fd5..47ec095c769 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache @@ -43,9 +43,9 @@ {{/emitJSDoc}}{{=< >=}} this.authentications = { <#authMethods> <#isBasic> -<^isBasicBearer> +<#isBasicBasic> '': {type: 'basic'}<^-last>, - + <#isBasicBearer> '': {type: 'bearer'}<^-last>,<#bearerFormat> // <&.> diff --git a/modules/openapi-generator/src/main/resources/Javascript/README.mustache b/modules/openapi-generator/src/main/resources/Javascript/README.mustache index 71c05df8b37..2e3ea8723ab 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/README.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/README.mustache @@ -100,12 +100,12 @@ var {{{moduleName}}} = require('{{{projectName}}}'); var defaultClient = {{{moduleName}}}.ApiClient.instance; {{#authMethods}} {{#isBasic}} -{{^isBasicBearer}} +{{#isBasicBasic}} // Configure HTTP basic authorization: {{{name}}} var {{{name}}} = defaultClient.authentications['{{{name}}}']; {{{name}}}.username = 'YOUR USERNAME' {{{name}}}.password = 'YOUR PASSWORD' -{{/isBasicBearer}} +{{/isBasicBasic}} {{#isBasicBearer}} // Configure Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} access token for authorization: {{{name}}} var {{{name}}} = defaultClient.authentications['{{{name}}}']; @@ -192,10 +192,10 @@ All endpoints do not require authorization. - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} {{#isBasic}} -{{^isBasicBearer}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasicBearer}} +{{/isBasicBasic}} {{#isBasicBearer}} - **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} diff --git a/modules/openapi-generator/src/main/resources/Javascript/api_doc.mustache b/modules/openapi-generator/src/main/resources/Javascript/api_doc.mustache index 8d0e1c7e083..06b390cbcb5 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/api_doc.mustache @@ -28,12 +28,12 @@ var {{{moduleName}}} = require('{{{projectName}}}'); var defaultClient = {{{moduleName}}}.ApiClient.instance; {{#authMethods}} {{#isBasic}} -{{^isBasicBearer}} +{{#isBasicBasic}} // Configure HTTP basic authorization: {{{name}}} var {{{name}}} = defaultClient.authentications['{{{name}}}']; {{{name}}}.username = 'YOUR USERNAME'; {{{name}}}.password = 'YOUR PASSWORD'; -{{/isBasicBearer}} +{{/isBasicBasic}} {{#isBasicBearer}} // Configure Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} access token for authorization: {{{name}}} var {{{name}}} = defaultClient.authentications['{{{name}}}']; 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 fd4fb57e7d9..f98d9fbf3e5 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache @@ -31,9 +31,9 @@ class ApiClient { this.authentications = { <#authMethods> <#isBasic> -<^isBasicBearer> +<#isBasicBasic> '': {type: 'basic'}<^-last>, - + <#isBasicBearer> '': {type: 'bearer'}<^-last>,<#bearerFormat> // <&.> diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/README.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/README.mustache index 82a66fe391b..944e6029d52 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/README.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/README.mustache @@ -112,12 +112,12 @@ var {{{moduleName}}} = require('{{{projectName}}}'); var defaultClient = {{{moduleName}}}.ApiClient.instance; {{#authMethods}} {{#isBasic}} -{{^isBasicBearer}} +{{#isBasicBasic}} // Configure HTTP basic authorization: {{{name}}} var {{{name}}} = defaultClient.authentications['{{{name}}}']; {{{name}}}.username = 'YOUR USERNAME' {{{name}}}.password = 'YOUR PASSWORD' -{{/isBasicBearer}} +{{/isBasicBasic}} {{#isBasicBearer}} // Configure Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} access token for authorization: {{{name}}} var {{{name}}} = defaultClient.authentications['{{{name}}}']; @@ -206,9 +206,9 @@ All endpoints do not require authorization. - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} {{#isBasic}} -{{^isBasicBearer}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasicBearer}} +{{/isBasicBasic}} {{#isBasicBearer}} - **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} {{/isBasicBearer}} diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/api_doc.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/api_doc.mustache index a728416ad98..47f5a32f183 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/api_doc.mustache @@ -28,12 +28,12 @@ import {{{moduleName}}} from '{{{projectName}}}'; let defaultClient = {{{moduleName}}}.ApiClient.instance; {{#authMethods}} {{#isBasic}} -{{^isBasicBearer}} +{{#isBasicBasic}} // Configure HTTP basic authorization: {{{name}}} let {{{name}}} = defaultClient.authentications['{{{name}}}']; {{{name}}}.username = 'YOUR USERNAME'; {{{name}}}.password = 'YOUR PASSWORD'; -{{/isBasicBearer}} +{{/isBasicBasic}} {{#isBasicBearer}} // Configure Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} access token for authorization: {{{name}}} let {{{name}}} = defaultClient.authentications['{{{name}}}']; diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache index 910b46266aa..664cac30920 100644 --- a/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache @@ -25,7 +25,7 @@ {{#authMethods}} {{#isBasic}} -{{^isBasicBearer}}* *HTTP Basic* Authentication _{{{name}}}_{{/isBasicBearer}} +{{#isBasicBasic}}* *HTTP Basic* Authentication _{{{name}}}_{{/isBasicBasic}} {{#isBasicBearer}}* *Bearer* Authentication {{/isBasicBearer}} {{/isBasic}} {{#isOAuth}}* *OAuth* AuthorizationUrl: _{{authorizationUrl}}_, TokenUrl: _{{tokenUrl}}_ {{/isOAuth}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/api_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/api_doc.mustache index bd8e293b621..70affc2aa13 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/api_doc.mustache @@ -62,11 +62,11 @@ Configure {{name}}: ApiClient.apiKeyPrefix["{{keyParamName}}"] = "" {{/isApiKey}} {{#isBasic}} -{{^isBasicBearer}} +{{#isBasicBasic}} Configure {{name}}: ApiClient.username = "" ApiClient.password = "" -{{/isBasicBearer}} +{{/isBasicBasic}} {{#isBasicBearer}} Configure {{name}}: ApiClient.accessToken = "" diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache index 2dbb50da9f3..90080744c69 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache @@ -134,7 +134,7 @@ import java.io.File } {{/isApiKey}} {{#isBasic}} - {{^isBasicBearer}} + {{#isBasicBasic}} if (requestConfig.headers[Authorization].isNullOrEmpty()) { username?.let { username -> password?.let { password -> @@ -142,7 +142,7 @@ import java.io.File } } } - {{/isBasicBearer}} + {{/isBasicBasic}} {{#isBasicBearer}} if (requestConfig.headers[Authorization].isNullOrEmpty()) { accessToken?.let { accessToken -> diff --git a/modules/openapi-generator/src/main/resources/perl/ApiClient.mustache b/modules/openapi-generator/src/main/resources/perl/ApiClient.mustache index 8175c47d623..4c8b48cc136 100644 --- a/modules/openapi-generator/src/main/resources/perl/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/perl/ApiClient.mustache @@ -340,11 +340,11 @@ sub update_params_for_auth { {{/isKeyInQuery}} {{/isApiKey}} {{#isBasic}} - {{^isBasicBearer}} + {{#isBasicBasic}} if ($self->{config}{username} || $self->{config}{password}) { $header_params->{'Authorization'} = 'Basic ' . encode_base64($self->{config}{username} . ":" . $self->{config}{password}); } - {{/isBasicBearer}} + {{/isBasicBasic}} {{#isBasicBearer}} // this endpoint requires Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} authentication (access token) if ($self->{config}{access_token}) { diff --git a/modules/openapi-generator/src/main/resources/perl/api_doc.mustache b/modules/openapi-generator/src/main/resources/perl/api_doc.mustache index bcbc7b41345..d69dbde3316 100644 --- a/modules/openapi-generator/src/main/resources/perl/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/perl/api_doc.mustache @@ -29,10 +29,10 @@ use {{moduleName}}::{{classname}}; my $api_instance = {{moduleName}}::{{classname}}->new( {{#hasAuthMethods}}{{#authMethods}}{{#isBasic}} # Configure HTTP basic authorization: {{{name}}} - {{^isBasicBearer}} + {{#isBasicBasic}} username => 'YOUR_USERNAME', password => 'YOUR_PASSWORD', - {{/isBasicBearer}} + {{/isBasicBasic}} {{#isBasicBearer}} # Configure bearer access token for authorization: {{{name}}} access_token => 'YOUR_BEARER_TOKEN', diff --git a/modules/openapi-generator/src/main/resources/php/README.mustache b/modules/openapi-generator/src/main/resources/php/README.mustache index 688fcf2370f..5d6e8c93ef9 100644 --- a/modules/openapi-generator/src/main/resources/php/README.mustache +++ b/modules/openapi-generator/src/main/resources/php/README.mustache @@ -122,10 +122,10 @@ All endpoints do not require authorization. {{/isApiKey}} {{#isBasic}} -{{^isBasicBearer}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasicBearer}} +{{/isBasicBasic}} {{#isBasicBearer}} - **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} diff --git a/modules/openapi-generator/src/main/resources/php/api.mustache b/modules/openapi-generator/src/main/resources/php/api.mustache index 34fc0b3057f..2e3fa819ce7 100644 --- a/modules/openapi-generator/src/main/resources/php/api.mustache +++ b/modules/openapi-generator/src/main/resources/php/api.mustache @@ -579,12 +579,12 @@ use {{invokerPackage}}\ObjectSerializer; } {{/isApiKey}} {{#isBasic}} - {{^isBasicBearer}} + {{#isBasicBasic}} // this endpoint requires HTTP basic authentication if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } - {{/isBasicBearer}} + {{/isBasicBasic}} {{#isBasicBearer}} // this endpoint requires Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} authentication (access token) if ($this->config->getAccessToken() !== null) { diff --git a/modules/openapi-generator/src/main/resources/php/php_doc_auth_partial.mustache b/modules/openapi-generator/src/main/resources/php/php_doc_auth_partial.mustache index bae21c03a0f..5c51e7c4e7e 100644 --- a/modules/openapi-generator/src/main/resources/php/php_doc_auth_partial.mustache +++ b/modules/openapi-generator/src/main/resources/php/php_doc_auth_partial.mustache @@ -2,12 +2,12 @@ {{#authMethods}} {{#isBasic}} -{{^isBasicBearer}} +{{#isBasicBasic}} // Configure HTTP basic authorization: {{{name}}} $config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration() ->setUsername('YOUR_USERNAME') ->setPassword('YOUR_PASSWORD'); -{{/isBasicBearer}} +{{/isBasicBasic}} {{#isBasicBearer}} // Configure Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} authorization: {{{name}}} $config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); diff --git a/modules/openapi-generator/src/main/resources/python/api_doc.mustache b/modules/openapi-generator/src/main/resources/python/api_doc.mustache index 1df5389c5cf..fb537ad30b2 100644 --- a/modules/openapi-generator/src/main/resources/python/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_doc.mustache @@ -22,9 +22,9 @@ Method | HTTP request | Description {{#hasAuthMethods}} {{#authMethods}} {{#isBasic}} -{{^isBasicBearer}} +{{#isBasicBasic}} * Basic Authentication ({{name}}): -{{/isBasicBearer}} +{{/isBasicBasic}} {{#isBasicBearer}} * Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} Authentication ({{name}}): {{/isBasicBearer}} diff --git a/modules/openapi-generator/src/main/resources/python/common_README.mustache b/modules/openapi-generator/src/main/resources/python/common_README.mustache index 7238703c4bb..7de8c9ef098 100644 --- a/modules/openapi-generator/src/main/resources/python/common_README.mustache +++ b/modules/openapi-generator/src/main/resources/python/common_README.mustache @@ -51,9 +51,9 @@ Class | Method | HTTP request | Description - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} {{#isBasic}} -{{^isBasicBearer}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasicBearer}} +{{/isBasicBasic}} {{#isBasicBearer}} - **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} {{/isBasicBearer}} diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index f53b6f4197c..1aed945621f 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -297,7 +297,7 @@ class Configuration(object): } {{/isApiKey}} {{#isBasic}} - {{^isBasicBearer}} + {{#isBasicBasic}} if self.username is not None and self.password is not None: auth['{{name}}'] = { 'type': 'basic', @@ -305,7 +305,7 @@ class Configuration(object): 'key': 'Authorization', 'value': self.get_basic_auth_token() } - {{/isBasicBearer}} + {{/isBasicBasic}} {{#isBasicBearer}} if self.access_token is not None: auth['{{name}}'] = { diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache index a8b66b0bed5..d8185eea5a0 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache @@ -50,9 +50,9 @@ Class | Method | HTTP request | Description - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} {{#isBasic}} -{{^isBasicBearer}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasicBearer}} +{{/isBasicBasic}} {{#isBasicBearer}} - **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} {{/isBasicBearer}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc.mustache index 4feb612f1c6..10317b4b48d 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc.mustache @@ -22,9 +22,9 @@ Method | HTTP request | Description {{#hasAuthMethods}} {{#authMethods}} {{#isBasic}} -{{^isBasicBearer}} +{{#isBasicBasic}} * Basic Authentication ({{name}}): -{{/isBasicBearer}} +{{/isBasicBasic}} {{#isBasicBearer}} * Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} Authentication ({{name}}): {{/isBasicBearer}} diff --git a/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache b/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache index 899e4b58b92..2e744261030 100644 --- a/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache +++ b/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache @@ -2,11 +2,11 @@ {{#authMethods}} configuration = {{{packageName}}}.Configuration() {{#isBasic}} -{{^isBasicBearer}} +{{#isBasicBasic}} # Configure HTTP basic authorization: {{{name}}} configuration.username = 'YOUR_USERNAME' configuration.password = 'YOUR_PASSWORD' -{{/isBasicBearer}} +{{/isBasicBasic}} {{#isBasicBearer}} # Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}} configuration.access_token = 'YOUR_BEARER_TOKEN' diff --git a/modules/openapi-generator/src/main/resources/ruby-client/README.mustache b/modules/openapi-generator/src/main/resources/ruby-client/README.mustache index 5303a2f7797..a527f6ce9d7 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/README.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/README.mustache @@ -65,10 +65,10 @@ Please follow the [installation](#installation) procedure and then run the follo require '{{{gemName}}}' {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}{{#hasAuthMethods}} # Setup authorization -{{{moduleName}}}.configure do |config|{{#authMethods}}{{#isBasic}}{{^isBasicBearer}} +{{{moduleName}}}.configure do |config|{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} # Configure HTTP basic authorization: {{{name}}} config.username = 'YOUR_USERNAME' - config.password = 'YOUR_PASSWORD'{{/isBasicBearer}}{{#isBasicBearer}} + config.password = 'YOUR_PASSWORD'{{/isBasicBasic}}{{#isBasicBearer}} # Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}} config.access_token = 'YOUR_BEARER_TOKEN'{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} # Configure API key authorization: {{{name}}} @@ -131,8 +131,8 @@ Class | Method | HTTP request | Description - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} {{#isBasic}} -{{^isBasicBearer}}- **Type**: HTTP basic authentication -{{/isBasicBearer}}{{#isBasicBearer}}- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{#isBasicBasic}}- **Type**: HTTP basic authentication +{{/isBasicBasic}}{{#isBasicBearer}}- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} {{/isBasicBearer}} {{/isBasic}} {{#isOAuth}} diff --git a/modules/openapi-generator/src/main/resources/ruby-client/api_doc.mustache b/modules/openapi-generator/src/main/resources/ruby-client/api_doc.mustache index dc163725e16..0e5d35513e3 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/api_doc.mustache @@ -27,10 +27,10 @@ Method | HTTP request | Description require '{{{gemName}}}' {{#hasAuthMethods}} # setup authorization -{{{moduleName}}}.configure do |config|{{#authMethods}}{{#isBasic}}{{^isBasicBearer}} +{{{moduleName}}}.configure do |config|{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} # Configure HTTP basic authorization: {{{name}}} config.username = 'YOUR USERNAME' - config.password = 'YOUR PASSWORD'{{/isBasicBearer}}{{#isBasicBearer}} + config.password = 'YOUR PASSWORD'{{/isBasicBasic}}{{#isBasicBearer}} # Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}} config.access_token = 'YOUR_BEARER_TOKEN'{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} # Configure API key authorization: {{{name}}} diff --git a/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache b/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache index 3c2f87e37e4..5e2f57980c4 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache @@ -176,7 +176,7 @@ module {{moduleName}} }, {{/isApiKey}} {{#isBasic}} -{{^isBasicBearer}} +{{#isBasicBasic}} '{{name}}' => { type: 'basic', @@ -184,7 +184,7 @@ module {{moduleName}} key: 'Authorization', value: basic_auth_token }, -{{/isBasicBearer}} +{{/isBasicBasic}} {{#isBasicBearer}} '{{name}}' => { diff --git a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache index 448f6c302c9..dc2a9edb488 100644 --- a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache +++ b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache @@ -102,11 +102,11 @@ impl {{{classname}}} for {{{classname}}}Client { {{/isKeyInHeader}} {{/isApiKey}} {{#isBasic}} - {{^isBasicBearer}} + {{#isBasicBasic}} if let Some(ref auth_conf) = configuration.basic_auth { req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); }; - {{/isBasicBearer}} + {{/isBasicBasic}} {{#isBasicBearer}} if let Some(ref token) = configuration.bearer_access_token { req_builder = req_builder.bearer_auth(token.to_owned()); diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index 912ecf6e5ac..c719ae838d6 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -258,11 +258,11 @@ export class {{classname}} { {{/isKeyInQuery}} {{/isApiKey}} {{#isBasic}} - {{^isBasicBearer}} + {{#isBasicBasic}} if (this.configuration.username || this.configuration.password) { {{#useHttpClient}}headers = {{/useHttpClient}}headers.set('Authorization', 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password)); } - {{/isBasicBearer}} + {{/isBasicBasic}} {{#isBasicBearer}} if (this.configuration.accessToken) { const accessToken = typeof this.configuration.accessToken === 'function' From 09fd494836c91d5c2531f9010b0f04f1ff9d27f3 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Thu, 23 Jan 2020 23:46:07 -0500 Subject: [PATCH 20/85] Adds jacoco for code coverage (#5084) * Adds jacoco for code coverage This sets up jacoco instrumentation for code coverage. Preparing for master and PR coverage reporting via sonarcloud. * Set initial required coverage to 0 --- pom.xml | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c4fb85ca131..2bfd23742cf 100644 --- a/pom.xml +++ b/pom.xml @@ -150,6 +150,52 @@ --> + + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + + default-check + + check + + + + + PACKAGE + + + LINE + COVEREDRATIO + 0 + + + + + + + + + + **/gradle-wrapper.jar + + + org.apache.maven.plugins maven-surefire-plugin @@ -159,8 +205,18 @@ false none:none org.testng:testng - -XX:+StartAttachListener + @{argLine} -XX:+StartAttachListener + + + + org.jacoco + org.jacoco.agent + runtime + ${jacoco.version} + runtime + + maven-dependency-plugin @@ -1407,5 +1463,6 @@ 3.0.0-M3 0.9.10 3.2.0 + 0.8.5 From b77bffeae14f4d33761ae15bc4cca8030da945d7 Mon Sep 17 00:00:00 2001 From: Chris Couzens Date: Fri, 24 Jan 2020 06:16:35 +0000 Subject: [PATCH 21/85] Typescript axios: remove use of `btoa` (#5098) btoa (binary to ascii), is a javascript function to base64 encode a string. Axios is usable both from node and from the browser. But the btoa function is available only in the browser. This meant that any client that used basic auth was broken in node. Axios has its own method of encoding basic auth credentials. This method works in both the browser and node. https://github.com/axios/axios/blame/v0.19.2/README.md#L318 By using this method, the generated client works in node and in the browser. This solves this comment on this issue. https://github.com/OpenAPITools/openapi-generator/issues/3049#issuecomment-498278966 I have validated this change within a personal project: https://github.com/ccouzens/create-vdc-with-edge-portal-api-demo/commit/df8b552f5f8b7528bd0b003b1c5b5558dd05eabf#diff-e91249994e03dd6af8c6bee4ff7d8381 --- .../src/main/resources/typescript-axios/apiInner.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 dc839d57cf7..deaeb9319ec 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -78,7 +78,7 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur {{#isBasicBasic}} // http basic authentication required if (configuration && (configuration.username || configuration.password)) { - localVarHeaderParameter["Authorization"] = "Basic " + btoa(configuration.username + ":" + configuration.password); + localVarRequestOptions["auth"] = { username: configuration.username, password: configuration.password }; } {{/isBasicBasic}} {{#isBasicBearer}} From 524ef63e3745ce82daa3a2d1f171733e400264c8 Mon Sep 17 00:00:00 2001 From: Mila Rodriguez Date: Fri, 24 Jan 2020 00:56:15 -0700 Subject: [PATCH 22/85] Fix typescript model kebab-cased filenames #5073 (#5085) Updated StringUtils to collapse consecutive underscores and/or whitespace into a single dash when "dashizing". --- .../codegen/utils/StringUtils.java | 2 +- .../TypeScriptAngularClientCodegenTest.java | 21 +++++++++++++++++++ .../TypeScriptAngularModelTest.java | 20 ++++++++++++++++++ .../codegen/utils/StringUtilsTest.java | 2 ++ 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java index c3035fabc21..aa80e681d83 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java @@ -40,7 +40,7 @@ public class StringUtils { * @return The dashized version of the word, e.g. "my-name" */ public static String dashize(String word) { - return underscore(word).replaceAll("[_ ]", "-"); + return underscore(word).replaceAll("[_ ]+", "-"); } /** diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java index b0489ac2218..b106a0be88e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java @@ -5,6 +5,7 @@ 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.media.StringSchema; import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.responses.ApiResponses; import org.openapitools.codegen.CodegenOperation; @@ -132,4 +133,24 @@ public class TypeScriptAngularClientCodegenTest { Assert.assertEquals(schemaType, "SchemaOne | SchemaTwo | SchemaThree"); } + @Test + public void testKebabCasedModelFilenames() { + TypeScriptAngularClientCodegen codegen = new TypeScriptAngularClientCodegen(); + codegen.additionalProperties().put(TypeScriptAngularClientCodegen.FILE_NAMING, "kebab-case"); + codegen.processOpts(); + + final String modelName = "FooResponse__links"; + final Schema schema = new Schema() + .name(modelName) + .description("an inline model with name previously prefixed with underscore") + .addRequiredItem("self") + .addProperties("self", new StringSchema()); + + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("test", schema); + codegen.setOpenAPI(openAPI); + + Assert.assertEquals(codegen.toModelImport(modelName), "model/foo-response-links"); + Assert.assertEquals(codegen.toModelFilename(modelName), "./foo-response-links"); + + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularModelTest.java index 32c028ed5ae..35a01220ce6 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularModelTest.java @@ -21,6 +21,7 @@ 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.CodegenConstants; import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.DefaultCodegen; @@ -304,4 +305,23 @@ public class TypeScriptAngularModelTest { Assert.assertFalse(property.isContainer); } + @Test(description = "convert an inline model that originally had a name prefixed with an underscore") + public void inlineModelWithUnderscoreNameTest() { + // Originally parent model "FooResponse" with inline model called "_links". The InlineModelResolver resolves + // that to "FooResponse__links" (double underscore) + final Schema schema = new Schema() + .description("an inline model with name previously prefixed with underscore") + .addRequiredItem("self") + .addProperties("self", new StringSchema()); + + TypeScriptAngularClientCodegen codegen = new TypeScriptAngularClientCodegen(); + codegen.additionalProperties().put(TypeScriptAngularClientCodegen.FILE_NAMING, "kebab-case"); + codegen.processOpts(); + + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); + codegen.setOpenAPI(openAPI); + + final CodegenModel cm = codegen.fromModel("FooResponse__links", schema); + Assert.assertEquals(cm.getClassFilename(), "./foo-response-links", "The generated filename should not have a double hyphen."); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/StringUtilsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/StringUtilsTest.java index 5073471c080..d4a8efebae5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/StringUtilsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/utils/StringUtilsTest.java @@ -35,5 +35,7 @@ public class StringUtilsTest { Assert.assertEquals(dashize("abcd"), "abcd"); Assert.assertEquals(dashize("some-value"), "some-value"); Assert.assertEquals(dashize("some_value"), "some-value"); + Assert.assertEquals(dashize("Foo_Response__links"), "foo-response-links"); + Assert.assertEquals(dashize("Foo Response _links"), "foo-response-links"); } } From 15d31f753de1f2218b83f81f61c23a2e697c2405 Mon Sep 17 00:00:00 2001 From: Alexey Makhrov Date: Fri, 24 Jan 2020 13:59:48 -0800 Subject: [PATCH 23/85] [typescript-angular] Sanitize/transform model name after appending model suffix (#5105) This makes sure the final (suffixed) model name is checked against the TS keywords / reserved names. --- .../languages/TypeScriptAngularClientCodegen.java | 8 ++++---- .../TypeScriptAngularClientCodegenTest.java | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) 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 ef306878970..67528278944 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 @@ -604,11 +604,11 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode @Override public String toModelName(String name) { - String modelName = super.toModelName(name); - if (modelSuffix.length() == 0 || modelName.endsWith(modelSuffix)) { - return modelName; + if (modelSuffix.length() != 0 && !name.endsWith(modelSuffix)) { + name = name + modelSuffix; } - return modelName + modelSuffix; + + return super.toModelName(name); } public String removeModelPrefixSuffix(String name) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java index b106a0be88e..394ddc72e4e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java @@ -16,6 +16,16 @@ import org.testng.annotations.Test; public class TypeScriptAngularClientCodegenTest { + @Test + public void testModelSuffix() { + TypeScriptAngularClientCodegen codegen = new TypeScriptAngularClientCodegen(); + codegen.additionalProperties().put("modelSuffix", "MySuffix"); + codegen.processOpts(); + + Assert.assertEquals(codegen.toModelName("TestName"), "TestNameMySuffix"); + Assert.assertEquals(codegen.toModelName("Error"), "ErrorMySuffix"); + } + @Test public void testModelFileSuffix() { TypeScriptAngularClientCodegen codegen = new TypeScriptAngularClientCodegen(); From 5220d7cd59ce76c370cf5acf16272e13bd957910 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Fri, 24 Jan 2020 22:13:08 -0500 Subject: [PATCH 24/85] Create sonar.yml --- .github/workflows/sonar.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/sonar.yml diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml new file mode 100644 index 00000000000..c99f2cf2981 --- /dev/null +++ b/.github/workflows/sonar.yml @@ -0,0 +1,25 @@ +name: Sonar CI +on: + push: + branches: + - master + - '[4-9]+.[0-9]+.[0-9]+' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Publish to Sonar + run: mvn sonar:sonar \ + -Dsonar.projectKey=OpenAPITools_openapi-generator \ + -Dsonar.organization=openapitools \ + -Dsonar.host.url=https://sonarcloud.io \ + -Dsonar.login=${{ secrets.SONAR_LOGIN }} \ + -Dsonar.branch.name=${{ github.ref }} From 43b6272fc6a1348b8c06e988591a7dad62b1301f Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Fri, 24 Jan 2020 22:18:13 -0500 Subject: [PATCH 25/85] Update sonar.yml --- .github/workflows/sonar.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index c99f2cf2981..c921a08c479 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -17,9 +17,4 @@ jobs: with: java-version: 1.8 - name: Publish to Sonar - run: mvn sonar:sonar \ - -Dsonar.projectKey=OpenAPITools_openapi-generator \ - -Dsonar.organization=openapitools \ - -Dsonar.host.url=https://sonarcloud.io \ - -Dsonar.login=${{ secrets.SONAR_LOGIN }} \ - -Dsonar.branch.name=${{ github.ref }} + run: mvn sonar:sonar -Dsonar.projectKey=OpenAPITools_openapi-generator -Dsonar.organization=openapitools -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_LOGIN }} -Dsonar.branch.name=${{ github.ref }} From 9928f3c375b8ab649b8256a4d58ce11793997e7e Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Fri, 24 Jan 2020 22:25:58 -0500 Subject: [PATCH 26/85] Update sonar.yml --- .github/workflows/sonar.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index c921a08c479..6fc8603880c 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -16,5 +16,9 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 + - name: Compile with Maven + run: mvn clean package jacoco:report + - name: Jacoco Aggregate + run: mvn jacoco:report-aggregate - name: Publish to Sonar run: mvn sonar:sonar -Dsonar.projectKey=OpenAPITools_openapi-generator -Dsonar.organization=openapitools -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_LOGIN }} -Dsonar.branch.name=${{ github.ref }} From ad4a9df328a826b070bc1d60b0e7ebd187d79bf2 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Fri, 24 Jan 2020 22:37:27 -0500 Subject: [PATCH 27/85] Update sonar.yml Set GITHUB_REF with replacement to remove refs/heads prefix --- .github/workflows/sonar.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 6fc8603880c..76c8a9a864f 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -21,4 +21,4 @@ jobs: - name: Jacoco Aggregate run: mvn jacoco:report-aggregate - name: Publish to Sonar - run: mvn sonar:sonar -Dsonar.projectKey=OpenAPITools_openapi-generator -Dsonar.organization=openapitools -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_LOGIN }} -Dsonar.branch.name=${{ github.ref }} + run: mvn sonar:sonar -Dsonar.projectKey=OpenAPITools_openapi-generator -Dsonar.organization=openapitools -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_LOGIN }} -Dsonar.branch.name=${GITHUB_REF##*/} From c9ec084418df9d1df0e3bb8d552bc110348bdfd8 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Sat, 25 Jan 2020 18:28:16 -0500 Subject: [PATCH 28/85] :bug: Fixing some issues with threading and NPE (#5107) * :bug: Fixing some issues with threading and NPE After running Sonar on the master branch, some major analysis opportunities were displayed. This fixes the use of SimpleDateFormat stored as static fields. SimpleDateFormat is not thread-safe, and may retain data across threads. While there's no indicator that this has caused any issues (these are mostly used for example code), we should follow these best practices. This also fixes a handful of NPE and other minor issues such as comparing Boolean.TRUE to strings and no wrapping some closeables in try-with-resources. * [cli] Unit test GenerateBatch custom deserialization helper * Quiet batch mode in sonar.yml * Suppress unnecessary warnings (ThreadLocals in static fields) --- .github/workflows/sonar.yml | 2 +- bin/ci/java-jaxrs-datelib-j8.json | 2 +- .../java-jaxrs-resteasy-eap-java8-server.json | 2 +- .../java-jaxrs-resteasy-eap-joda-server.json | 2 +- bin/ci/java-jaxrs-resteasy-joda-server.json | 2 +- .../codegen/cmd/GenerateBatch.java | 49 +++++--- .../codegen/cmd/GenerateBatchTest.java | 102 ++++++++++++++++ .../batch/common/jaxrs-datelib-j8.json | 7 ++ .../batch/common/jaxrs-datelib-j8.yaml | 6 + .../batch/jaxrs-datelib-j8-json-include.yaml | 8 ++ .../batch/jaxrs-datelib-j8-yaml-include.json | 10 ++ .../resources/batch/jaxrs-datelib-j8.json | 10 ++ .../resources/batch/jaxrs-datelib-j8.yaml | 8 ++ .../test/resources/batch/specs/petstore.yaml | 111 ++++++++++++++++++ .../codegen/plugin/CodeGenMojo.java | 13 +- .../AbstractTypeScriptClientCodegen.java | 10 +- .../languages/JavaCXFExtServerCodegen.java | 63 +++++----- .../PythonAbstractConnexionServerCodegen.java | 4 +- .../PythonClientExperimentalCodegen.java | 2 +- .../codegen/languages/RClientCodegen.java | 6 +- .../codegen/languages/RustServerCodegen.java | 7 +- .../codegen/languages/Swift4Codegen.java | 4 +- .../languages/Swift5ClientCodegen.java | 4 +- .../TypeScriptFetchClientCodegen.java | 2 +- .../TypeScriptReduxQueryClientCodegen.java | 2 +- .../codegen/utils/ModelUtils.java | 16 +-- .../codegen/utils/URLPathUtils.java | 36 +++--- 27 files changed, 380 insertions(+), 110 deletions(-) create mode 100644 modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateBatchTest.java create mode 100644 modules/openapi-generator-cli/src/test/resources/batch/common/jaxrs-datelib-j8.json create mode 100644 modules/openapi-generator-cli/src/test/resources/batch/common/jaxrs-datelib-j8.yaml create mode 100644 modules/openapi-generator-cli/src/test/resources/batch/jaxrs-datelib-j8-json-include.yaml create mode 100644 modules/openapi-generator-cli/src/test/resources/batch/jaxrs-datelib-j8-yaml-include.json create mode 100644 modules/openapi-generator-cli/src/test/resources/batch/jaxrs-datelib-j8.json create mode 100644 modules/openapi-generator-cli/src/test/resources/batch/jaxrs-datelib-j8.yaml create mode 100644 modules/openapi-generator-cli/src/test/resources/batch/specs/petstore.yaml diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 76c8a9a864f..dbe6db54b6e 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -21,4 +21,4 @@ jobs: - name: Jacoco Aggregate run: mvn jacoco:report-aggregate - name: Publish to Sonar - run: mvn sonar:sonar -Dsonar.projectKey=OpenAPITools_openapi-generator -Dsonar.organization=openapitools -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_LOGIN }} -Dsonar.branch.name=${GITHUB_REF##*/} + run: mvn -B -q sonar:sonar -Dsonar.projectKey=OpenAPITools_openapi-generator -Dsonar.organization=openapitools -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_LOGIN }} -Dsonar.branch.name=${GITHUB_REF##*/} diff --git a/bin/ci/java-jaxrs-datelib-j8.json b/bin/ci/java-jaxrs-datelib-j8.json index 89e9b9c7fec..f97c7cfa718 100644 --- a/bin/ci/java-jaxrs-datelib-j8.json +++ b/bin/ci/java-jaxrs-datelib-j8.json @@ -1,5 +1,5 @@ { - "!include": "./bin/jaxrs-datelib-j8.json", + "!include": "bin/jaxrs-datelib-j8.json", "generatorName": "jaxrs-jersey", "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml", "outputDir": "samples/server/petstore/jaxrs-datelib-j8/", diff --git a/bin/ci/java-jaxrs-resteasy-eap-java8-server.json b/bin/ci/java-jaxrs-resteasy-eap-java8-server.json index d16a63b474c..2a7af42d82b 100644 --- a/bin/ci/java-jaxrs-resteasy-eap-java8-server.json +++ b/bin/ci/java-jaxrs-resteasy-eap-java8-server.json @@ -1,5 +1,5 @@ { - "!include": "./bin/jaxrs-resteasy-eap-java8-petstore-server.json", + "!include": "bin/jaxrs-resteasy-eap-java8-petstore-server.json", "artifactId": "jaxrs-resteasy-eap-java8-server", "generatorName": "jaxrs-resteasy-eap", "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", diff --git a/bin/ci/java-jaxrs-resteasy-eap-joda-server.json b/bin/ci/java-jaxrs-resteasy-eap-joda-server.json index d974ed72f8e..242744045b1 100644 --- a/bin/ci/java-jaxrs-resteasy-eap-joda-server.json +++ b/bin/ci/java-jaxrs-resteasy-eap-joda-server.json @@ -1,5 +1,5 @@ { - "!include": "./bin/jaxrs-resteasy-eap-joda-petstore-server.json", + "!include": "bin/jaxrs-resteasy-eap-joda-petstore-server.json", "artifactId": "jaxrs-resteasy-eap-joda-server", "generatorName": "jaxrs-resteasy-eap", "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", diff --git a/bin/ci/java-jaxrs-resteasy-joda-server.json b/bin/ci/java-jaxrs-resteasy-joda-server.json index ea2484571fe..aa243b2b0d2 100644 --- a/bin/ci/java-jaxrs-resteasy-joda-server.json +++ b/bin/ci/java-jaxrs-resteasy-joda-server.json @@ -1,5 +1,5 @@ { - "!include": "./bin/jaxrs-resteasy-joda-petstore-server.json", + "!include": "bin/jaxrs-resteasy-joda-petstore-server.json", "artifactId": "jaxrs-resteasy-joda-server", "generatorName": "jaxrs-resteasy", "inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml", diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java index f1e6632b339..fde5f6ea4a3 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java @@ -123,27 +123,12 @@ public class GenerateBatch implements Runnable { } } - LOGGER.info(String.format(Locale.ROOT, "Batch generation using up to %d threads.\nIncludes: %s\nRoot: %s", numThreads, includesDir.getAbsolutePath(), rootDir.toAbsolutePath().toString())); // Create a module which loads our config files, but supports a special "!include" key which can point to an existing config file. // This allows us to create a sort of meta-config which holds configs which are otherwise required at CLI time (via generate task). // That is, this allows us to create a wrapper config for generatorName, inputSpec, outputDir, etc. - SimpleModule module = new SimpleModule("GenerateBatch"); - module.setDeserializerModifier(new BeanDeserializerModifier() { - @Override - public JsonDeserializer modifyDeserializer(DeserializationConfig config, - BeanDescription bd, JsonDeserializer original) { - JsonDeserializer result; - if (bd.getBeanClass() == DynamicSettings.class) { - result = new DynamicSettingsRefSupport(original, includesDir); - } else { - result = original; - } - return result; - } - }); - + SimpleModule module = getCustomDeserializationModel(includesDir); List configurators = configs.stream().map(config -> CodegenConfigurator.fromFile(config, module)).collect(Collectors.toList()); // it doesn't make sense to interleave INFO level logs, so limit these to only ERROR. @@ -169,6 +154,8 @@ public class GenerateBatch implements Runnable { System.out.println("COMPLETE."); } catch (InterruptedException e) { e.printStackTrace(); + // re-interrupt + Thread.currentThread().interrupt(); } } @@ -227,6 +214,28 @@ public class GenerateBatch implements Runnable { } } + static SimpleModule getCustomDeserializationModel(final File includesDir) { + // Create a module which loads our config files, but supports a special "!include" key which can point to an existing config file. + // This allows us to create a sort of meta-config which holds configs which are otherwise required at CLI time (via generate task). + // That is, this allows us to create a wrapper config for generatorName, inputSpec, outputDir, etc. + SimpleModule module = new SimpleModule("GenerateBatch"); + module.setDeserializerModifier(new BeanDeserializerModifier() { + @Override + public JsonDeserializer modifyDeserializer(DeserializationConfig config, + BeanDescription bd, JsonDeserializer original) { + JsonDeserializer result; + if (bd.getBeanClass() == DynamicSettings.class) { + result = new DynamicSettingsRefSupport(original, includesDir); + } else { + result = original; + } + return result; + } + }); + + return module; + } + static class DynamicSettingsRefSupport extends DelegatingDeserializer { private static final String INCLUDE = "!include"; private File scanDir; @@ -255,11 +264,13 @@ public class GenerateBatch implements Runnable { // load the file into the tree node and continue parsing as normal ((ObjectNode) node).remove(INCLUDE); - JsonParser includeParser = codec.getFactory().createParser(includeFile); - TreeNode includeNode = includeParser.readValueAsTree(); + TreeNode includeNode; + try (JsonParser includeParser = codec.getFactory().createParser(includeFile)) { + includeNode = includeParser.readValueAsTree(); + } ObjectReader reader = codec.readerForUpdating(node); - TreeNode updated = reader.readValue(includeFile); + TreeNode updated = reader.readValue(includeNode.traverse()); JsonParser updatedParser = updated.traverse(); updatedParser.nextToken(); return super.deserialize(updatedParser, ctx); diff --git a/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateBatchTest.java b/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateBatchTest.java new file mode 100644 index 00000000000..c06d7abfb93 --- /dev/null +++ b/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateBatchTest.java @@ -0,0 +1,102 @@ +package org.openapitools.codegen.cmd; + +import com.fasterxml.jackson.databind.module.SimpleModule; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.openapitools.codegen.config.Context; +import org.openapitools.codegen.config.GeneratorSettings; +import org.openapitools.codegen.config.WorkflowSettings; +import org.testng.ITestContext; +import org.testng.TestRunner; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import static org.testng.Assert.*; + +@SuppressWarnings("RedundantThrows") +public class GenerateBatchTest { + private static final String SPEC_FILE = "batch/specs/petstore.yaml"; + private static final String JAXRS_DATELIB_J8_JSON = "jaxrs-datelib-j8.json"; + private static final String JAXRS_DATELIB_J8_YAML = "jaxrs-datelib-j8.yaml"; + private static final String JAXRS_DATELIB_J8_YAML_INCLUDE_JSON = "jaxrs-datelib-j8-yaml-include.json"; + private static final String JAXRS_DATELIB_J8_JSON_INCLUDE_YAML = "jaxrs-datelib-j8-json-include.yaml"; + Path workingDirectory; + + @BeforeTest + public void setUp(ITestContext ctx) throws IOException { + workingDirectory = Paths.get("src", "test", "resources", "batch"); + } + + @DataProvider(name = "customIncludeDeserializerFiles") + public Object[][] customIncludeDeserializerFiles() { + return new Object[][] { + {JAXRS_DATELIB_J8_JSON}, + {JAXRS_DATELIB_J8_YAML}, + {JAXRS_DATELIB_J8_JSON_INCLUDE_YAML} + }; + } + + @Test(dataProvider = "customIncludeDeserializerFiles") + public void testDeserializerWithJsonInclude(String file) throws IOException { + String config = getTargetResourceAsFile(file).toString(); + SimpleModule module = GenerateBatch.getCustomDeserializationModel(getIncludesDir()); + CodegenConfigurator loaded = CodegenConfigurator.fromFile(config, module); + + Map expectedAdditionalProperties = new HashMap<>(); + expectedAdditionalProperties.put("serverPort", "8082"); + expectedAdditionalProperties.put("dateLibrary", "java8"); + expectedAdditionalProperties.put("hideGenerationTimestamp", true); + expectedAdditionalProperties.put("serializableModel", true); + expectedAdditionalProperties.put("withXml", true); + expectedAdditionalProperties.put("java8", true); + expectedAdditionalProperties.put("useBeanValidation", true); + + assertNotNull(loaded); + + Context context = loaded.toContext(); + WorkflowSettings workflowSettings = context.getWorkflowSettings(); + GeneratorSettings generatorSettings = context.getGeneratorSettings(); + + assertNotNull(workflowSettings); + assertNotNull(generatorSettings); + + assertEquals(generatorSettings.getGeneratorName(), "jaxrs-jersey"); + assertEquals(workflowSettings.getOutputDir(), "outputDir"); + assertEquals(workflowSettings.getInputSpec(), SPEC_FILE); + assertTrue(generatorSettings.getAdditionalProperties().size() >= 7); + + Set> actualSet = generatorSettings.getAdditionalProperties().entrySet(); + assertTrue(actualSet.containsAll(expectedAdditionalProperties.entrySet())); + } + + @SuppressWarnings("unused") + @Test( + expectedExceptions = { RuntimeException.class }, + expectedExceptionsMessageRegExp = "Unable to deserialize config file: .*" + ) + public void testInvalidDeserializerWithIncludeOption() { + // JSON is valid YAML, but not the other way around, so we can't load a YAML include from a JSON config + // to do so would require additional work. + String config = getTargetResourceAsFile(JAXRS_DATELIB_J8_YAML_INCLUDE_JSON).toString(); + SimpleModule module = GenerateBatch.getCustomDeserializationModel(getIncludesDir()); + CodegenConfigurator loaded = CodegenConfigurator.fromFile(config, module); + fail("Expected an exception when trying to load a YAML include from a JSON file"); + } + + private File getIncludesDir() { + // The includes directory would be "batch" under resources here, as everything is relative to this directory. + return workingDirectory.toFile(); + } + + private File getTargetResourceAsFile(String relative) { + return workingDirectory.resolve(relative).toAbsolutePath().toFile(); + } +} \ No newline at end of file diff --git a/modules/openapi-generator-cli/src/test/resources/batch/common/jaxrs-datelib-j8.json b/modules/openapi-generator-cli/src/test/resources/batch/common/jaxrs-datelib-j8.json new file mode 100644 index 00000000000..45c69a2d305 --- /dev/null +++ b/modules/openapi-generator-cli/src/test/resources/batch/common/jaxrs-datelib-j8.json @@ -0,0 +1,7 @@ +{ + "serializableModel": true, + "withXml": true, + "dateLibrary": "java8", + "java8": true, + "useBeanValidation": true +} diff --git a/modules/openapi-generator-cli/src/test/resources/batch/common/jaxrs-datelib-j8.yaml b/modules/openapi-generator-cli/src/test/resources/batch/common/jaxrs-datelib-j8.yaml new file mode 100644 index 00000000000..216aa6d2dcb --- /dev/null +++ b/modules/openapi-generator-cli/src/test/resources/batch/common/jaxrs-datelib-j8.yaml @@ -0,0 +1,6 @@ +--- +serializableModel: true +withXml: true +dateLibrary: java8 +java8: true +useBeanValidation: true diff --git a/modules/openapi-generator-cli/src/test/resources/batch/jaxrs-datelib-j8-json-include.yaml b/modules/openapi-generator-cli/src/test/resources/batch/jaxrs-datelib-j8-json-include.yaml new file mode 100644 index 00000000000..121076c9652 --- /dev/null +++ b/modules/openapi-generator-cli/src/test/resources/batch/jaxrs-datelib-j8-json-include.yaml @@ -0,0 +1,8 @@ +--- +"!include": common/jaxrs-datelib-j8.json +generatorName: jaxrs-jersey +inputSpec: batch/specs/petstore.yaml +outputDir: outputDir +additionalProperties: + hideGenerationTimestamp: true + serverPort: '8082' diff --git a/modules/openapi-generator-cli/src/test/resources/batch/jaxrs-datelib-j8-yaml-include.json b/modules/openapi-generator-cli/src/test/resources/batch/jaxrs-datelib-j8-yaml-include.json new file mode 100644 index 00000000000..bb8957cf653 --- /dev/null +++ b/modules/openapi-generator-cli/src/test/resources/batch/jaxrs-datelib-j8-yaml-include.json @@ -0,0 +1,10 @@ +{ + "!include": "common/jaxrs-datelib-j8.yaml", + "generatorName": "jaxrs-jersey", + "inputSpec": "batch/specs/petstore.yaml", + "outputDir": "outputDir", + "additionalProperties": { + "hideGenerationTimestamp": true, + "serverPort": "8082" + } +} \ No newline at end of file diff --git a/modules/openapi-generator-cli/src/test/resources/batch/jaxrs-datelib-j8.json b/modules/openapi-generator-cli/src/test/resources/batch/jaxrs-datelib-j8.json new file mode 100644 index 00000000000..c3f03859f04 --- /dev/null +++ b/modules/openapi-generator-cli/src/test/resources/batch/jaxrs-datelib-j8.json @@ -0,0 +1,10 @@ +{ + "!include": "common/jaxrs-datelib-j8.json", + "generatorName": "jaxrs-jersey", + "inputSpec": "batch/specs/petstore.yaml", + "outputDir": "outputDir", + "additionalProperties": { + "hideGenerationTimestamp": true, + "serverPort": "8082" + } +} \ No newline at end of file diff --git a/modules/openapi-generator-cli/src/test/resources/batch/jaxrs-datelib-j8.yaml b/modules/openapi-generator-cli/src/test/resources/batch/jaxrs-datelib-j8.yaml new file mode 100644 index 00000000000..bab10df8dd1 --- /dev/null +++ b/modules/openapi-generator-cli/src/test/resources/batch/jaxrs-datelib-j8.yaml @@ -0,0 +1,8 @@ +--- +"!include": common/jaxrs-datelib-j8.yaml +generatorName: jaxrs-jersey +inputSpec: batch/specs/petstore.yaml +outputDir: outputDir +additionalProperties: + hideGenerationTimestamp: true + serverPort: '8082' diff --git a/modules/openapi-generator-cli/src/test/resources/batch/specs/petstore.yaml b/modules/openapi-generator-cli/src/test/resources/batch/specs/petstore.yaml new file mode 100644 index 00000000000..10f4c499ff8 --- /dev/null +++ b/modules/openapi-generator-cli/src/test/resources/batch/specs/petstore.yaml @@ -0,0 +1,111 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore + license: + name: MIT +servers: + - url: http://petstore.swagger.io/v1 +paths: + /pets: + get: + summary: List all pets + operationId: listPets + tags: + - pets + parameters: + - name: limit + in: query + description: How many items to return at one time (max 100) + required: false + schema: + type: integer + format: int32 + responses: + '200': + description: A paged array of pets + headers: + x-next: + description: A link to the next page of responses + schema: + type: string + content: + application/json: + schema: + $ref: "#/components/schemas/Pets" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + summary: Create a pet + operationId: createPets + tags: + - pets + responses: + '201': + description: Null response + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /pets/{petId}: + get: + summary: Info for a specific pet + operationId: showPetById + tags: + - pets + parameters: + - name: petId + in: path + required: true + description: The id of the pet to retrieve + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: "#/components/schemas/Pet" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" +components: + schemas: + Pet: + type: object + required: + - id + - name + properties: + id: + type: integer + format: int64 + name: + type: string + tag: + type: string + Pets: + type: array + items: + $ref: "#/components/schemas/Pet" + Error: + type: object + required: + - code + - message + properties: + code: + type: integer + format: int32 + message: + type: string diff --git a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java index 6dc8fb5fd0f..49fb45efa07 100644 --- a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java +++ b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java @@ -777,12 +777,13 @@ public class CodeGenMojo extends AbstractMojo { conn.setRequestProperty(auth.getKeyName(), auth.getValue()); } } - ReadableByteChannel readableByteChannel = Channels.newChannel(conn.getInputStream()); - - FileOutputStream fileOutputStream = new FileOutputStream(inputSpecTempFile); - FileChannel fileChannel = fileOutputStream.getChannel(); - - fileChannel.transferFrom(readableByteChannel, 0, Long.MAX_VALUE); + try (ReadableByteChannel readableByteChannel = Channels.newChannel(conn.getInputStream())) { + FileChannel fileChannel; + try (FileOutputStream fileOutputStream = new FileOutputStream(inputSpecTempFile)) { + fileChannel = fileOutputStream.getChannel(); + fileChannel.transferFrom(readableByteChannel, 0, Long.MAX_VALUE); + } + } } ByteSource inputSpecByteSource = diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index ab6869f5c37..0285772a69a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -49,7 +49,9 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp public static final String NPM_VERSION = "npmVersion"; public static final String SNAPSHOT = "snapshot"; - protected static final SimpleDateFormat SNAPSHOT_SUFFIX_FORMAT = new SimpleDateFormat("yyyyMMddHHmm", Locale.ROOT); + // NOTE: SimpleDateFormat is not thread-safe and may not be static unless it is thread-local + @SuppressWarnings("squid:S5164") + protected static final ThreadLocal SNAPSHOT_SUFFIX_FORMAT = ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyyMMddHHmm", Locale.ROOT)); protected String modelPropertyNaming = "camelCase"; protected Boolean supportsES6 = false; @@ -158,7 +160,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp " Required to generate a full package")); this.cliOptions.add(new CliOption(NPM_VERSION, "The version of your npm package. If not provided, using the version from the OpenAPI specification file.").defaultValue(this.getNpmVersion())); this.cliOptions.add(CliOption.newBoolean(SNAPSHOT, - "When setting this property to true, the version will be suffixed with -SNAPSHOT." + this.SNAPSHOT_SUFFIX_FORMAT.toPattern(), + "When setting this property to true, the version will be suffixed with -SNAPSHOT." + this.SNAPSHOT_SUFFIX_FORMAT.get().toPattern(), false)); } @@ -204,9 +206,9 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp if (additionalProperties.containsKey(SNAPSHOT) && Boolean.parseBoolean(additionalProperties.get(SNAPSHOT).toString())) { if (npmVersion.toUpperCase(Locale.ROOT).matches("^.*-SNAPSHOT$")) { - this.setNpmVersion(npmVersion + "." + SNAPSHOT_SUFFIX_FORMAT.format(new Date())); + this.setNpmVersion(npmVersion + "." + SNAPSHOT_SUFFIX_FORMAT.get().format(new Date())); } else { - this.setNpmVersion(npmVersion + "-SNAPSHOT." + SNAPSHOT_SUFFIX_FORMAT.format(new Date())); + this.setNpmVersion(npmVersion + "-SNAPSHOT." + SNAPSHOT_SUFFIX_FORMAT.get().format(new Date())); } } additionalProperties.put(NPM_VERSION, npmVersion); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java index 355afddd0b5..0ed1116bff6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFExtServerCodegen.java @@ -25,24 +25,11 @@ import java.math.BigDecimal; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Base64; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; -import java.util.TimeZone; -import java.util.TreeSet; +import java.util.*; import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CliOption; -import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.CodegenOperation; import org.openapitools.codegen.CodegenParameter; @@ -275,10 +262,25 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF private static final String INDENT = " "; - private static final SimpleDateFormat ISO8601_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()); + // SimpleDateFormat is not thread-safe, and may not be stored in a static field unless stored by ThreadLocal. + // It's not enough to add a ThreadLocal at the usage site. + @SuppressWarnings("squid:S5164") + private static final ThreadLocal ISO8601_DATE_FORMAT = ThreadLocal.withInitial(() -> + { + SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()); + f.setTimeZone(TimeZone.getTimeZone("UTC")); + return f; + }); - private static final SimpleDateFormat ISO8601_DATETIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX", - Locale.getDefault()); + // SimpleDateFormat is not thread-safe, and may not be stored in a static field unless stored by ThreadLocal. + // It's not enough to add a ThreadLocal at the usage site. + @SuppressWarnings("squid:S5164") + private static final ThreadLocal ISO8601_DATETIME_FORMAT = ThreadLocal.withInitial(() -> + { + SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX", Locale.getDefault()); + f.setTimeZone(TimeZone.getTimeZone("UTC")); + return f; + }); private static final long MILLIS_PER_DAY = 24 * 60 * 60 * 1000; @@ -292,13 +294,11 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF "LocalDateTime", "LocalDate"); static { - ISO8601_DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); - ISO8601_DATETIME_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); long minDate = 0; long maxDate = 0; try { - minDate = ISO8601_DATETIME_FORMAT.parse("1970-01-01T00:00:00Z").getTime(); - maxDate = ISO8601_DATETIME_FORMAT.parse("2099-12-31T23:59:59Z").getTime(); + minDate = ISO8601_DATETIME_FORMAT.get().parse("1970-01-01T00:00:00Z").getTime(); + maxDate = ISO8601_DATETIME_FORMAT.get().parse("2099-12-31T23:59:59Z").getTime(); } catch (ParseException e) { // Won't happen with the values provided. } @@ -383,12 +383,15 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF short max = var == null || var.maximum == null ? Byte.MAX_VALUE : Byte.parseByte(var.maximum); short exclusiveMin = (short) (var != null && var.exclusiveMinimum ? 1 : 0); short inclusiveMax = (short) (var == null || !var.exclusiveMaximum ? 1 : 0); - int itemCount = Math.max(var.itemCount, var.minItems == null ? 1 : Math.max(1, var.minItems)); + int itemCount = 0; + if (var != null) { + itemCount = Math.max(var.itemCount, var.minItems == null ? 1 : Math.max(1, var.minItems)); + } byte[] randomBytes = new byte[itemCount]; for (int i = 0; i < itemCount; i++) randomBytes[i] = (byte) (min + exclusiveMin + ((max + inclusiveMax - min - exclusiveMin) * Math.random())); String randomBytesBase64 = Base64.getEncoder().encodeToString(randomBytes); - if (loadTestDataFromFile) + if (loadTestDataFromFile && var != null) var.addTestData(randomBytesBase64); else buffer.append('"'); @@ -431,13 +434,10 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF * @param buffer * @param indent * @param op + * @param var * @param localVars * @param models - * @param type - * @param baseType - * @param isListContainer - * @param isMapContainer - * @param localVar + * * @return localVar with a numeric suffix if necessary to ensure uniqueness. */ private String appendLocalVariable(StringBuilder buffer, String indent, CodegenOperation op, CodegenVariable var, @@ -582,7 +582,7 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF long minDate = MIN_DATE; long maxDate = MAX_DATE; if (var != null) { - DateFormat df = var.dataFormat.equals("date-time") ? ISO8601_DATETIME_FORMAT : ISO8601_DATE_FORMAT; + DateFormat df = var.dataFormat.equals("date-time") ? ISO8601_DATETIME_FORMAT.get() : ISO8601_DATE_FORMAT.get(); String isoFormat = var.dataFormat.equals("date-time") ? "date-time" : "full-date"; if (var.minimum != null) { try { @@ -622,10 +622,10 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF Date randomDate = new Date(randomDateLong); switch (var.dataFormat) { case "date": - var.addTestData(ISO8601_DATE_FORMAT.format(randomDate)); + var.addTestData(ISO8601_DATE_FORMAT.get().format(randomDate)); break; case "date-time": - var.addTestData(ISO8601_DATETIME_FORMAT.format(randomDate)); + var.addTestData(ISO8601_DATETIME_FORMAT.get().format(randomDate)); break; } } else { @@ -787,7 +787,6 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF * @param localVar The variable whose value is to be set. * @param localVars Tracks local variables which have been allocated. * @param models A map of models, keyed on class name. - * @param type The value type. */ private void appendScalarValue(StringBuilder buffer, String indent, CodegenOperation op, CodegenVariable var, String localVar, Collection localVars, Map models) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java index 3954e98f9bb..21dd07fb653 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonAbstractConnexionServerCodegen.java @@ -516,7 +516,7 @@ public class PythonAbstractConnexionServerCodegen extends DefaultCodegen impleme if (pathExtensions != null) { // Get and remove the (temporary) vendor extension String openapiPathname = (String) pathExtensions.remove("x-python-connexion-openapi-name"); - if (openapiPathname != null && openapiPathname != pythonPathname) { + if (openapiPathname != null && !openapiPathname.equals(pythonPathname)) { LOGGER.info("Path '" + pythonPathname + "' is not consistant with the original OpenAPI definition. It will be replaced back by '" + openapiPathname + "'"); paths.remove(pythonPathname); paths.put(openapiPathname, path); @@ -535,7 +535,7 @@ public class PythonAbstractConnexionServerCodegen extends DefaultCodegen impleme String swaggerParameterName = (String) parameterExtensions.remove("x-python-connexion-openapi-name"); if (swaggerParameterName != null) { String pythonParameterName = parameter.getName(); - if (swaggerParameterName != pythonParameterName) { + if (!swaggerParameterName.equals(pythonParameterName)) { LOGGER.info("Reverting name of parameter '" + pythonParameterName + "' of operation '" + operation.getOperationId() + "' back to '" + swaggerParameterName + "'"); parameter.setName(swaggerParameterName); } else { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index 7e31e615773..b2a6a04b958 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -818,7 +818,7 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { if (ModelUtils.isFreeFormObject(p) && ModelUtils.getAdditionalProperties(p) == null) { return prefix + "bool, date, datetime, dict, float, int, list, str" + fullSuffix; } - if ((ModelUtils.isMapSchema(p) || p.getType() == "object") && ModelUtils.getAdditionalProperties(p) != null) { + if ((ModelUtils.isMapSchema(p) || "object".equals(p.getType())) && ModelUtils.getAdditionalProperties(p) != null) { Schema inner = ModelUtils.getAdditionalProperties(p); return prefix + "{str: " + getTypeString(inner, "(", ")") + "}" + fullSuffix; } else if (ModelUtils.isArraySchema(p)) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java index 273978d0a71..a6551c03012 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RClientCodegen.java @@ -710,11 +710,7 @@ public class RClientCodegen extends DefaultCodegen implements CodegenConfig { } else if (codegenParameter.isMapContainer) { // TODO: map return "TODO"; } else if (languageSpecificPrimitives.contains(codegenParameter.dataType)) { // primitive type - if ("character".equals(codegenParameter.dataType)) { - return codegenParameter.example; - } else { - return codegenParameter.example; - } + return codegenParameter.example; } else { // model // look up the model if (modelMaps.containsKey(codegenParameter.dataType)) { 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 ed185188667..8815ca4e511 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 @@ -664,7 +664,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { // Get the original API response so we get process the schema // directly. ApiResponse original; - if (rsp.code == "0") { + if ("0".equals(rsp.code)) { original = operation.getResponses().get("default"); } else { original = operation.getResponses().get(rsp.code); @@ -714,10 +714,7 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { String firstProduces = null; if (original.getContent() != null) { - for (String mimetype : original.getContent().keySet()) { - firstProduces = mimetype; - break; - } + firstProduces = original.getContent().keySet().stream().findFirst().orElse(null); } // The output mime type. This allows us to do sensible fallback diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java index eb669b02df1..77389ce3f90 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java @@ -1011,7 +1011,7 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig { return "\"" + codegenParameter.paramName + "_example\""; } } else if ("Bool".equals(codegenParameter.dataType)) { // boolean - if (Boolean.TRUE.equals(codegenParameter.example)) { + if (Boolean.parseBoolean(codegenParameter.example)) { return "true"; } else { return "false"; @@ -1051,7 +1051,7 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig { return "\"" + codegenProperty.name + "_example\""; } } else if ("Bool".equals(codegenProperty.dataType)) { // boolean - if (Boolean.TRUE.equals(codegenProperty.example)) { + if (Boolean.parseBoolean(codegenProperty.example)) { return "true"; } else { return "false"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java index 5bc9f1ad4d4..610da984c85 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java @@ -993,7 +993,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig return "\"" + codegenParameter.paramName + "_example\""; } } else if ("Bool".equals(codegenParameter.dataType)) { // boolean - if (Boolean.TRUE.equals(codegenParameter.example)) { + if (Boolean.parseBoolean(codegenParameter.example)) { return "true"; } else { return "false"; @@ -1033,7 +1033,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig return "\"" + codegenProperty.name + "_example\""; } } else if ("Bool".equals(codegenProperty.dataType)) { // boolean - if (Boolean.TRUE.equals(codegenProperty.example)) { + if (Boolean.parseBoolean(codegenProperty.example)) { return "true"; } else { return "false"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index b21869c7489..7e6bdd3d131 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -283,7 +283,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege Map _operations = (Map) operations.get("operations"); List operationList = (List) _operations.get("operation"); for (CodegenOperation op : operationList) { - if(op.returnType == "object") { + if("object".equals(op.returnType)) { op.isMapContainer = true; op.returnSimpleType = false; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptReduxQueryClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptReduxQueryClientCodegen.java index 560083e6018..020752f84a0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptReduxQueryClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptReduxQueryClientCodegen.java @@ -255,7 +255,7 @@ public class TypeScriptReduxQueryClientCodegen extends AbstractTypeScriptClientC Map _operations = (Map) operations.get("operations"); List operationList = (List) _operations.get("operation"); for (CodegenOperation op : operationList) { - if(op.returnType == "object") { + if("object".equals(op.returnType)) { op.isMapContainer = true; op.returnSimpleType = false; } 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 cf2ca082caa..a539cddb1fd 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 @@ -35,11 +35,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.Map.Entry; import java.util.stream.Collectors; @@ -246,10 +242,14 @@ public class ModelUtils { if (parameters != null) { for (Parameter p : parameters) { Parameter parameter = getReferencedParameter(openAPI, p); - if (parameter.getSchema() != null) { - visitSchema(openAPI, parameter.getSchema(), null, visitedSchemas, visitor); + if (parameter != null) { + if (parameter.getSchema() != null) { + visitSchema(openAPI, parameter.getSchema(), null, visitedSchemas, visitor); + } + visitContent(openAPI, parameter.getContent(), visitor, visitedSchemas); + } else { + LOGGER.warn("Unreferenced parameter found."); } - visitContent(openAPI, parameter.getContent(), visitor, visitedSchemas); } } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/URLPathUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/URLPathUtils.java index abb50ca4963..e1d3611fedf 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/URLPathUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/URLPathUtils.java @@ -195,29 +195,31 @@ public class URLPathUtils { */ public static String getHost(OpenAPI openAPI, final Map userDefinedVariables) { if (openAPI.getServers() != null && openAPI.getServers().size() > 0) { - return sanitizeUrl(getServerURL(openAPI.getServers().get(0), userDefinedVariables).toString()); + URL url = getServerURL(openAPI.getServers().get(0), userDefinedVariables); + return url != null ? sanitizeUrl(url.toString()) : ""; } return LOCAL_HOST; } private static String sanitizeUrl(String url) { - if (url.startsWith("//")) { - url = "http:" + url; - LOGGER.warn("'scheme' not defined in the spec (2.0). Default to [http] for server URL [{}]", url); - } else if (url.startsWith("/")) { - url = LOCAL_HOST + url; - LOGGER.warn("'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [{}] for server URL [{}]", LOCAL_HOST, url); - } else if (!url.matches("[a-zA-Z][0-9a-zA-Z.+\\-]+://.+")) { - // Add http scheme for urls without a scheme. - // 2.0 spec is restricted to the following schemes: "http", "https", "ws", "wss" - // 3.0 spec does not have an enumerated list of schemes - // This regex attempts to capture all schemes in IANA example schemes which - // can have alpha-numeric characters and [.+-]. Examples are here: - // https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml - url = "http://" + url; - LOGGER.warn("'scheme' not defined in the spec (2.0). Default to [http] for server URL [{}]", url); + if (url != null) { + if (url.startsWith("//")) { + url = "http:" + url; + LOGGER.warn("'scheme' not defined in the spec (2.0). Default to [http] for server URL [{}]", url); + } else if (url.startsWith("/")) { + url = LOCAL_HOST + url; + LOGGER.warn("'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [{}] for server URL [{}]", LOCAL_HOST, url); + } else if (!url.matches("[a-zA-Z][0-9a-zA-Z.+\\-]+://.+")) { + // Add http scheme for urls without a scheme. + // 2.0 spec is restricted to the following schemes: "http", "https", "ws", "wss" + // 3.0 spec does not have an enumerated list of schemes + // This regex attempts to capture all schemes in IANA example schemes which + // can have alpha-numeric characters and [.+-]. Examples are here: + // https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml + url = "http://" + url; + LOGGER.warn("'scheme' not defined in the spec (2.0). Default to [http] for server URL [{}]", url); + } } - return url; } From 305b7279ee39f89559439ad638ff204a725fcb69 Mon Sep 17 00:00:00 2001 From: Tatsuro Shibamura Date: Sun, 26 Jan 2020 09:07:50 +0900 Subject: [PATCH 29/85] [csharp-netcore] Update RestSharp and improve async methods (#5066) * Update RestSharp and improve async methods * Fixed missing type parameter * Update sample code * Update README * Update RestSharp version for CI * Fixed sample test projects --- .../Org.OpenAPITools.Test.csproj | 2 +- .../Org.OpenAPITools.Test.csproj | 2 +- .../csharp-netcore/ApiClient.mustache | 191 ++++++++++-------- .../csharp-netcore/Multimap.mustache | 6 +- .../resources/csharp-netcore/Project.mustache | 2 +- .../resources/csharp-netcore/README.mustache | 2 +- .../csharp-netcore/TestProject.mustache | 2 +- .../csharp-netcore/netcore_project.mustache | 2 +- .../netcore_testproject.mustache | 2 +- .../resources/csharp-netcore/nuspec.mustache | 2 +- .../csharp-netcore/packages.config.mustache | 2 +- .../csharp-netcore/project.json.mustache | 2 +- .../csharp-netcore/OpenAPIClient/README.md | 2 +- .../Org.OpenAPITools.Test.csproj | 2 +- .../src/Org.OpenAPITools/Client/ApiClient.cs | 156 ++++++++++---- .../src/Org.OpenAPITools/Client/Multimap.cs | 6 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 2 +- .../src/Org.OpenAPITools/project.json | 2 +- .../OpenAPIClientCore/README.md | 2 +- .../Org.OpenAPITools.Test.csproj | 2 +- .../src/Org.OpenAPITools/Client/ApiClient.cs | 156 ++++++++++---- .../src/Org.OpenAPITools/Client/Multimap.cs | 6 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 2 +- 23 files changed, 359 insertions(+), 196 deletions(-) diff --git a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 629d78c375f..6155a476849 100644 --- a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -30,7 +30,7 @@ OpenAPI spec version: 1.0.0 - +
diff --git a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 629d78c375f..6155a476849 100644 --- a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -30,7 +30,7 @@ OpenAPI spec version: 1.0.0 - +
diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache index 58ef09e083d..3c0aacbacb5 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache @@ -32,37 +32,34 @@ namespace {{packageName}}.Client internal class CustomJsonCodec : RestSharp.Serializers.ISerializer, RestSharp.Deserializers.IDeserializer { private readonly IReadableConfiguration _configuration; - private readonly JsonSerializer _serializer; - private string _contentType = "application/json"; + private static readonly string _contentType = "application/json"; private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings { // OpenAPI generated types generally hide default constructors. ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy { - NamingStrategy = new CamelCaseNamingStrategy() - { - OverrideSpecifiedNames = true - } + OverrideSpecifiedNames = true } + } }; public CustomJsonCodec(IReadableConfiguration configuration) { _configuration = configuration; - _serializer = JsonSerializer.Create(_serializerSettings); } public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) { _serializerSettings = serializerSettings; - _serializer = JsonSerializer.Create(_serializerSettings); _configuration = configuration; } public string Serialize(object obj) { - String result = JsonConvert.SerializeObject(obj, _serializerSettings); + var result = JsonConvert.SerializeObject(obj, _serializerSettings); return result; } @@ -178,7 +175,7 @@ namespace {{packageName}}.Client /// public ApiClient(String basePath) { - if (String.IsNullOrEmpty(basePath)) + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); _baseUrl = basePath; @@ -235,7 +232,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// - private RestRequest newRequest( + private RestRequest NewRequest( HttpMethod method, String path, RequestOptions options, @@ -344,9 +341,9 @@ namespace {{packageName}}.Client return request; } - private ApiResponse toApiResponse({{#supportsAsync}}IRestResponse response{{/supportsAsync}}{{^supportsAsync}}IRestResponse response, CustomJsonCodec des{{/supportsAsync}}) + private ApiResponse ToApiResponse(IRestResponse response) { - T result = {{#supportsAsync}}response.Data{{/supportsAsync}}{{^supportsAsync}}(T)des.Deserialize(response, typeof(T)){{/supportsAsync}}; + T result = response.Data; string rawContent = response.Content; var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) @@ -380,7 +377,7 @@ namespace {{packageName}}.Client return transformed; } - private {{#supportsAsync}}async Task>{{/supportsAsync}}{{^supportsAsync}}ApiResponse{{/supportsAsync}} Exec(RestRequest req, IReadableConfiguration configuration) + private ApiResponse Exec(RestRequest req, IReadableConfiguration configuration) { RestClient client = new RestClient(_baseUrl); @@ -388,15 +385,14 @@ namespace {{packageName}}.Client var existingDeserializer = req.JsonSerializer as IDeserializer; if (existingDeserializer != null) { - client.AddHandler(existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); + client.AddHandler(() => existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); } else { - var codec = new CustomJsonCodec(configuration); - client.AddHandler(codec, "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); + client.AddHandler(() => new CustomJsonCodec(configuration), "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); } - client.AddHandler(new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*"); + client.AddHandler(() => new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*"); client.Timeout = configuration.Timeout; @@ -406,15 +402,12 @@ namespace {{packageName}}.Client } InterceptRequest(req); - {{#supportsAsync}} - var response = await client.ExecuteTaskAsync(req); - {{/supportsAsync}} - {{^supportsAsync}} - var response = client.Execute(req); - {{/supportsAsync}} + + var response = client.Execute(req); + InterceptResponse(req, response); - var result = toApiResponse(response{{^supportsAsync}}, codec{{/supportsAsync}}); + var result = ToApiResponse(response); if (response.ErrorMessage != null) { result.ErrorText = response.ErrorMessage; @@ -442,14 +435,79 @@ namespace {{packageName}}.Client Secure = restResponseCookie.Secure, Version = restResponseCookie.Version }; - + result.Cookies.Add(cookie); } } return result; } - + {{#supportsAsync}} + private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration) + { + RestClient client = new RestClient(_baseUrl); + + client.ClearHandlers(); + var existingDeserializer = req.JsonSerializer as IDeserializer; + if (existingDeserializer != null) + { + client.AddHandler(() => existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); + } + else + { + client.AddHandler(() => new CustomJsonCodec(configuration), "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); + } + + client.AddHandler(() => new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*"); + + client.Timeout = configuration.Timeout; + + if (configuration.UserAgent != null) + { + client.UserAgent = configuration.UserAgent; + } + + InterceptRequest(req); + + var response = await client.ExecuteAsync(req); + + InterceptResponse(req, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if(result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + #region IAsynchronousClient /// /// Make a HTTP GET request (async). @@ -459,10 +517,10 @@ namespace {{packageName}}.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Get, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config); } /// @@ -473,10 +531,10 @@ namespace {{packageName}}.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Post, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config); } /// @@ -487,10 +545,10 @@ namespace {{packageName}}.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Put, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config); } /// @@ -501,10 +559,10 @@ namespace {{packageName}}.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Delete, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config); } /// @@ -515,10 +573,10 @@ namespace {{packageName}}.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Head, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config); } /// @@ -529,10 +587,10 @@ namespace {{packageName}}.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Options, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config); } /// @@ -543,10 +601,10 @@ namespace {{packageName}}.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Patch, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config); } #endregion IAsynchronousClient {{/supportsAsync}} @@ -562,13 +620,8 @@ namespace {{packageName}}.Client /// A Task containing ApiResponse public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) { - {{#supportsAsync}} - return GetAsync(path, options, configuration).Result; - {{/supportsAsync}} - {{^supportsAsync}} var config = configuration ?? GlobalConfiguration.Instance; - return Exec(newRequest(HttpMethod.Get, path, options, config), config); - {{/supportsAsync}} + return Exec(NewRequest(HttpMethod.Get, path, options, config), config); } /// @@ -581,13 +634,8 @@ namespace {{packageName}}.Client /// A Task containing ApiResponse public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) { - {{#supportsAsync}} - return PostAsync(path, options, configuration).Result; - {{/supportsAsync}} - {{^supportsAsync}} var config = configuration ?? GlobalConfiguration.Instance; - return Exec(newRequest(HttpMethod.Post, path, options, config), config); - {{/supportsAsync}} + return Exec(NewRequest(HttpMethod.Post, path, options, config), config); } /// @@ -600,13 +648,8 @@ namespace {{packageName}}.Client /// A Task containing ApiResponse public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) { - {{#supportsAsync}} - return PutAsync(path, options, configuration).Result; - {{/supportsAsync}} - {{^supportsAsync}} var config = configuration ?? GlobalConfiguration.Instance; - return Exec(newRequest(HttpMethod.Put, path, options, config), config); - {{/supportsAsync}} + return Exec(NewRequest(HttpMethod.Put, path, options, config), config); } /// @@ -619,13 +662,8 @@ namespace {{packageName}}.Client /// A Task containing ApiResponse public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) { - {{#supportsAsync}} - return DeleteAsync(path, options, configuration).Result; - {{/supportsAsync}} - {{^supportsAsync}} var config = configuration ?? GlobalConfiguration.Instance; - return Exec(newRequest(HttpMethod.Delete, path, options, config), config); - {{/supportsAsync}} + return Exec(NewRequest(HttpMethod.Delete, path, options, config), config); } /// @@ -638,13 +676,8 @@ namespace {{packageName}}.Client /// A Task containing ApiResponse public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) { - {{#supportsAsync}} - return HeadAsync(path, options, configuration).Result; - {{/supportsAsync}} - {{^supportsAsync}} var config = configuration ?? GlobalConfiguration.Instance; - return Exec(newRequest(HttpMethod.Head, path, options, config), config); - {{/supportsAsync}} + return Exec(NewRequest(HttpMethod.Head, path, options, config), config); } /// @@ -657,13 +690,8 @@ namespace {{packageName}}.Client /// A Task containing ApiResponse public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) { - {{#supportsAsync}} - return OptionsAsync(path, options, configuration).Result; - {{/supportsAsync}} - {{^supportsAsync}} var config = configuration ?? GlobalConfiguration.Instance; - return Exec(newRequest(HttpMethod.Options, path, options, config), config); - {{/supportsAsync}} + return Exec(NewRequest(HttpMethod.Options, path, options, config), config); } /// @@ -676,13 +704,8 @@ namespace {{packageName}}.Client /// A Task containing ApiResponse public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) { - {{#supportsAsync}} - return PatchAsync(path, options, configuration).Result; - {{/supportsAsync}} - {{^supportsAsync}} var config = configuration ?? GlobalConfiguration.Instance; - return Exec(newRequest(HttpMethod.Patch, path, options, config), config); - {{/supportsAsync}} + return Exec(NewRequest(HttpMethod.Patch, path, options, config), config); } #endregion ISynchronousClient } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/Multimap.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/Multimap.mustache index a34c6eb5bd0..7e8c97a8324 100755 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/Multimap.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/Multimap.mustache @@ -16,8 +16,7 @@ namespace {{packageName}}.Client { #region Private Fields - private readonly {{^net35}}Concurrent{{/net35}}Dictionary> _dictionary = - new {{^net35}}Concurrent{{/net35}}Dictionary>(); + private readonly {{^net35}}Concurrent{{/net35}}Dictionary> _dictionary; #endregion Private Fields @@ -35,7 +34,8 @@ namespace {{packageName}}.Client /// Constructor with comparer. /// /// - public Multimap(IEqualityComparer comparer) { + public Multimap(IEqualityComparer comparer) + { _dictionary = new {{^net35}}Concurrent{{/net35}}Dictionary>(comparer); } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache index 59a3460326b..c0f69d349b6 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache @@ -42,7 +42,7 @@ - + diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache index 4ac0fb93785..0521eb9369e 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache @@ -27,7 +27,7 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap ## Dependencies -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.6.7 or later +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.10.1 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.1 or later - [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.5.2 or later - [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.57.0 or later diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache index 65666612ab3..9ef7ae726ae 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache @@ -29,7 +29,7 @@ - + diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache index 56c95a5e32b..ac52e613eb9 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache @@ -28,7 +28,7 @@ - + diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache index c66575646c8..aa4f8beb8b0 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache @@ -21,7 +21,7 @@ - + diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache index 46fd49331ec..d0e2cc20a06 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache @@ -32,7 +32,7 @@ - + diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/packages.config.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/packages.config.mustache index 6f2e656b238..9ecc3466e62 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/packages.config.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/packages.config.mustache @@ -3,7 +3,7 @@ {{#useCompareNetObjects}} {{/useCompareNetObjects}} - + diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/project.json.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/project.json.mustache index 38ade237ec3..b33a9aefd6c 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/project.json.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/project.json.mustache @@ -6,7 +6,7 @@ "CompareNETObjects": "4.57.0", {{/useCompareNetObjects}} "JsonSubTypes": "1.5.2", - "RestSharp": "106.6.7" + "RestSharp": "106.10.1" }, "frameworks": { "{{targetFrameworkNuget}}": {} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md index 1b2baab7156..50f8cc42c91 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md @@ -17,7 +17,7 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap ## Dependencies -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.6.7 or later +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.10.1 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.1 or later - [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.5.2 or later - [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.57.0 or later diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 629d78c375f..6155a476849 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -30,7 +30,7 @@ OpenAPI spec version: 1.0.0 - + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs index 5aeb569a1a7..b34b41b5321 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs @@ -36,37 +36,34 @@ namespace Org.OpenAPITools.Client internal class CustomJsonCodec : RestSharp.Serializers.ISerializer, RestSharp.Deserializers.IDeserializer { private readonly IReadableConfiguration _configuration; - private readonly JsonSerializer _serializer; - private string _contentType = "application/json"; + private static readonly string _contentType = "application/json"; private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings { // OpenAPI generated types generally hide default constructors. ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy { - NamingStrategy = new CamelCaseNamingStrategy() - { - OverrideSpecifiedNames = true - } + OverrideSpecifiedNames = true } + } }; public CustomJsonCodec(IReadableConfiguration configuration) { _configuration = configuration; - _serializer = JsonSerializer.Create(_serializerSettings); } public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) { _serializerSettings = serializerSettings; - _serializer = JsonSerializer.Create(_serializerSettings); _configuration = configuration; } public string Serialize(object obj) { - String result = JsonConvert.SerializeObject(obj, _serializerSettings); + var result = JsonConvert.SerializeObject(obj, _serializerSettings); return result; } @@ -181,7 +178,7 @@ namespace Org.OpenAPITools.Client /// public ApiClient(String basePath) { - if (String.IsNullOrEmpty(basePath)) + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); _baseUrl = basePath; @@ -238,7 +235,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// - private RestRequest newRequest( + private RestRequest NewRequest( HttpMethod method, String path, RequestOptions options, @@ -347,7 +344,7 @@ namespace Org.OpenAPITools.Client return request; } - private ApiResponse toApiResponse(IRestResponse response) + private ApiResponse ToApiResponse(IRestResponse response) { T result = response.Data; string rawContent = response.Content; @@ -383,7 +380,7 @@ namespace Org.OpenAPITools.Client return transformed; } - private async Task> Exec(RestRequest req, IReadableConfiguration configuration) + private ApiResponse Exec(RestRequest req, IReadableConfiguration configuration) { RestClient client = new RestClient(_baseUrl); @@ -391,15 +388,14 @@ namespace Org.OpenAPITools.Client var existingDeserializer = req.JsonSerializer as IDeserializer; if (existingDeserializer != null) { - client.AddHandler(existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); + client.AddHandler(() => existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); } else { - var codec = new CustomJsonCodec(configuration); - client.AddHandler(codec, "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); + client.AddHandler(() => new CustomJsonCodec(configuration), "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); } - client.AddHandler(new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*"); + client.AddHandler(() => new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*"); client.Timeout = configuration.Timeout; @@ -409,10 +405,12 @@ namespace Org.OpenAPITools.Client } InterceptRequest(req); - var response = await client.ExecuteTaskAsync(req); + + var response = client.Execute(req); + InterceptResponse(req, response); - var result = toApiResponse(response); + var result = ToApiResponse(response); if (response.ErrorMessage != null) { result.ErrorText = response.ErrorMessage; @@ -440,13 +438,78 @@ namespace Org.OpenAPITools.Client Secure = restResponseCookie.Secure, Version = restResponseCookie.Version }; - + result.Cookies.Add(cookie); } } return result; } - + + private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration) + { + RestClient client = new RestClient(_baseUrl); + + client.ClearHandlers(); + var existingDeserializer = req.JsonSerializer as IDeserializer; + if (existingDeserializer != null) + { + client.AddHandler(() => existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); + } + else + { + client.AddHandler(() => new CustomJsonCodec(configuration), "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); + } + + client.AddHandler(() => new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*"); + + client.Timeout = configuration.Timeout; + + if (configuration.UserAgent != null) + { + client.UserAgent = configuration.UserAgent; + } + + InterceptRequest(req); + + var response = await client.ExecuteAsync(req); + + InterceptResponse(req, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if(result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + #region IAsynchronousClient /// /// Make a HTTP GET request (async). @@ -456,10 +519,10 @@ namespace Org.OpenAPITools.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Get, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config); } /// @@ -470,10 +533,10 @@ namespace Org.OpenAPITools.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Post, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config); } /// @@ -484,10 +547,10 @@ namespace Org.OpenAPITools.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Put, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config); } /// @@ -498,10 +561,10 @@ namespace Org.OpenAPITools.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Delete, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config); } /// @@ -512,10 +575,10 @@ namespace Org.OpenAPITools.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Head, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config); } /// @@ -526,10 +589,10 @@ namespace Org.OpenAPITools.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Options, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config); } /// @@ -540,10 +603,10 @@ namespace Org.OpenAPITools.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Patch, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config); } #endregion IAsynchronousClient @@ -558,7 +621,8 @@ namespace Org.OpenAPITools.Client /// A Task containing ApiResponse public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) { - return GetAsync(path, options, configuration).Result; + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), config); } /// @@ -571,7 +635,8 @@ namespace Org.OpenAPITools.Client /// A Task containing ApiResponse public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) { - return PostAsync(path, options, configuration).Result; + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), config); } /// @@ -584,7 +649,8 @@ namespace Org.OpenAPITools.Client /// A Task containing ApiResponse public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) { - return PutAsync(path, options, configuration).Result; + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), config); } /// @@ -597,7 +663,8 @@ namespace Org.OpenAPITools.Client /// A Task containing ApiResponse public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) { - return DeleteAsync(path, options, configuration).Result; + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), config); } /// @@ -610,7 +677,8 @@ namespace Org.OpenAPITools.Client /// A Task containing ApiResponse public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) { - return HeadAsync(path, options, configuration).Result; + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), config); } /// @@ -623,7 +691,8 @@ namespace Org.OpenAPITools.Client /// A Task containing ApiResponse public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) { - return OptionsAsync(path, options, configuration).Result; + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), config); } /// @@ -636,7 +705,8 @@ namespace Org.OpenAPITools.Client /// A Task containing ApiResponse public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) { - return PatchAsync(path, options, configuration).Result; + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Patch, path, options, config), config); } #endregion ISynchronousClient } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Multimap.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Multimap.cs index 800b1c47631..4bde7f7ffe4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Multimap.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Multimap.cs @@ -25,8 +25,7 @@ namespace Org.OpenAPITools.Client { #region Private Fields - private readonly ConcurrentDictionary> _dictionary = - new ConcurrentDictionary>(); + private readonly ConcurrentDictionary> _dictionary; #endregion Private Fields @@ -44,7 +43,8 @@ namespace Org.OpenAPITools.Client /// Constructor with comparer. /// /// - public Multimap(IEqualityComparer comparer) { + public Multimap(IEqualityComparer comparer) + { _dictionary = new ConcurrentDictionary>(comparer); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 20e88d0d9b4..f416158b591 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -36,7 +36,7 @@ The version of the OpenAPI document: 1.0.0 - + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/project.json b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/project.json index 70f54d09b06..d66033d858d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/project.json +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/project.json @@ -4,7 +4,7 @@ "Newtonsoft.Json": "12.0.1", "CompareNETObjects": "4.57.0", "JsonSubTypes": "1.5.2", - "RestSharp": "106.6.7" + "RestSharp": "106.10.1" }, "frameworks": { "netstandard2.0": {} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md index a3664cf3b1b..0f522c406ea 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md @@ -14,7 +14,7 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap ## Dependencies -- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.6.7 or later +- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.10.1 or later - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.1 or later - [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.5.2 or later - [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.57.0 or later diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 629d78c375f..6155a476849 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -30,7 +30,7 @@ OpenAPI spec version: 1.0.0 - + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs index 1a4735a1cc4..96f84b5a6ee 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -37,37 +37,34 @@ namespace Org.OpenAPITools.Client internal class CustomJsonCodec : RestSharp.Serializers.ISerializer, RestSharp.Deserializers.IDeserializer { private readonly IReadableConfiguration _configuration; - private readonly JsonSerializer _serializer; - private string _contentType = "application/json"; + private static readonly string _contentType = "application/json"; private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings { // OpenAPI generated types generally hide default constructors. ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, - ContractResolver = new DefaultContractResolver + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy { - NamingStrategy = new CamelCaseNamingStrategy() - { - OverrideSpecifiedNames = true - } + OverrideSpecifiedNames = true } + } }; public CustomJsonCodec(IReadableConfiguration configuration) { _configuration = configuration; - _serializer = JsonSerializer.Create(_serializerSettings); } public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration) { _serializerSettings = serializerSettings; - _serializer = JsonSerializer.Create(_serializerSettings); _configuration = configuration; } public string Serialize(object obj) { - String result = JsonConvert.SerializeObject(obj, _serializerSettings); + var result = JsonConvert.SerializeObject(obj, _serializerSettings); return result; } @@ -182,7 +179,7 @@ namespace Org.OpenAPITools.Client /// public ApiClient(String basePath) { - if (String.IsNullOrEmpty(basePath)) + if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); _baseUrl = basePath; @@ -239,7 +236,7 @@ namespace Org.OpenAPITools.Client /// GlobalConfiguration has been done before calling this method. /// [private] A new RestRequest instance. /// - private RestRequest newRequest( + private RestRequest NewRequest( HttpMethod method, String path, RequestOptions options, @@ -348,7 +345,7 @@ namespace Org.OpenAPITools.Client return request; } - private ApiResponse toApiResponse(IRestResponse response) + private ApiResponse ToApiResponse(IRestResponse response) { T result = response.Data; string rawContent = response.Content; @@ -384,7 +381,7 @@ namespace Org.OpenAPITools.Client return transformed; } - private async Task> Exec(RestRequest req, IReadableConfiguration configuration) + private ApiResponse Exec(RestRequest req, IReadableConfiguration configuration) { RestClient client = new RestClient(_baseUrl); @@ -392,15 +389,14 @@ namespace Org.OpenAPITools.Client var existingDeserializer = req.JsonSerializer as IDeserializer; if (existingDeserializer != null) { - client.AddHandler(existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); + client.AddHandler(() => existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); } else { - var codec = new CustomJsonCodec(configuration); - client.AddHandler(codec, "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); + client.AddHandler(() => new CustomJsonCodec(configuration), "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); } - client.AddHandler(new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*"); + client.AddHandler(() => new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*"); client.Timeout = configuration.Timeout; @@ -410,10 +406,12 @@ namespace Org.OpenAPITools.Client } InterceptRequest(req); - var response = await client.ExecuteTaskAsync(req); + + var response = client.Execute(req); + InterceptResponse(req, response); - var result = toApiResponse(response); + var result = ToApiResponse(response); if (response.ErrorMessage != null) { result.ErrorText = response.ErrorMessage; @@ -441,13 +439,78 @@ namespace Org.OpenAPITools.Client Secure = restResponseCookie.Secure, Version = restResponseCookie.Version }; - + result.Cookies.Add(cookie); } } return result; } - + + private async Task> ExecAsync(RestRequest req, IReadableConfiguration configuration) + { + RestClient client = new RestClient(_baseUrl); + + client.ClearHandlers(); + var existingDeserializer = req.JsonSerializer as IDeserializer; + if (existingDeserializer != null) + { + client.AddHandler(() => existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); + } + else + { + client.AddHandler(() => new CustomJsonCodec(configuration), "application/json", "text/json", "text/x-json", "text/javascript", "*+json"); + } + + client.AddHandler(() => new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*"); + + client.Timeout = configuration.Timeout; + + if (configuration.UserAgent != null) + { + client.UserAgent = configuration.UserAgent; + } + + InterceptRequest(req); + + var response = await client.ExecuteAsync(req); + + InterceptResponse(req, response); + + var result = ToApiResponse(response); + if (response.ErrorMessage != null) + { + result.ErrorText = response.ErrorMessage; + } + + if (response.Cookies != null && response.Cookies.Count > 0) + { + if(result.Cookies == null) result.Cookies = new List(); + foreach (var restResponseCookie in response.Cookies) + { + var cookie = new Cookie( + restResponseCookie.Name, + restResponseCookie.Value, + restResponseCookie.Path, + restResponseCookie.Domain + ) + { + Comment = restResponseCookie.Comment, + CommentUri = restResponseCookie.CommentUri, + Discard = restResponseCookie.Discard, + Expired = restResponseCookie.Expired, + Expires = restResponseCookie.Expires, + HttpOnly = restResponseCookie.HttpOnly, + Port = restResponseCookie.Port, + Secure = restResponseCookie.Secure, + Version = restResponseCookie.Version + }; + + result.Cookies.Add(cookie); + } + } + return result; + } + #region IAsynchronousClient /// /// Make a HTTP GET request (async). @@ -457,10 +520,10 @@ namespace Org.OpenAPITools.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Get, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config); } /// @@ -471,10 +534,10 @@ namespace Org.OpenAPITools.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Post, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config); } /// @@ -485,10 +548,10 @@ namespace Org.OpenAPITools.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Put, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config); } /// @@ -499,10 +562,10 @@ namespace Org.OpenAPITools.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Delete, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config); } /// @@ -513,10 +576,10 @@ namespace Org.OpenAPITools.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Head, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config); } /// @@ -527,10 +590,10 @@ namespace Org.OpenAPITools.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Options, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config); } /// @@ -541,10 +604,10 @@ namespace Org.OpenAPITools.Client /// A per-request configuration object. It is assumed that any merge with /// GlobalConfiguration has been done before calling this method. /// A Task containing ApiResponse - public async Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null) { var config = configuration ?? GlobalConfiguration.Instance; - return await Exec(newRequest(HttpMethod.Patch, path, options, config), config); + return ExecAsync(NewRequest(HttpMethod.Patch, path, options, config), config); } #endregion IAsynchronousClient @@ -559,7 +622,8 @@ namespace Org.OpenAPITools.Client /// A Task containing ApiResponse public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null) { - return GetAsync(path, options, configuration).Result; + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Get, path, options, config), config); } /// @@ -572,7 +636,8 @@ namespace Org.OpenAPITools.Client /// A Task containing ApiResponse public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null) { - return PostAsync(path, options, configuration).Result; + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Post, path, options, config), config); } /// @@ -585,7 +650,8 @@ namespace Org.OpenAPITools.Client /// A Task containing ApiResponse public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null) { - return PutAsync(path, options, configuration).Result; + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Put, path, options, config), config); } /// @@ -598,7 +664,8 @@ namespace Org.OpenAPITools.Client /// A Task containing ApiResponse public ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null) { - return DeleteAsync(path, options, configuration).Result; + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Delete, path, options, config), config); } /// @@ -611,7 +678,8 @@ namespace Org.OpenAPITools.Client /// A Task containing ApiResponse public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null) { - return HeadAsync(path, options, configuration).Result; + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Head, path, options, config), config); } /// @@ -624,7 +692,8 @@ namespace Org.OpenAPITools.Client /// A Task containing ApiResponse public ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null) { - return OptionsAsync(path, options, configuration).Result; + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Options, path, options, config), config); } /// @@ -637,7 +706,8 @@ namespace Org.OpenAPITools.Client /// A Task containing ApiResponse public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null) { - return PatchAsync(path, options, configuration).Result; + var config = configuration ?? GlobalConfiguration.Instance; + return Exec(NewRequest(HttpMethod.Patch, path, options, config), config); } #endregion ISynchronousClient } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Multimap.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Multimap.cs index 800b1c47631..4bde7f7ffe4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Multimap.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Multimap.cs @@ -25,8 +25,7 @@ namespace Org.OpenAPITools.Client { #region Private Fields - private readonly ConcurrentDictionary> _dictionary = - new ConcurrentDictionary>(); + private readonly ConcurrentDictionary> _dictionary; #endregion Private Fields @@ -44,7 +43,8 @@ namespace Org.OpenAPITools.Client /// Constructor with comparer. /// /// - public Multimap(IEqualityComparer comparer) { + public Multimap(IEqualityComparer comparer) + { _dictionary = new ConcurrentDictionary>(comparer); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 8d7243e6d1e..d30de15d9e1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -26,7 +26,7 @@ - + From d8c9f25b1075b2325cf078827b3f3643d98c445c Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Sun, 26 Jan 2020 11:36:11 -0500 Subject: [PATCH 30/85] Update sonar.yml Limit next-version release branches to those ending in `.x` --- .github/workflows/sonar.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index dbe6db54b6e..823768c7fcb 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -3,7 +3,7 @@ on: push: branches: - master - - '[4-9]+.[0-9]+.[0-9]+' + - '[4-9]+.[0-9]+.x' jobs: build: From 20afa870a99c4b44bb5ebdc3eb782aebced572e9 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Sun, 26 Jan 2020 08:48:22 -0800 Subject: [PATCH 31/85] [CORE] Add support for HTTP signature (#4993) * Add support for HTTP signature * Add http-signature security scheme * add http_signature_test to security scheme * Add separate OAS file with support for HTTP signature * change URL of apache license to use https * add log warning to indicate the 'http signature' security scheme is still a draft --- .../openapitools/codegen/CodegenSecurity.java | 15 +- .../openapitools/codegen/DefaultCodegen.java | 9 + .../codegen/DefaultGenerator.java | 4 + .../codegen/utils/ProcessUtils.java | 18 + ...odels-for-testing-with-http-signature.yaml | 1776 +++++++++++++++++ 5 files changed, 1818 insertions(+), 4 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java index 83acfcf4821..419aee1d4ad 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java @@ -29,8 +29,11 @@ public class CodegenSecurity { public String type; public String scheme; public Boolean hasMore, isBasic, isOAuth, isApiKey; - // is Basic is true for all http authentication type. Those are to differentiate basic and bearer authentication - public Boolean isBasicBasic, isBasicBearer; + // is Basic is true for all http authentication type. + // Those are to differentiate basic and bearer authentication + // isHttpSignature is to support HTTP signature authorization scheme. + // https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + public Boolean isBasicBasic, isBasicBearer, isHttpSignature; public String bearerFormat; public Map vendorExtensions = new HashMap(); // ApiKey specific @@ -50,6 +53,7 @@ public class CodegenSecurity { filteredSecurity.hasMore = false; filteredSecurity.isBasic = isBasic; filteredSecurity.isBasicBasic = isBasicBasic; + filteredSecurity.isHttpSignature = isHttpSignature; filteredSecurity.isBasicBearer = isBasicBearer; filteredSecurity.isApiKey = isApiKey; filteredSecurity.isOAuth = isOAuth; @@ -97,6 +101,7 @@ public class CodegenSecurity { Objects.equals(isOAuth, that.isOAuth) && Objects.equals(isApiKey, that.isApiKey) && Objects.equals(isBasicBasic, that.isBasicBasic) && + Objects.equals(isHttpSignature, that.isHttpSignature) && Objects.equals(isBasicBearer, that.isBasicBearer) && Objects.equals(bearerFormat, that.bearerFormat) && Objects.equals(vendorExtensions, that.vendorExtensions) && @@ -117,8 +122,9 @@ public class CodegenSecurity { @Override public int hashCode() { - return Objects.hash(name, type, scheme, hasMore, isBasic, isOAuth, isApiKey, isBasicBasic, isBasicBearer, - bearerFormat, vendorExtensions, keyParamName, isKeyInQuery, isKeyInHeader, isKeyInCookie, flow, + return Objects.hash(name, type, scheme, hasMore, isBasic, isOAuth, isApiKey, + isBasicBasic, isHttpSignature, isBasicBearer, bearerFormat, vendorExtensions, + keyParamName, isKeyInQuery, isKeyInHeader, isKeyInCookie, flow, authorizationUrl, tokenUrl, scopes, isCode, isPassword, isApplication, isImplicit); } @@ -133,6 +139,7 @@ public class CodegenSecurity { sb.append(", isOAuth=").append(isOAuth); sb.append(", isApiKey=").append(isApiKey); sb.append(", isBasicBasic=").append(isBasicBasic); + sb.append(", isHttpSignature=").append(isHttpSignature); sb.append(", isBasicBearer=").append(isBasicBearer); sb.append(", bearerFormat='").append(bearerFormat).append('\''); sb.append(", vendorExtensions=").append(vendorExtensions); 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 45677bb61e6..6fd90ee2302 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 @@ -3617,6 +3617,7 @@ public class DefaultCodegen implements CodegenConfig { cs.name = key; cs.type = securityScheme.getType().toString(); cs.isCode = cs.isPassword = cs.isApplication = cs.isImplicit = false; + cs.isHttpSignature = false; cs.isBasicBasic = cs.isBasicBearer = false; cs.scheme = securityScheme.getScheme(); if (securityScheme.getExtensions() != null) { @@ -3638,6 +3639,14 @@ public class DefaultCodegen implements CodegenConfig { } else if ("bearer".equals(securityScheme.getScheme())) { cs.isBasicBearer = true; cs.bearerFormat = securityScheme.getBearerFormat(); + } else if ("signature".equals(securityScheme.getScheme())) { + // HTTP signature as defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + // The registry of security schemes is maintained by IANA. + // https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml + // As of January 2020, the "signature" scheme has not been registered with IANA yet. + // This scheme may have to be changed when it is officially registered with IANA. + cs.isHttpSignature = true; + LOGGER.warn("Security scheme 'HTTP signature' is a draft IETF RFC and subject to change."); } } else if (SecurityScheme.Type.OAUTH2.equals(securityScheme.getType())) { cs.isKeyInHeader = cs.isKeyInQuery = cs.isKeyInCookie = cs.isApiKey = cs.isBasic = false; 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 2d7b768b318..71416272fa5 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 @@ -42,6 +42,7 @@ import org.openapitools.codegen.serializer.SerializerUtils; import org.openapitools.codegen.templating.MustacheEngineAdapter; import org.openapitools.codegen.utils.ImplementationVersion; import org.openapitools.codegen.utils.ModelUtils; +import org.openapitools.codegen.utils.ProcessUtils; import org.openapitools.codegen.utils.URLPathUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -851,6 +852,9 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { if (hasBearerMethods(authMethods)) { bundle.put("hasBearerMethods", true); } + if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { + bundle.put("hasHttpSignatureMethods", true); + } } List servers = config.fromServers(openAPI.getServers()); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java index c2d7859ecb2..499c1d55308 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java @@ -94,4 +94,22 @@ public class ProcessUtils { return false; } + /** + * Returns true if the specified OAS model has at least one operation with the HTTP signature + * security scheme. + * The HTTP signature scheme is defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + * + * @param authMethods List of auth methods. + * @return True if at least one operation has HTTP signature security schema defined + */ + public static boolean hasHttpSignatureMethods(List authMethods) { + if (authMethods != null && !authMethods.isEmpty()) { + for (CodegenSecurity cs : authMethods) { + if (Boolean.TRUE.equals(cs.isHttpSignature)) { + return true; + } + } + } + return false; + } } diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml new file mode 100644 index 00000000000..59d96166c7e --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -0,0 +1,1776 @@ +openapi: 3.0.0 +info: + description: >- + This spec is mainly for testing Petstore server and contains fake endpoints, + models. Please do not use this for any other purpose. Special characters: " + \ + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /foo: + get: + responses: + default: + description: response + content: + application/json: + schema: + type: object + properties: + string: + $ref: '#/components/schemas/Foo' + /pet: + servers: + - url: 'http://petstore.swagger.io/v2' + - url: 'http://path-server-test.petstore.local/v2' + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '405': + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + responses: + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{order_id}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generated exceptions + operationId: getOrderById + parameters: + - name: order_id + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: order_id + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + /fake_classname_test: + patch: + tags: + - 'fake_classname_tags 123#$%^' + summary: To test class name in snake case + description: To test class name in snake case + operationId: testClassname + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + security: + - api_key_query: [] + requestBody: + $ref: '#/components/requestBodies/Client' + /fake: + patch: + tags: + - fake + summary: To test "client" model + description: To test "client" model + operationId: testClientModel + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + get: + tags: + - fake + summary: To test enum parameters + description: To test enum parameters + operationId: testEnumParameters + parameters: + - name: enum_header_string_array + in: header + description: Header parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_header_string + in: header + description: Header parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_string_array + in: query + description: Query parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_query_string + in: query + description: Query parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_integer + in: query + description: Query parameter enum test (double) + schema: + type: integer + format: int32 + enum: + - 1 + - -2 + - name: enum_query_double + in: query + description: Query parameter enum test (double) + schema: + type: number + format: double + enum: + - 1.1 + - -1.2 + responses: + '400': + description: Invalid request + '404': + description: Not found + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + enum_form_string: + description: Form parameter enum test (string) + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + post: + tags: + - fake + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - http_basic_test: [] + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + integer: + description: None + type: integer + minimum: 10 + maximum: 100 + int32: + description: None + type: integer + format: int32 + minimum: 20 + maximum: 200 + int64: + description: None + type: integer + format: int64 + number: + description: None + type: number + minimum: 32.1 + maximum: 543.2 + float: + description: None + type: number + format: float + maximum: 987.6 + double: + description: None + type: number + format: double + minimum: 67.8 + maximum: 123.4 + string: + description: None + type: string + pattern: '/[a-z]/i' + pattern_without_delimiter: + description: None + type: string + pattern: '^[A-Z].*' + byte: + description: None + type: string + format: byte + binary: + description: None + type: string + format: binary + date: + description: None + type: string + format: date + dateTime: + description: None + type: string + format: date-time + password: + description: None + type: string + format: password + minLength: 10 + maxLength: 64 + callback: + description: None + type: string + required: + - number + - double + - pattern_without_delimiter + - byte + delete: + tags: + - fake + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + x-group-parameters: true + parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: integer + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: boolean + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 + - name: string_group + in: query + description: String in group parameters + schema: + type: integer + - name: boolean_group + in: header + description: Boolean in group parameters + schema: + type: boolean + - name: int64_group + in: query + description: Integer in group parameters + schema: + type: integer + format: int64 + responses: + '400': + description: Someting wrong + /fake/outer/number: + post: + tags: + - fake + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + responses: + '200': + description: Output number + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + /fake/outer/string: + post: + tags: + - fake + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + responses: + '200': + description: Output string + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + /fake/outer/boolean: + post: + tags: + - fake + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + responses: + '200': + description: Output boolean + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + /fake/outer/composite: + post: + tags: + - fake + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + responses: + '200': + description: Output composite + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + /fake/jsonFormData: + get: + tags: + - fake + summary: test json serialization of form data + description: '' + operationId: testJsonFormData + responses: + '200': + description: successful operation + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + /fake/inline-additionalProperties: + post: + tags: + - fake + summary: test inline additionalProperties + description: '' + operationId: testInlineAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: + type: string + description: request body + required: true + /fake/body-with-query-params: + put: + tags: + - fake + operationId: testBodyWithQueryParams + parameters: + - name: query + in: query + required: true + schema: + type: string + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + /another-fake/dummy: + patch: + tags: + - $another-fake? + summary: To test special tags + description: To test special tags and operation ID starting with number + operationId: '123_test_@#$%_special_tags' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + /fake/body-with-file-schema: + put: + tags: + - fake + description: >- + For this test, the body for this request much reference a schema named + `File`. + operationId: testBodyWithFileSchema + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + /fake/test-query-paramters: + put: + tags: + - fake + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + schema: + type: array + items: + type: string + - name: ioutil + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string + responses: + "200": + description: Success + '/fake/{petId}/uploadImageWithRequiredFile': + post: + tags: + - pet + summary: uploads an image (required) + description: '' + operationId: uploadFileWithRequiredFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + type: string + format: binary + required: + - requiredFile + /fake/health: + get: + tags: + - fake + summary: Health check endpoint + responses: + 200: + description: The instance started successfully + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' +servers: + - url: 'http://{server}.swagger.io:{port}/v2' + description: petstore server + variables: + server: + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + - url: https://localhost:8080/{version} + description: The local server + variables: + version: + enum: + - 'v1' + - 'v2' + default: 'v2' +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + api_key_query: + type: apiKey + name: api_key_query + in: query + http_basic_test: + type: http + scheme: basic + bearer_test: + type: http + scheme: bearer + bearerFormat: JWT + http_signature_test: + # Test the 'HTTP signature' security scheme. + # Each HTTP request is cryptographically signed as specified + # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + type: http + scheme: signature + schemas: + Foo: + type: object + properties: + bar: + $ref: '#/components/schemas/Bar' + Bar: + type: string + default: bar + Order: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + type: object + required: + - name + properties: + id: + type: integer + format: int64 + name: + type: string + default: default-name + xml: + name: Category + User: + type: object + properties: + id: + type: integer + format: int64 + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + Return: + description: Model for testing reserved words + properties: + return: + type: integer + format: int32 + xml: + name: Return + Name: + description: Model for testing model name same as property name + required: + - name + properties: + name: + type: integer + format: int32 + snake_case: + readOnly: true + type: integer + format: int32 + property: + type: string + 123Number: + type: integer + readOnly: true + xml: + name: Name + 200_response: + description: Model for testing model name starting with number + properties: + name: + type: integer + format: int32 + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + declawed: + type: boolean + Animal: + type: object + discriminator: + propertyName: className + required: + - className + properties: + className: + type: string + color: + type: string + default: red + AnimalFarm: + type: array + items: + $ref: '#/components/schemas/Animal' + format_test: + type: object + required: + - number + - byte + - date + - password + properties: + integer: + type: integer + maximum: 100 + minimum: 10 + int32: + type: integer + format: int32 + maximum: 200 + minimum: 20 + int64: + type: integer + format: int64 + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + type: number + format: float + maximum: 987.6 + minimum: 54.3 + double: + type: number + format: double + maximum: 123.4 + minimum: 67.8 + string: + type: string + pattern: '/[a-z]/i' + byte: + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + dateTime: + type: string + format: date-time + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + password: + type: string + format: password + maxLength: 64 + minLength: 10 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + type: string + pattern: '^\d{10}$' + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + type: string + pattern: '/^image_\d{1,3}$/i' + EnumClass: + type: string + default: '-efg' + enum: + - _abc + - '-efg' + - (xyz) + Enum_Test: + type: object + required: + - enum_string_required + properties: + enum_string: + type: string + enum: + - UPPER + - lower + - '' + enum_string_required: + type: string + enum: + - UPPER + - lower + - '' + enum_integer: + type: integer + format: int32 + enum: + - 1 + - -1 + enum_number: + type: number + format: double + enum: + - 1.1 + - -1.2 + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + AdditionalPropertiesClass: + type: object + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + MixedPropertiesAndAdditionalPropertiesClass: + type: object + properties: + uuid: + type: string + format: uuid + dateTime: + type: string + format: date-time + map: + type: object + additionalProperties: + $ref: '#/components/schemas/Animal' + List: + type: object + properties: + 123-list: + type: string + Client: + type: object + properties: + client: + type: string + ReadOnlyFirst: + type: object + properties: + bar: + type: string + readOnly: true + baz: + type: string + hasOnlyReadOnly: + type: object + properties: + bar: + type: string + readOnly: true + foo: + type: string + readOnly: true + Capitalization: + type: object + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + MapTest: + type: object + properties: + map_map_of_string: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + map_of_enum_string: + type: object + additionalProperties: + type: string + enum: + - UPPER + - lower + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' + ArrayTest: + type: object + properties: + array_of_string: + type: array + items: + type: string + array_array_of_integer: + type: array + items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: '#/components/schemas/ReadOnlyFirst' + NumberOnly: + type: object + properties: + JustNumber: + type: number + ArrayOfNumberOnly: + type: object + properties: + ArrayNumber: + type: array + items: + type: number + ArrayOfArrayOfNumberOnly: + type: object + properties: + ArrayArrayNumber: + type: array + items: + type: array + items: + type: number + EnumArrays: + type: object + properties: + just_symbol: + type: string + enum: + - '>=' + - $ + array_enum: + type: array + items: + type: string + enum: + - fish + - crab + OuterEnum: + nullable: true + type: string + enum: + - placed + - approved + - delivered + OuterEnumInteger: + type: integer + enum: + - 0 + - 1 + - 2 + OuterEnumDefaultValue: + type: string + enum: + - placed + - approved + - delivered + default: placed + OuterEnumIntegerDefaultValue: + type: integer + enum: + - 0 + - 1 + - 2 + default: 0 + OuterComposite: + type: object + properties: + my_number: + $ref: '#/components/schemas/OuterNumber' + my_string: + $ref: '#/components/schemas/OuterString' + my_boolean: + $ref: '#/components/schemas/OuterBoolean' + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + FileSchemaTestClass: + type: object + properties: + file: + $ref: '#/components/schemas/File' + files: + type: array + items: + $ref: '#/components/schemas/File' + File: + type: object + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + _special_model.name_: + properties: + '$special[property.name]': + type: integer + format: int64 + xml: + name: '$special[model.name]' + HealthCheckResult: + type: object + properties: + NullableMessage: + nullable: true + type: string + description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + NullableClass: + type: object + properties: + integer_prop: + type: integer + nullable: true + number_prop: + type: number + nullable: true + boolean_prop: + type: boolean + nullable: true + string_prop: + type: string + nullable: true + date_prop: + type: string + format: date + nullable: true + datetime_prop: + type: string + format: date-time + nullable: true + array_nullable_prop: + type: array + nullable: true + items: + type: object + array_and_items_nullable_prop: + type: array + nullable: true + items: + type: object + nullable: true + array_items_nullable: + type: array + items: + type: object + nullable: true + object_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + object_and_items_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + object_items_nullable: + type: object + additionalProperties: + type: object + nullable: true + additionalProperties: + type: object + nullable: true From c0f7b472925654453d90f6ab4bf6696998b50c26 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Sun, 26 Jan 2020 12:45:41 -0500 Subject: [PATCH 32/85] [ci][test] Modifications to static analysis contribution via Tomasbjerre (#5116) * Spotbugs, PMD and Checkstyle #33 * Reducing Spotbugs effort to min #33 * Also using project.parent.basedir and avoiding relative paths in pom files. * Filtering out samples. * Move PMD/Spotbugs to static-analysis profile This moves the static-analysis checks to a standalone profile. Core contributors may run static analysis with: ``` mvn -Pstatic-analysis install ``` The analysis is separated from default functionality to reduce impact to community contributions. SpotBugs/PMD may add a non-trivial amount of time to builds on some machines. Co-authored-by: Tomas Bjerre --- .gitignore | 3 + README.md | 6 + modules/openapi-generator-cli/pom.xml | 32 ++++ modules/openapi-generator-core/pom.xml | 37 +++++ .../openapi-generator-gradle-plugin/pom.xml | 31 ++++ .../openapi-generator-maven-plugin/pom.xml | 32 ++++ modules/openapi-generator-online/pom.xml | 36 +++++ modules/openapi-generator/pom.xml | 34 +++++ pom.xml | 143 ++++++++++++++++++ spotbugs-exclude.xml | 34 +++++ 10 files changed, 388 insertions(+) create mode 100644 spotbugs-exclude.xml diff --git a/.gitignore b/.gitignore index 81c33b22aac..a73007c3ad5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.mvn/.gradle-enterprise/ .scannerwork/ .vscode *.iml @@ -29,6 +30,8 @@ packages/ .vagrant/ .vscode/ **/.vs +bin +.factorypath .settings diff --git a/README.md b/README.md index 6a5a81e8966..da24519d45a 100644 --- a/README.md +++ b/README.md @@ -252,6 +252,12 @@ If you don't have maven installed, you may directly use the included [maven wrap ./mvnw clean install ``` +The default build contains minimal static analysis (via CheckStyle). To run your build with PMD and Spotbugs, use the `static-analysis` profile: + +```sh +mvn -Pstatic-analysis clean install +``` + ### [1.5 - Homebrew](#table-of-contents) To install, run `brew install openapi-generator` diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index 6aa9eb42def..940242562ec 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -26,6 +26,13 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + + ${project.parent.basedir}${file.separator}google_checkstyle.xml + + org.apache.maven.plugins maven-jar-plugin @@ -73,6 +80,31 @@ + + + static-analysis + + + + com.github.spotbugs + spotbugs-maven-plugin + + ${project.parent.basedir}${file.separator}spotbugs-exclude.xml + + + + org.apache.maven.plugins + maven-pmd-plugin + + + se.bjurr.violations + violations-maven-plugin + + + + + + diff --git a/modules/openapi-generator-core/pom.xml b/modules/openapi-generator-core/pom.xml index 58e2f5714d2..c0b948f9849 100644 --- a/modules/openapi-generator-core/pom.xml +++ b/modules/openapi-generator-core/pom.xml @@ -16,6 +16,18 @@ openapi-generator-core https://github.com/openapitools/openapi-generator + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + ${project.parent.basedir}${file.separator}google_checkstyle.xml + + + + + com.google.guava @@ -34,6 +46,31 @@ + + + static-analysis + + + + com.github.spotbugs + spotbugs-maven-plugin + + ${project.parent.basedir}${file.separator}spotbugs-exclude.xml + + + + org.apache.maven.plugins + maven-pmd-plugin + + + se.bjurr.violations + violations-maven-plugin + + + + + + 1.7.12 26.0-jre diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index 3508398624d..3faf989a6bb 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -65,6 +65,13 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + + ${project.parent.basedir}${file.separator}google_checkstyle.xml + + org.fortasoft @@ -104,4 +111,28 @@ + + + static-analysis + + + + com.github.spotbugs + spotbugs-maven-plugin + + ${project.parent.basedir}${file.separator}spotbugs-exclude.xml + + + + org.apache.maven.plugins + maven-pmd-plugin + + + se.bjurr.violations + violations-maven-plugin + + + + + diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml index d74b8ff5624..84844cc99c1 100644 --- a/modules/openapi-generator-maven-plugin/pom.xml +++ b/modules/openapi-generator-maven-plugin/pom.xml @@ -89,6 +89,13 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + + ${project.parent.basedir}${file.separator}google_checkstyle.xml + + net.revelc.code formatter-maven-plugin @@ -99,4 +106,29 @@ + + + + static-analysis + + + + com.github.spotbugs + spotbugs-maven-plugin + + ${project.parent.basedir}${file.separator}spotbugs-exclude.xml + + + + org.apache.maven.plugins + maven-pmd-plugin + + + se.bjurr.violations + violations-maven-plugin + + + + + diff --git a/modules/openapi-generator-online/pom.xml b/modules/openapi-generator-online/pom.xml index 1d50a9c70f4..bba07959468 100644 --- a/modules/openapi-generator-online/pom.xml +++ b/modules/openapi-generator-online/pom.xml @@ -42,6 +42,13 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + + ${project.parent.basedir}${file.separator}google_checkstyle.xml + + org.springframework.boot spring-boot-maven-plugin @@ -56,6 +63,35 @@ + + + + static-analysis + + + + com.github.spotbugs + spotbugs-maven-plugin + + ${project.parent.basedir}${file.separator}spotbugs-exclude.xml + + + + org.apache.maven.plugins + maven-pmd-plugin + + + se.bjurr.violations + violations-maven-plugin + + + 3 + + + + + + org.springframework.boot diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index 69f0314bb62..dea98573b94 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -43,6 +43,13 @@ target ${project.artifactId}-${project.version} + + org.apache.maven.plugins + maven-checkstyle-plugin + + ${project.parent.basedir}${file.separator}google_checkstyle.xml + + org.codehaus.mojo exec-maven-plugin @@ -155,6 +162,33 @@ + + static-analysis + + + + com.github.spotbugs + spotbugs-maven-plugin + + ${project.parent.basedir}${file.separator}spotbugs-exclude.xml + + + + org.apache.maven.plugins + maven-pmd-plugin + + + se.bjurr.violations + violations-maven-plugin + + + 65 + + + + + target/site diff --git a/pom.xml b/pom.xml index 2bfd23742cf..721f86d042c 100644 --- a/pom.xml +++ b/pom.xml @@ -100,6 +100,25 @@ target ${project.artifactId}-${project.version} + + org.apache.maven.plugins + maven-checkstyle-plugin + ${checkstyle.plugin.version} + + false + false + **/samples/*.java + + + + checkstyle-check + + check + + verify + + + net.revelc.code formatter-maven-plugin @@ -360,11 +379,64 @@ + + se.bjurr.violations + violations-maven-plugin + ${violations-maven.plugin.version} + + 0 + VERBOSE + ERROR + + + FINDBUGS + Spotbugs + ${project.basedir} + .*/spotbugsXml\.xml$ + + + PMD + PMD + ${project.basedir} + .*/pmd\.xml$ + + + CHECKSTYLE + Checkstyle + ${project.basedir} + .*/checkstyle-result\.xml$ + + + + + + verify + + violations + + + + net.revelc.code formatter-maven-plugin 0.5.2 + + com.github.spotbugs + spotbugs-maven-plugin + ${spotbugs.plugin.version} + + + org.apache.maven.plugins + maven-pmd-plugin + ${pmd.plugin.version} + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${checkstyle.plugin.version} + @@ -470,6 +542,73 @@ + + + + static-analysis + + true + true + + + + + com.github.spotbugs + spotbugs-maven-plugin + ${spotbugs.plugin.version} + + false + + min + ${project.basedir}${file.separator}spotbugs-exclude.xml + + + + spotbugs-check + + check + + verify + + + + + org.apache.maven.plugins + maven-pmd-plugin + ${pmd.plugin.version} + + ${project.build.sourceEncoding} + false + false + + category/java/errorprone.xml + + + **/samples/**/* + + + + + pmd-check + + check + + verify + + + + + + + + + com.github.spotbugs + spotbugs-maven-plugin + ${spotbugs.plugin.version} + + + + android-client @@ -1464,5 +1603,9 @@ 0.9.10 3.2.0 0.8.5 + 3.1.12.2 + 3.12.0 + 1.34 + 3.1.0 diff --git a/spotbugs-exclude.xml b/spotbugs-exclude.xml new file mode 100644 index 00000000000..82568cd7d08 --- /dev/null +++ b/spotbugs-exclude.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 4f350bc01cb3aaadf71122ee9d4f1b975e1f2295 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Sun, 26 Jan 2020 18:17:26 -0800 Subject: [PATCH 33/85] [Python] Support for HTTP signature (#4958) * start implementation of HTTP signature * add api key parameters for http message signature * HTTP signature authentication * start implementation of HTTP signature * add api key parameters for http message signature * HTTP signature authentication * HTTP signature authentication * start implementation of HTTP signature * fix merge issues * Address formatting issues * Address formatting issues * move python-experimental-openapiv3-sample to a separate PR * Add support for HTTP signature * Add code comments * Add code comments * Fix formatting issues * Fix formatting issues * Fix formatting issues * add code comments * add code comments * fix python formatting issues * Make PKCS1v15 string constant consistent between Python and Golang * fix python formatting issues * Add code comments in generated Python. Start adding unit tests for HTTP signature * compliance with HTTP signature draft 12 * compliance with HTTP signature draft 12 * working on review comments * working on review comments * working on review comments * working on review comments * working on review comments * working on review comments * working on review comments * working on review comments * working on review comments * fix python formatting issues * fix trailing white space * address PR comments * address PR comments * address PR comments * Add suppport for '(expires)' signature parameter * address PR comments * address PR comments * Fix python formatting issues * Fix python formatting issues * Starting to move code to dedicated file for HTTP signatures * Continue to refactor code to dedicated file for HTTP signatures * Continue to refactor code to dedicated file for HTTP signatures * Continue to refactor code to dedicated file for HTTP signatures * Continue to refactor code to dedicated file for HTTP signatures * move method to ProcessUtils * conditionally build signing.py * move method to ProcessUtils * Code reformatting * externalize http signature configuration * address PR review comments * address PR review comments * run samples scripts * Address PR review comments * Move 'private_key' field to signing module * Move 'private_key' field to signing module * code cleanup * remove use of strftime('%s'), which is non portable * code cleanup * code cleanup * code cleanup * run sample scripts * Address PR review comments. * Add http-signature security scheme * Run sample scripts for go * Fix issue uncovered in integration branch * Fix issue uncovered in integration branch * Fix issue uncovered in integration branch * Fix issue uncovered in integration branch * Run samples scripts * move http signature tests to separate file * move http signature tests to separate file * unit tests for HTTP signature * continue implementation of unit tests * add http_signature_test to security scheme * add unit tests for http signature * address review comments * remove http signature from petapi * Add separate OAS file with support for HTTP signature * Add support for private key passphrase. Add more unit tests * Add unit test to validate the signature against the public key * remove http signature from petstore-with-fake-endpoints-models-for-testing.yaml * fix unit test issues * run scripts in bin directory * Refact unit test with better variable names * do not throw exception if security scheme is unrecognized * change URL of apache license to use https * sync from master * fix usage of escape character in python regex. Fix generated python documentation * write HTTP signed headers in user-specified order. Fix PEP8 formatting issues * write HTTP signed headers in user-specified order. Fix PEP8 formatting issues * http signature unit tests * Fix PEP8 format issue * spread out each requirement to a separate line * run samples scripts * run sample scripts * remove encoding of '+' character --- bin/openapi3/python-experimental-petstore.sh | 4 +- .../PythonClientExperimentalCodegen.java | 10 + .../resources/python/configuration.mustache | 57 +- .../README_common.mustache | 3 + .../python/python-experimental/api.mustache | 2 +- .../python-experimental/api_client.mustache | 26 +- .../python/python-experimental/setup.mustache | 15 +- .../python-experimental/signing.mustache | 368 +++++++++++++ .../test-requirements.mustache | 3 + .../python/python_doc_auth_partial.mustache | 22 + .../petstore_api/configuration.py | 48 +- .../petstore_api/api_client.py | 17 +- .../petstore_api/configuration.py | 48 +- .../petstore/python-experimental/setup.py | 7 +- .../tests/test_api_client.py | 8 +- .../python-experimental/tests/test_pet_api.py | 14 +- .../petstore_api/configuration.py | 48 +- .../python/petstore_api/configuration.py | 48 +- .../petstore/python-experimental/README.md | 5 + .../python-experimental/docs/PetApi.md | 92 +++- .../petstore_api/api/pet_api.py | 4 + .../petstore_api/api_client.py | 24 +- .../petstore_api/configuration.py | 55 +- .../petstore_api/signing.py | 376 +++++++++++++ .../petstore/python-experimental/setup.py | 9 +- .../python-experimental/test-requirements.txt | 1 + .../python-experimental/tests/__init__.py | 0 .../tests/test_http_signature.py | 501 ++++++++++++++++++ .../python-experimental/tests/util.py | 8 + .../python/petstore_api/configuration.py | 48 +- 30 files changed, 1827 insertions(+), 44 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests/util.py diff --git a/bin/openapi3/python-experimental-petstore.sh b/bin/openapi3/python-experimental-petstore.sh index 7b4007372b2..71cd902dee5 100755 --- a/bin/openapi3/python-experimental-petstore.sh +++ b/bin/openapi3/python-experimental-petstore.sh @@ -27,6 +27,8 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples/openapi3/client/petstore/python-experimental/ --additional-properties packageName=petstore_api $@" +#yaml="modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml" +yaml="modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml" +ags="generate -t modules/openapi-generator/src/main/resources/python -i $yaml -g python-experimental -o samples/openapi3/client/petstore/python-experimental/ --additional-properties packageName=petstore_api $@" java $JAVA_OPTS -jar $executable $ags diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index b2a6a04b958..94aa9c2f076 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -25,12 +25,14 @@ import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.responses.ApiResponse; +import io.swagger.v3.oas.models.security.SecurityScheme; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.examples.ExampleGenerator; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.utils.ModelUtils; +import org.openapitools.codegen.utils.ProcessUtils; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; import org.slf4j.Logger; @@ -116,6 +118,14 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { supportingFiles.add(new SupportingFile("python-experimental/__init__package.mustache", packagePath(), "__init__.py")); + // Generate the 'signing.py' module, but only if the 'HTTP signature' security scheme is specified in the OAS. + Map securitySchemeMap = openAPI != null ? + (openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null) : null; + List authMethods = fromSecurity(securitySchemeMap); + if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { + supportingFiles.add(new SupportingFile("python-experimental/signing.mustache", packagePath(), "signing.py")); + } + Boolean generateSourceCodeOnly = false; if (additionalProperties.containsKey(CodegenConstants.SOURCECODEONLY_GENERATION)) { generateSourceCodeOnly = Boolean.valueOf(additionalProperties.get(CodegenConstants.SOURCECODEONLY_GENERATION).toString()); diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 1aed945621f..3e0a1567657 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -31,6 +31,8 @@ class Configuration(object): The dict value is an API key prefix when generating the auth data. :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication + :param signing_info: Configuration parameters for HTTP signature. + Must be an instance of {{{packageName}}}.signing.HttpSigningConfiguration :Example: @@ -49,11 +51,50 @@ class Configuration(object): ) The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 + + Configure API client with HTTP basic authentication: + conf = {{{packageName}}}.Configuration( + username='the-user', + password='the-password', + ) + + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the {{{packageName}}}.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + + conf = {{{packageName}}}.Configuration( + signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) + ) """ def __init__(self, host="{{{basePath}}}", api_key=None, api_key_prefix=None, - username=None, password=None): + username=None, password=None, + signing_info=None): """Constructor """ self.host = host @@ -82,6 +123,11 @@ class Configuration(object): self.password = password """Password for HTTP basic authentication """ + if signing_info is not None: + signing_info.host = host + self.signing_info = signing_info + """The HTTP signing configuration + """ {{#hasOAuthMethods}} self.access_token = "" """access token for OAuth/Bearer @@ -318,6 +364,15 @@ class Configuration(object): 'value': 'Bearer ' + self.access_token } {{/isBasicBearer}} + {{#isHttpSignature}} + if self.signing_info is not None: + auth['{{name}}'] = { + 'type': 'http-signature', + 'in': 'header', + 'key': 'Authorization', + 'value': None # Signature headers are calculated for every HTTP request + } + {{/isHttpSignature}} {{/isBasic}} {{#isOAuth}} if self.access_token is not None: diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache index d8185eea5a0..5fffdc74fc6 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache @@ -56,6 +56,9 @@ Class | Method | HTTP request | Description {{#isBasicBearer}} - **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} {{/isBasicBearer}} +{{#isHttpSignature}} +- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{/isBasic}} {{#isOAuth}} - **Type**: OAuth diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache index 2182d7362d0..8390a848d26 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache @@ -120,7 +120,7 @@ class {{classname}}(object): {{#-first}} 'auth': [ {{/-first}} - '{{name}}'{{#hasMore}}, {{/hasMore}} + '{{name}}'{{#hasMore}},{{/hasMore}} {{#-last}} ], {{/-last}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index c9d7eac63e7..95208961203 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -150,13 +150,14 @@ class ApiClient(object): collection_formats) post_params.extend(self.files_parameters(files)) - # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings) - # body if body: body = self.sanitize_for_serialization(body) + # auth setting + self.update_params_for_auth(header_params, query_params, + auth_settings, resource_path, method, body) + # request url if _host is None: url = self.configuration.host + resource_path @@ -517,12 +518,17 @@ class ApiClient(object): else: return content_types[0] - def update_params_for_auth(self, headers, querys, auth_settings): + def update_params_for_auth(self, headers, querys, auth_settings, + resource_path, method, body): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param querys: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). """ if not auth_settings: return @@ -533,7 +539,17 @@ class ApiClient(object): if auth_setting['in'] == 'cookie': headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] +{{#hasHttpSignatureMethods}} + else: + # The HTTP signature scheme requires multiple HTTP headers + # that are calculated dynamically. + signing_info = self.configuration.signing_info + auth_headers = signing_info.get_http_signature_headers( + resource_path, method, headers, body, querys) + headers.update(auth_headers) +{{/hasHttpSignatureMethods}} elif auth_setting['in'] == 'query': querys.append((auth_setting['key'], auth_setting['value'])) else: diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache index bf9ffe07d08..2fe84efcee0 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache @@ -16,13 +16,22 @@ VERSION = "{{packageVersion}}" # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] +REQUIRES = [ + "urllib3 >= 1.15", + "six >= 1.10", + "certifi", + "python-dateutil", {{#asyncio}} -REQUIRES.append("aiohttp >= 3.0.0") + "aiohttp >= 3.0.0", {{/asyncio}} {{#tornado}} -REQUIRES.append("tornado>=4.2,<5") + "tornado>=4.2,<5", {{/tornado}} +{{#hasHttpSignatureMethods}} + "pem>=19.3.0", + "pycryptodome>=3.9.0", +{{/hasHttpSignatureMethods}} +] EXTRAS = {':python_version <= "2.7"': ['future']} setup( diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache new file mode 100644 index 00000000000..d191bbf4852 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -0,0 +1,368 @@ +# coding: utf-8 +{{>partial_header}} +from __future__ import absolute_import + +from base64 import b64encode +from Crypto.IO import PEM, PKCS8 +from Crypto.Hash import SHA256, SHA512 +from Crypto.PublicKey import RSA, ECC +from Crypto.Signature import PKCS1_v1_5, pss, DSS +from datetime import datetime +from email.utils import formatdate +import json +import os +import re +from six.moves.urllib.parse import urlencode, urlparse +from time import mktime + +HEADER_REQUEST_TARGET = '(request-target)' +HEADER_CREATED = '(created)' +HEADER_EXPIRES = '(expires)' +HEADER_HOST = 'Host' +HEADER_DATE = 'Date' +HEADER_DIGEST = 'Digest' # RFC 3230, include digest of the HTTP request body. +HEADER_AUTHORIZATION = 'Authorization' + +SCHEME_HS2019 = 'hs2019' +SCHEME_RSA_SHA256 = 'rsa-sha256' +SCHEME_RSA_SHA512 = 'rsa-sha512' + +ALGORITHM_RSASSA_PSS = 'RSASSA-PSS' +ALGORITHM_RSASSA_PKCS1v15 = 'RSASSA-PKCS1-v1_5' + +ALGORITHM_ECDSA_MODE_FIPS_186_3 = 'fips-186-3' +ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' +ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = { + ALGORITHM_ECDSA_MODE_FIPS_186_3, + ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 +} + + +class HttpSigningConfiguration(object): + """The configuration parameters for the HTTP signature security scheme. + The HTTP signature security scheme is used to sign HTTP requests with a private key + which is in possession of the API client. + An 'Authorization' header is calculated by creating a hash of select headers, + and optionally the body of the HTTP request, then signing the hash value using + a private key. The 'Authorization' header is added to outbound HTTP requests. + + NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param key_id: A string value specifying the identifier of the cryptographic key, + when signing HTTP requests. + :param signing_scheme: A string value specifying the signature scheme, when + signing HTTP requests. + Supported value are hs2019, rsa-sha256, rsa-sha512. + Avoid using rsa-sha256, rsa-sha512 as they are deprecated. These values are + available for server-side applications that only support the older + HTTP signature algorithms. + :param private_key_path: A string value specifying the path of the file containing + a private key. The private key is used to sign HTTP requests. + :param private_key_passphrase: A string value specifying the passphrase to decrypt + the private key. + :param signed_headers: A list of strings. Each value is the name of a HTTP header + that must be included in the HTTP signature calculation. + The two special signature headers '(request-target)' and '(created)' SHOULD be + included in SignedHeaders. + The '(created)' header expresses when the signature was created. + The '(request-target)' header is a concatenation of the lowercased :method, an + ASCII space, and the :path pseudo-headers. + When signed_headers is not specified, the client defaults to a single value, + '(created)', in the list of HTTP headers. + When SignedHeaders contains the 'Digest' value, the client performs the + following operations: + 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. + 2. Set the 'Digest' header in the request body. + 3. Include the 'Digest' header and value in the HTTP signature. + :param signing_algorithm: A string value specifying the signature algorithm, when + signing HTTP requests. + Supported values are: + 1. For RSA keys: RSASSA-PSS, RSASSA-PKCS1-v1_5. + 2. For ECDSA keys: fips-186-3, deterministic-rfc6979. + The default value is inferred from the private key. + The default value for RSA keys is RSASSA-PSS. + The default value for ECDSA keys is fips-186-3. + :param signature_max_validity: The signature max validity, expressed as + a datetime.timedelta value. It must be a positive value. + """ + def __init__(self, key_id, signing_scheme, private_key_path, + private_key_passphrase=None, + signed_headers=None, + signing_algorithm=None, + signature_max_validity=None): + self.key_id = key_id + if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}: + raise Exception("Unsupported security scheme: {0}".format(signing_scheme)) + self.signing_scheme = signing_scheme + if not os.path.exists(private_key_path): + raise Exception("Private key file does not exist") + self.private_key_path = private_key_path + self.private_key_passphrase = private_key_passphrase + self.signing_algorithm = signing_algorithm + if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: + raise Exception("The signature max validity must be a positive value") + self.signature_max_validity = signature_max_validity + # If the user has not provided any signed_headers, the default must be set to '(created)', + # as specified in the 'HTTP signature' standard. + if signed_headers is None or len(signed_headers) == 0: + signed_headers = [HEADER_CREATED] + if self.signature_max_validity is None and HEADER_EXPIRES in signed_headers: + raise Exception( + "Signature max validity must be set when " + "'(expires)' signature parameter is specified") + if len(signed_headers) != len(set(signed_headers)): + raise Exception("Cannot have duplicates in the signed_headers parameter") + if HEADER_AUTHORIZATION in signed_headers: + raise Exception("'Authorization' header cannot be included in signed headers") + self.signed_headers = signed_headers + self.private_key = None + """The private key used to sign HTTP requests. + Initialized when the PEM-encoded private key is loaded from a file. + """ + self.host = None + """The host name, optionally followed by a colon and TCP port number. + """ + self._load_private_key() + + def get_http_signature_headers(self, resource_path, method, headers, body, query_params): + """Create a cryptographic message signature for the HTTP request and add the signed headers. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The object representing the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A dict of HTTP headers that must be added to the outbound HTTP request. + """ + if method is None: + raise Exception("HTTP method must be set") + if resource_path is None: + raise Exception("Resource path must be set") + + signed_headers_list, request_headers_dict = self._get_signed_header_info( + resource_path, method, headers, body, query_params) + + header_items = [ + "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list] + string_to_sign = "\n".join(header_items) + + digest, digest_prefix = self._get_message_digest(string_to_sign.encode()) + b64_signed_msg = self._sign_digest(digest) + + request_headers_dict[HEADER_AUTHORIZATION] = self._get_authorization_header( + signed_headers_list, b64_signed_msg) + + return request_headers_dict + + def get_public_key(self): + """Returns the public key object associated with the private key. + """ + pubkey = None + if isinstance(self.private_key, RSA.RsaKey): + pubkey = self.private_key.publickey() + elif isinstance(self.private_key, ECC.EccKey): + pubkey = self.private_key.public_key() + return pubkey + + def _load_private_key(self): + """Load the private key used to sign HTTP requests. + The private key is used to sign HTTP requests as defined in + https://datatracker.ietf.org/doc/draft-cavage-http-signatures/. + """ + if self.private_key is not None: + return + with open(self.private_key_path, 'r') as f: + pem_data = f.read() + # Verify PEM Pre-Encapsulation Boundary + r = re.compile(r"\s*-----BEGIN (.*)-----\s+") + m = r.match(pem_data) + if not m: + raise ValueError("Not a valid PEM pre boundary") + pem_header = m.group(1) + if pem_header == 'RSA PRIVATE KEY': + self.private_key = RSA.importKey(pem_data, self.private_key_passphrase) + elif pem_header == 'EC PRIVATE KEY': + self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) + elif pem_header in {'PRIVATE KEY', 'ENCRYPTED PRIVATE KEY'}: + # Key is in PKCS8 format, which is capable of holding many different + # types of private keys, not just EC keys. + (key_binary, pem_header, is_encrypted) = \ + PEM.decode(pem_data, self.private_key_passphrase) + (oid, privkey, params) = \ + PKCS8.unwrap(key_binary, passphrase=self.private_key_passphrase) + if oid == '1.2.840.10045.2.1': + self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) + else: + raise Exception("Unsupported key: {0}. OID: {1}".format(pem_header, oid)) + else: + raise Exception("Unsupported key: {0}".format(pem_header)) + # Validate the specified signature algorithm is compatible with the private key. + if self.signing_algorithm is not None: + supported_algs = None + if isinstance(self.private_key, RSA.RsaKey): + supported_algs = {ALGORITHM_RSASSA_PSS, ALGORITHM_RSASSA_PKCS1v15} + elif isinstance(self.private_key, ECC.EccKey): + supported_algs = ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS + if supported_algs is not None and self.signing_algorithm not in supported_algs: + raise Exception( + "Signing algorithm {0} is not compatible with private key".format( + self.signing_algorithm)) + + def _get_unix_time(self, ts): + """Converts and returns a datetime object to UNIX time, the number of seconds + elapsed since January 1, 1970 UTC. + """ + return (ts - datetime(1970, 1, 1)).total_seconds() + + def _get_signed_header_info(self, resource_path, method, headers, body, query_params): + """Build the HTTP headers (name, value) that need to be included in + the HTTP signature scheme. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The object (e.g. a dict) representing the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A tuple containing two dict objects: + The first dict contains the HTTP headers that are used to calculate + the HTTP signature. + The second dict contains the HTTP headers that must be added to + the outbound HTTP request. + """ + + if body is None: + body = '' + else: + body = json.dumps(body) + + # Build the '(request-target)' HTTP signature parameter. + target_host = urlparse(self.host).netloc + target_path = urlparse(self.host).path + request_target = method.lower() + " " + target_path + resource_path + if query_params: + request_target += "?" + urlencode(query_params) + + # Get current time and generate RFC 1123 (HTTP/1.1) date/time string. + now = datetime.now() + stamp = mktime(now.timetuple()) + cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) + # The '(created)' value MUST be a Unix timestamp integer value. + # Subsecond precision is not supported. + created = int(self._get_unix_time(now)) + if self.signature_max_validity is not None: + expires = self._get_unix_time(now + self.signature_max_validity) + + signed_headers_list = [] + request_headers_dict = {} + for hdr_key in self.signed_headers: + hdr_key = hdr_key.lower() + if hdr_key == HEADER_REQUEST_TARGET: + value = request_target + elif hdr_key == HEADER_CREATED: + value = '{0}'.format(created) + elif hdr_key == HEADER_EXPIRES: + value = '{0}'.format(expires) + elif hdr_key == HEADER_DATE.lower(): + value = cdate + request_headers_dict[HEADER_DATE] = '{0}'.format(cdate) + elif hdr_key == HEADER_DIGEST.lower(): + request_body = body.encode() + body_digest, digest_prefix = self._get_message_digest(request_body) + b64_body_digest = b64encode(body_digest.digest()) + value = digest_prefix + b64_body_digest.decode('ascii') + request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format( + digest_prefix, b64_body_digest.decode('ascii')) + elif hdr_key == HEADER_HOST.lower(): + value = target_host + request_headers_dict[HEADER_HOST] = '{0}'.format(target_host) + else: + value = next((v for k, v in headers.items() if k.lower() == hdr_key), None) + if value is None: + raise Exception( + "Cannot sign HTTP request. " + "Request does not contain the '{0}' header".format(hdr_key)) + signed_headers_list.append((hdr_key, value)) + + return signed_headers_list, request_headers_dict + + def _get_message_digest(self, data): + """Calculates and returns a cryptographic digest of a specified HTTP request. + + :param data: The string representation of the date to be hashed with a cryptographic hash. + :return: A tuple of (digest, prefix). + The digest is a hashing object that contains the cryptographic digest of + the HTTP request. + The prefix is a string that identifies the cryptographc hash. It is used + to generate the 'Digest' header as specified in RFC 3230. + """ + if self.signing_scheme in {SCHEME_RSA_SHA512, SCHEME_HS2019}: + digest = SHA512.new() + prefix = 'SHA-512=' + elif self.signing_scheme == SCHEME_RSA_SHA256: + digest = SHA256.new() + prefix = 'SHA-256=' + else: + raise Exception("Unsupported signing algorithm: {0}".format(self.signing_scheme)) + digest.update(data) + return digest, prefix + + def _sign_digest(self, digest): + """Signs a message digest with a private key specified in the signing_info. + + :param digest: A hashing object that contains the cryptographic digest of the HTTP request. + :return: A base-64 string representing the cryptographic signature of the input digest. + """ + sig_alg = self.signing_algorithm + if isinstance(self.private_key, RSA.RsaKey): + if sig_alg is None or sig_alg == ALGORITHM_RSASSA_PSS: + # RSASSA-PSS in Section 8.1 of RFC8017. + signature = pss.new(self.private_key).sign(digest) + elif sig_alg == ALGORITHM_RSASSA_PKCS1v15: + # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. + signature = PKCS1_v1_5.new(self.private_key).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) + elif isinstance(self.private_key, ECC.EccKey): + if sig_alg is None: + sig_alg = ALGORITHM_ECDSA_MODE_FIPS_186_3 + if sig_alg in ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS: + signature = DSS.new(self.private_key, sig_alg).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) + else: + raise Exception("Unsupported private key: {0}".format(type(self.private_key))) + return b64encode(signature) + + def _get_authorization_header(self, signed_headers, signed_msg): + """Calculates and returns the value of the 'Authorization' header when signing HTTP requests. + + :param signed_headers : A list of tuples. Each value is the name of a HTTP header that + must be included in the HTTP signature calculation. + :param signed_msg: A base-64 encoded string representation of the signature. + :return: The string value of the 'Authorization' header, representing the signature + of the HTTP request. + """ + created_ts = None + expires_ts = None + for k, v in signed_headers: + if k == HEADER_CREATED: + created_ts = v + elif k == HEADER_EXPIRES: + expires_ts = v + lower_keys = [k.lower() for k, v in signed_headers] + headers_value = " ".join(lower_keys) + + auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\",".format( + self.key_id, self.signing_scheme) + if created_ts is not None: + auth_str = auth_str + "created={0},".format(created_ts) + if expires_ts is not None: + auth_str = auth_str + "expires={0},".format(expires_ts) + auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"".format( + headers_value, signed_msg.decode('ascii')) + + print("AUTH: {0}".format(auth_str)) + return auth_str diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache index 338b229bae5..ebdee3392e4 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache @@ -10,4 +10,7 @@ pytest~=4.6.7 # needed for python 2.7+3.4 pytest-cov>=2.8.1 pytest-randomly==1.2.3 # needed for python 2.7+3.4 {{/useNose}} +{{#hasHttpSignatureMethods}} +pycryptodome>=3.9.0 +{{/hasHttpSignatureMethods}} mock; python_version<="2.7" \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache b/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache index 2e744261030..9f5b49f8214 100644 --- a/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache +++ b/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache @@ -11,6 +11,28 @@ configuration.password = 'YOUR_PASSWORD' # Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}} configuration.access_token = 'YOUR_BEARER_TOKEN' {{/isBasicBearer}} +{{#isHttpSignature}} +# Configure HTTP signature authorization: {{{name}}} +# You can specify the signing key-id, private key path, signing scheme, signing algorithm, +# list of signed headers and signature max validity. +configuration.signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) +) +{{/isHttpSignature}} {{/isBasic}} {{#isApiKey}} # Configure API key authorization: {{{name}}} diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index fc5f249ee85..50cca10222c 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -36,6 +36,8 @@ class Configuration(object): The dict value is an API key prefix when generating the auth data. :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication + :param signing_info: Configuration parameters for HTTP signature. + Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: @@ -54,11 +56,50 @@ class Configuration(object): ) The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 + + Configure API client with HTTP basic authentication: + conf = petstore_api.Configuration( + username='the-user', + password='the-password', + ) + + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the petstore_api.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + + conf = petstore_api.Configuration( + signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) + ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, - username=None, password=None): + username=None, password=None, + signing_info=None): """Constructor """ self.host = host @@ -87,6 +128,11 @@ class Configuration(object): self.password = password """Password for HTTP basic authentication """ + if signing_info is not None: + signing_info.host = host + self.signing_info = signing_info + """The HTTP signing configuration + """ self.access_token = "" """access token for OAuth/Bearer """ diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index d3e808ddf40..1ebbe896974 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -152,13 +152,14 @@ class ApiClient(object): collection_formats) post_params.extend(self.files_parameters(files)) - # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings) - # body if body: body = self.sanitize_for_serialization(body) + # auth setting + self.update_params_for_auth(header_params, query_params, + auth_settings, resource_path, method, body) + # request url if _host is None: url = self.configuration.host + resource_path @@ -510,12 +511,17 @@ class ApiClient(object): else: return content_types[0] - def update_params_for_auth(self, headers, querys, auth_settings): + def update_params_for_auth(self, headers, querys, auth_settings, + resource_path, method, body): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param querys: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). """ if not auth_settings: return @@ -526,7 +532,8 @@ class ApiClient(object): if auth_setting['in'] == 'cookie': headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] elif auth_setting['in'] == 'query': querys.append((auth_setting['key'], auth_setting['value'])) else: diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 80e3b1fb992..cf2819c1d06 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -37,6 +37,8 @@ class Configuration(object): The dict value is an API key prefix when generating the auth data. :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication + :param signing_info: Configuration parameters for HTTP signature. + Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: @@ -55,11 +57,50 @@ class Configuration(object): ) The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 + + Configure API client with HTTP basic authentication: + conf = petstore_api.Configuration( + username='the-user', + password='the-password', + ) + + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the petstore_api.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + + conf = petstore_api.Configuration( + signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) + ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, - username=None, password=None): + username=None, password=None, + signing_info=None): """Constructor """ self.host = host @@ -88,6 +129,11 @@ class Configuration(object): self.password = password """Password for HTTP basic authentication """ + if signing_info is not None: + signing_info.host = host + self.signing_info = signing_info + """The HTTP signing configuration + """ self.access_token = "" """access token for OAuth/Bearer """ diff --git a/samples/client/petstore/python-experimental/setup.py b/samples/client/petstore/python-experimental/setup.py index f99ea80ad63..7fef185a1a4 100644 --- a/samples/client/petstore/python-experimental/setup.py +++ b/samples/client/petstore/python-experimental/setup.py @@ -21,7 +21,12 @@ VERSION = "1.0.0" # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] +REQUIRES = [ + "urllib3 >= 1.15", + "six >= 1.10", + "certifi", + "python-dateutil", +] EXTRAS = {':python_version <= "2.7"': ['future']} setup( diff --git a/samples/client/petstore/python-experimental/tests/test_api_client.py b/samples/client/petstore/python-experimental/tests/test_api_client.py index aa0b4cac570..fdf7e05d838 100644 --- a/samples/client/petstore/python-experimental/tests/test_api_client.py +++ b/samples/client/petstore/python-experimental/tests/test_api_client.py @@ -44,7 +44,7 @@ class ApiClientTests(unittest.TestCase): self.assertEqual('PREFIX', client.configuration.api_key_prefix['api_key']) # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings) + client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) # test api key auth self.assertEqual(header_params['test1'], 'value1') @@ -59,14 +59,14 @@ class ApiClientTests(unittest.TestCase): config.api_key['api_key'] = '123456' config.api_key_prefix['api_key'] = None # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings) + client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) self.assertEqual(header_params['api_key'], '123456') # test api key with empty prefix config.api_key['api_key'] = '123456' config.api_key_prefix['api_key'] = '' # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings) + client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) self.assertEqual(header_params['api_key'], '123456') # test api key with prefix specified in the api_key, useful when the prefix @@ -74,7 +74,7 @@ class ApiClientTests(unittest.TestCase): config.api_key['api_key'] = 'PREFIX=123456' config.api_key_prefix['api_key'] = None # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings) + client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) self.assertEqual(header_params['api_key'], 'PREFIX=123456') diff --git a/samples/client/petstore/python-experimental/tests/test_pet_api.py b/samples/client/petstore/python-experimental/tests/test_pet_api.py index 1897c67f4d6..9a0c4f76fa1 100644 --- a/samples/client/petstore/python-experimental/tests/test_pet_api.py +++ b/samples/client/petstore/python-experimental/tests/test_pet_api.py @@ -119,21 +119,21 @@ class PetApiTests(unittest.TestCase): def test_config(self): config = Configuration(host=HOST) self.assertIsNotNone(config.get_host_settings()) - self.assertEquals(config.get_basic_auth_token(), + self.assertEqual(config.get_basic_auth_token(), urllib3.util.make_headers(basic_auth=":").get('authorization')) - self.assertEquals(len(config.auth_settings()), 1) + self.assertEqual(len(config.auth_settings()), 1) self.assertIn("petstore_auth", config.auth_settings().keys()) config.username = "user" config.password = "password" - self.assertEquals( + self.assertEqual( config.get_basic_auth_token(), urllib3.util.make_headers(basic_auth="user:password").get('authorization')) - self.assertEquals(len(config.auth_settings()), 2) + self.assertEqual(len(config.auth_settings()), 2) self.assertIn("petstore_auth", config.auth_settings().keys()) self.assertIn("http_basic_test", config.auth_settings().keys()) config.username = None config.password = None - self.assertEquals(len(config.auth_settings()), 1) + self.assertEqual(len(config.auth_settings()), 1) self.assertIn("petstore_auth", config.auth_settings().keys()) def test_timeout(self): @@ -193,7 +193,7 @@ class PetApiTests(unittest.TestCase): response = thread.get() response2 = thread2.get() - self.assertEquals(response.id, self.pet.id) + self.assertEqual(response.id, self.pet.id) self.assertIsNotNone(response2.id, self.pet.id) def test_async_with_http_info(self): @@ -204,7 +204,7 @@ class PetApiTests(unittest.TestCase): data, status, headers = thread.get() self.assertIsInstance(data, petstore_api.Pet) - self.assertEquals(status, 200) + self.assertEqual(status, 200) def test_async_exception(self): self.pet_api.add_pet(self.pet) diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 80e3b1fb992..cf2819c1d06 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -37,6 +37,8 @@ class Configuration(object): The dict value is an API key prefix when generating the auth data. :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication + :param signing_info: Configuration parameters for HTTP signature. + Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: @@ -55,11 +57,50 @@ class Configuration(object): ) The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 + + Configure API client with HTTP basic authentication: + conf = petstore_api.Configuration( + username='the-user', + password='the-password', + ) + + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the petstore_api.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + + conf = petstore_api.Configuration( + signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) + ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, - username=None, password=None): + username=None, password=None, + signing_info=None): """Constructor """ self.host = host @@ -88,6 +129,11 @@ class Configuration(object): self.password = password """Password for HTTP basic authentication """ + if signing_info is not None: + signing_info.host = host + self.signing_info = signing_info + """The HTTP signing configuration + """ self.access_token = "" """access token for OAuth/Bearer """ diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 80e3b1fb992..cf2819c1d06 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -37,6 +37,8 @@ class Configuration(object): The dict value is an API key prefix when generating the auth data. :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication + :param signing_info: Configuration parameters for HTTP signature. + Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: @@ -55,11 +57,50 @@ class Configuration(object): ) The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 + + Configure API client with HTTP basic authentication: + conf = petstore_api.Configuration( + username='the-user', + password='the-password', + ) + + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the petstore_api.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + + conf = petstore_api.Configuration( + signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) + ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, - username=None, password=None): + username=None, password=None, + signing_info=None): """Constructor """ self.host = host @@ -88,6 +129,11 @@ class Configuration(object): self.password = password """Password for HTTP basic authentication """ + if signing_info is not None: + signing_info.host = host + self.signing_info = signing_info + """The HTTP signing configuration + """ self.access_token = "" """access token for OAuth/Bearer """ diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md index 8e82b0a81f3..1f91ec0bcf0 100644 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -193,6 +193,11 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication +## http_signature_test + +- **Type**: HTTP signature authentication + + ## petstore_auth - **Type**: OAuth diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md index 90b5647d5f3..2a09dc5f86b 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md @@ -29,6 +29,27 @@ import time import petstore_api from pprint import pprint configuration = petstore_api.Configuration() +# Configure HTTP signature authorization: http_signature_test +# You can specify the signing key-id, private key path, signing scheme, signing algorithm, +# list of signed headers and signature max validity. +configuration.signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) +) +configuration = petstore_api.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' @@ -58,7 +79,7 @@ void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -155,6 +176,27 @@ import time import petstore_api from pprint import pprint configuration = petstore_api.Configuration() +# Configure HTTP signature authorization: http_signature_test +# You can specify the signing key-id, private key path, signing scheme, signing algorithm, +# list of signed headers and signature max validity. +configuration.signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) +) +configuration = petstore_api.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' @@ -185,7 +227,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -216,6 +258,27 @@ import time import petstore_api from pprint import pprint configuration = petstore_api.Configuration() +# Configure HTTP signature authorization: http_signature_test +# You can specify the signing key-id, private key path, signing scheme, signing algorithm, +# list of signed headers and signature max validity. +configuration.signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) +) +configuration = petstore_api.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' @@ -246,7 +309,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -339,6 +402,27 @@ import time import petstore_api from pprint import pprint configuration = petstore_api.Configuration() +# Configure HTTP signature authorization: http_signature_test +# You can specify the signing key-id, private key path, signing scheme, signing algorithm, +# list of signed headers and signature max validity. +configuration.signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) +) +configuration = petstore_api.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' @@ -368,7 +452,7 @@ void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py index 9d890ef25f2..53f199f9a89 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -110,6 +110,7 @@ class PetApi(object): settings={ 'response_type': None, 'auth': [ + 'http_signature_test', 'petstore_auth' ], 'endpoint_path': '/pet', @@ -336,6 +337,7 @@ class PetApi(object): settings={ 'response_type': ([pet.Pet],), 'auth': [ + 'http_signature_test', 'petstore_auth' ], 'endpoint_path': '/pet/findByStatus', @@ -455,6 +457,7 @@ class PetApi(object): settings={ 'response_type': ([pet.Pet],), 'auth': [ + 'http_signature_test', 'petstore_auth' ], 'endpoint_path': '/pet/findByTags', @@ -677,6 +680,7 @@ class PetApi(object): settings={ 'response_type': None, 'auth': [ + 'http_signature_test', 'petstore_auth' ], 'endpoint_path': '/pet', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py index d3e808ddf40..c5d90d2a060 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py @@ -152,13 +152,14 @@ class ApiClient(object): collection_formats) post_params.extend(self.files_parameters(files)) - # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings) - # body if body: body = self.sanitize_for_serialization(body) + # auth setting + self.update_params_for_auth(header_params, query_params, + auth_settings, resource_path, method, body) + # request url if _host is None: url = self.configuration.host + resource_path @@ -510,12 +511,17 @@ class ApiClient(object): else: return content_types[0] - def update_params_for_auth(self, headers, querys, auth_settings): + def update_params_for_auth(self, headers, querys, auth_settings, + resource_path, method, body): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param querys: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). """ if not auth_settings: return @@ -526,7 +532,15 @@ class ApiClient(object): if auth_setting['in'] == 'cookie': headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + else: + # The HTTP signature scheme requires multiple HTTP headers + # that are calculated dynamically. + signing_info = self.configuration.signing_info + auth_headers = signing_info.get_http_signature_headers( + resource_path, method, headers, body, querys) + headers.update(auth_headers) elif auth_setting['in'] == 'query': querys.append((auth_setting['key'], auth_setting['value'])) else: diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py index 60cb525776a..99d8bac4b3d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py @@ -37,6 +37,8 @@ class Configuration(object): The dict value is an API key prefix when generating the auth data. :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication + :param signing_info: Configuration parameters for HTTP signature. + Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: @@ -55,11 +57,50 @@ class Configuration(object): ) The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 + + Configure API client with HTTP basic authentication: + conf = petstore_api.Configuration( + username='the-user', + password='the-password', + ) + + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the petstore_api.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + + conf = petstore_api.Configuration( + signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) + ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, - username=None, password=None): + username=None, password=None, + signing_info=None): """Constructor """ self.host = host @@ -88,6 +129,11 @@ class Configuration(object): self.password = password """Password for HTTP basic authentication """ + if signing_info is not None: + signing_info.host = host + self.signing_info = signing_info + """The HTTP signing configuration + """ self.access_token = "" """access token for OAuth/Bearer """ @@ -304,6 +350,13 @@ class Configuration(object): 'key': 'Authorization', 'value': self.get_basic_auth_token() } + if self.signing_info is not None: + auth['http_signature_test'] = { + 'type': 'http-signature', + 'in': 'header', + 'key': 'Authorization', + 'value': None # Signature headers are calculated for every HTTP request + } if self.access_token is not None: auth['petstore_auth'] = { 'type': 'oauth2', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py new file mode 100644 index 00000000000..da45fdf4b22 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py @@ -0,0 +1,376 @@ +# coding: utf-8 +""" + OpenAPI Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +from __future__ import absolute_import + +from base64 import b64encode +from Crypto.IO import PEM, PKCS8 +from Crypto.Hash import SHA256, SHA512 +from Crypto.PublicKey import RSA, ECC +from Crypto.Signature import PKCS1_v1_5, pss, DSS +from datetime import datetime +from email.utils import formatdate +import json +import os +import re +from six.moves.urllib.parse import urlencode, urlparse +from time import mktime + +HEADER_REQUEST_TARGET = '(request-target)' +HEADER_CREATED = '(created)' +HEADER_EXPIRES = '(expires)' +HEADER_HOST = 'Host' +HEADER_DATE = 'Date' +HEADER_DIGEST = 'Digest' # RFC 3230, include digest of the HTTP request body. +HEADER_AUTHORIZATION = 'Authorization' + +SCHEME_HS2019 = 'hs2019' +SCHEME_RSA_SHA256 = 'rsa-sha256' +SCHEME_RSA_SHA512 = 'rsa-sha512' + +ALGORITHM_RSASSA_PSS = 'RSASSA-PSS' +ALGORITHM_RSASSA_PKCS1v15 = 'RSASSA-PKCS1-v1_5' + +ALGORITHM_ECDSA_MODE_FIPS_186_3 = 'fips-186-3' +ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' +ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = { + ALGORITHM_ECDSA_MODE_FIPS_186_3, + ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 +} + + +class HttpSigningConfiguration(object): + """The configuration parameters for the HTTP signature security scheme. + The HTTP signature security scheme is used to sign HTTP requests with a private key + which is in possession of the API client. + An 'Authorization' header is calculated by creating a hash of select headers, + and optionally the body of the HTTP request, then signing the hash value using + a private key. The 'Authorization' header is added to outbound HTTP requests. + + NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param key_id: A string value specifying the identifier of the cryptographic key, + when signing HTTP requests. + :param signing_scheme: A string value specifying the signature scheme, when + signing HTTP requests. + Supported value are hs2019, rsa-sha256, rsa-sha512. + Avoid using rsa-sha256, rsa-sha512 as they are deprecated. These values are + available for server-side applications that only support the older + HTTP signature algorithms. + :param private_key_path: A string value specifying the path of the file containing + a private key. The private key is used to sign HTTP requests. + :param private_key_passphrase: A string value specifying the passphrase to decrypt + the private key. + :param signed_headers: A list of strings. Each value is the name of a HTTP header + that must be included in the HTTP signature calculation. + The two special signature headers '(request-target)' and '(created)' SHOULD be + included in SignedHeaders. + The '(created)' header expresses when the signature was created. + The '(request-target)' header is a concatenation of the lowercased :method, an + ASCII space, and the :path pseudo-headers. + When signed_headers is not specified, the client defaults to a single value, + '(created)', in the list of HTTP headers. + When SignedHeaders contains the 'Digest' value, the client performs the + following operations: + 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. + 2. Set the 'Digest' header in the request body. + 3. Include the 'Digest' header and value in the HTTP signature. + :param signing_algorithm: A string value specifying the signature algorithm, when + signing HTTP requests. + Supported values are: + 1. For RSA keys: RSASSA-PSS, RSASSA-PKCS1-v1_5. + 2. For ECDSA keys: fips-186-3, deterministic-rfc6979. + The default value is inferred from the private key. + The default value for RSA keys is RSASSA-PSS. + The default value for ECDSA keys is fips-186-3. + :param signature_max_validity: The signature max validity, expressed as + a datetime.timedelta value. It must be a positive value. + """ + def __init__(self, key_id, signing_scheme, private_key_path, + private_key_passphrase=None, + signed_headers=None, + signing_algorithm=None, + signature_max_validity=None): + self.key_id = key_id + if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}: + raise Exception("Unsupported security scheme: {0}".format(signing_scheme)) + self.signing_scheme = signing_scheme + if not os.path.exists(private_key_path): + raise Exception("Private key file does not exist") + self.private_key_path = private_key_path + self.private_key_passphrase = private_key_passphrase + self.signing_algorithm = signing_algorithm + if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: + raise Exception("The signature max validity must be a positive value") + self.signature_max_validity = signature_max_validity + # If the user has not provided any signed_headers, the default must be set to '(created)', + # as specified in the 'HTTP signature' standard. + if signed_headers is None or len(signed_headers) == 0: + signed_headers = [HEADER_CREATED] + if self.signature_max_validity is None and HEADER_EXPIRES in signed_headers: + raise Exception( + "Signature max validity must be set when " + "'(expires)' signature parameter is specified") + if len(signed_headers) != len(set(signed_headers)): + raise Exception("Cannot have duplicates in the signed_headers parameter") + if HEADER_AUTHORIZATION in signed_headers: + raise Exception("'Authorization' header cannot be included in signed headers") + self.signed_headers = signed_headers + self.private_key = None + """The private key used to sign HTTP requests. + Initialized when the PEM-encoded private key is loaded from a file. + """ + self.host = None + """The host name, optionally followed by a colon and TCP port number. + """ + self._load_private_key() + + def get_http_signature_headers(self, resource_path, method, headers, body, query_params): + """Create a cryptographic message signature for the HTTP request and add the signed headers. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The object representing the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A dict of HTTP headers that must be added to the outbound HTTP request. + """ + if method is None: + raise Exception("HTTP method must be set") + if resource_path is None: + raise Exception("Resource path must be set") + + signed_headers_list, request_headers_dict = self._get_signed_header_info( + resource_path, method, headers, body, query_params) + + header_items = [ + "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list] + string_to_sign = "\n".join(header_items) + + digest, digest_prefix = self._get_message_digest(string_to_sign.encode()) + b64_signed_msg = self._sign_digest(digest) + + request_headers_dict[HEADER_AUTHORIZATION] = self._get_authorization_header( + signed_headers_list, b64_signed_msg) + + return request_headers_dict + + def get_public_key(self): + """Returns the public key object associated with the private key. + """ + pubkey = None + if isinstance(self.private_key, RSA.RsaKey): + pubkey = self.private_key.publickey() + elif isinstance(self.private_key, ECC.EccKey): + pubkey = self.private_key.public_key() + return pubkey + + def _load_private_key(self): + """Load the private key used to sign HTTP requests. + The private key is used to sign HTTP requests as defined in + https://datatracker.ietf.org/doc/draft-cavage-http-signatures/. + """ + if self.private_key is not None: + return + with open(self.private_key_path, 'r') as f: + pem_data = f.read() + # Verify PEM Pre-Encapsulation Boundary + r = re.compile(r"\s*-----BEGIN (.*)-----\s+") + m = r.match(pem_data) + if not m: + raise ValueError("Not a valid PEM pre boundary") + pem_header = m.group(1) + if pem_header == 'RSA PRIVATE KEY': + self.private_key = RSA.importKey(pem_data, self.private_key_passphrase) + elif pem_header == 'EC PRIVATE KEY': + self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) + elif pem_header in {'PRIVATE KEY', 'ENCRYPTED PRIVATE KEY'}: + # Key is in PKCS8 format, which is capable of holding many different + # types of private keys, not just EC keys. + (key_binary, pem_header, is_encrypted) = \ + PEM.decode(pem_data, self.private_key_passphrase) + (oid, privkey, params) = \ + PKCS8.unwrap(key_binary, passphrase=self.private_key_passphrase) + if oid == '1.2.840.10045.2.1': + self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) + else: + raise Exception("Unsupported key: {0}. OID: {1}".format(pem_header, oid)) + else: + raise Exception("Unsupported key: {0}".format(pem_header)) + # Validate the specified signature algorithm is compatible with the private key. + if self.signing_algorithm is not None: + supported_algs = None + if isinstance(self.private_key, RSA.RsaKey): + supported_algs = {ALGORITHM_RSASSA_PSS, ALGORITHM_RSASSA_PKCS1v15} + elif isinstance(self.private_key, ECC.EccKey): + supported_algs = ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS + if supported_algs is not None and self.signing_algorithm not in supported_algs: + raise Exception( + "Signing algorithm {0} is not compatible with private key".format( + self.signing_algorithm)) + + def _get_unix_time(self, ts): + """Converts and returns a datetime object to UNIX time, the number of seconds + elapsed since January 1, 1970 UTC. + """ + return (ts - datetime(1970, 1, 1)).total_seconds() + + def _get_signed_header_info(self, resource_path, method, headers, body, query_params): + """Build the HTTP headers (name, value) that need to be included in + the HTTP signature scheme. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The object (e.g. a dict) representing the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A tuple containing two dict objects: + The first dict contains the HTTP headers that are used to calculate + the HTTP signature. + The second dict contains the HTTP headers that must be added to + the outbound HTTP request. + """ + + if body is None: + body = '' + else: + body = json.dumps(body) + + # Build the '(request-target)' HTTP signature parameter. + target_host = urlparse(self.host).netloc + target_path = urlparse(self.host).path + request_target = method.lower() + " " + target_path + resource_path + if query_params: + request_target += "?" + urlencode(query_params) + + # Get current time and generate RFC 1123 (HTTP/1.1) date/time string. + now = datetime.now() + stamp = mktime(now.timetuple()) + cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) + # The '(created)' value MUST be a Unix timestamp integer value. + # Subsecond precision is not supported. + created = int(self._get_unix_time(now)) + if self.signature_max_validity is not None: + expires = self._get_unix_time(now + self.signature_max_validity) + + signed_headers_list = [] + request_headers_dict = {} + for hdr_key in self.signed_headers: + hdr_key = hdr_key.lower() + if hdr_key == HEADER_REQUEST_TARGET: + value = request_target + elif hdr_key == HEADER_CREATED: + value = '{0}'.format(created) + elif hdr_key == HEADER_EXPIRES: + value = '{0}'.format(expires) + elif hdr_key == HEADER_DATE.lower(): + value = cdate + request_headers_dict[HEADER_DATE] = '{0}'.format(cdate) + elif hdr_key == HEADER_DIGEST.lower(): + request_body = body.encode() + body_digest, digest_prefix = self._get_message_digest(request_body) + b64_body_digest = b64encode(body_digest.digest()) + value = digest_prefix + b64_body_digest.decode('ascii') + request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format( + digest_prefix, b64_body_digest.decode('ascii')) + elif hdr_key == HEADER_HOST.lower(): + value = target_host + request_headers_dict[HEADER_HOST] = '{0}'.format(target_host) + else: + value = next((v for k, v in headers.items() if k.lower() == hdr_key), None) + if value is None: + raise Exception( + "Cannot sign HTTP request. " + "Request does not contain the '{0}' header".format(hdr_key)) + signed_headers_list.append((hdr_key, value)) + + return signed_headers_list, request_headers_dict + + def _get_message_digest(self, data): + """Calculates and returns a cryptographic digest of a specified HTTP request. + + :param data: The string representation of the date to be hashed with a cryptographic hash. + :return: A tuple of (digest, prefix). + The digest is a hashing object that contains the cryptographic digest of + the HTTP request. + The prefix is a string that identifies the cryptographc hash. It is used + to generate the 'Digest' header as specified in RFC 3230. + """ + if self.signing_scheme in {SCHEME_RSA_SHA512, SCHEME_HS2019}: + digest = SHA512.new() + prefix = 'SHA-512=' + elif self.signing_scheme == SCHEME_RSA_SHA256: + digest = SHA256.new() + prefix = 'SHA-256=' + else: + raise Exception("Unsupported signing algorithm: {0}".format(self.signing_scheme)) + digest.update(data) + return digest, prefix + + def _sign_digest(self, digest): + """Signs a message digest with a private key specified in the signing_info. + + :param digest: A hashing object that contains the cryptographic digest of the HTTP request. + :return: A base-64 string representing the cryptographic signature of the input digest. + """ + sig_alg = self.signing_algorithm + if isinstance(self.private_key, RSA.RsaKey): + if sig_alg is None or sig_alg == ALGORITHM_RSASSA_PSS: + # RSASSA-PSS in Section 8.1 of RFC8017. + signature = pss.new(self.private_key).sign(digest) + elif sig_alg == ALGORITHM_RSASSA_PKCS1v15: + # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. + signature = PKCS1_v1_5.new(self.private_key).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) + elif isinstance(self.private_key, ECC.EccKey): + if sig_alg is None: + sig_alg = ALGORITHM_ECDSA_MODE_FIPS_186_3 + if sig_alg in ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS: + signature = DSS.new(self.private_key, sig_alg).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) + else: + raise Exception("Unsupported private key: {0}".format(type(self.private_key))) + return b64encode(signature) + + def _get_authorization_header(self, signed_headers, signed_msg): + """Calculates and returns the value of the 'Authorization' header when signing HTTP requests. + + :param signed_headers : A list of tuples. Each value is the name of a HTTP header that + must be included in the HTTP signature calculation. + :param signed_msg: A base-64 encoded string representation of the signature. + :return: The string value of the 'Authorization' header, representing the signature + of the HTTP request. + """ + created_ts = None + expires_ts = None + for k, v in signed_headers: + if k == HEADER_CREATED: + created_ts = v + elif k == HEADER_EXPIRES: + expires_ts = v + lower_keys = [k.lower() for k, v in signed_headers] + headers_value = " ".join(lower_keys) + + auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\",".format( + self.key_id, self.signing_scheme) + if created_ts is not None: + auth_str = auth_str + "created={0},".format(created_ts) + if expires_ts is not None: + auth_str = auth_str + "expires={0},".format(expires_ts) + auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"".format( + headers_value, signed_msg.decode('ascii')) + + print("AUTH: {0}".format(auth_str)) + return auth_str diff --git a/samples/openapi3/client/petstore/python-experimental/setup.py b/samples/openapi3/client/petstore/python-experimental/setup.py index f99ea80ad63..47c8b278792 100644 --- a/samples/openapi3/client/petstore/python-experimental/setup.py +++ b/samples/openapi3/client/petstore/python-experimental/setup.py @@ -21,7 +21,14 @@ VERSION = "1.0.0" # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] +REQUIRES = [ + "urllib3 >= 1.15", + "six >= 1.10", + "certifi", + "python-dateutil", + "pem>=19.3.0", + "pycryptodome>=3.9.0", +] EXTRAS = {':python_version <= "2.7"': ['future']} setup( diff --git a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt index 06f7754d204..bf6f7a19972 100644 --- a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt +++ b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt @@ -1,4 +1,5 @@ pytest~=4.6.7 # needed for python 2.7+3.4 pytest-cov>=2.8.1 pytest-randomly==1.2.3 # needed for python 2.7+3.4 +pycryptodome>=3.9.0 mock; python_version<="2.7" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/tests/__init__.py b/samples/openapi3/client/petstore/python-experimental/tests/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py new file mode 100644 index 00000000000..c6c7c5e9bc1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py @@ -0,0 +1,501 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ docker pull swaggerapi/petstore +$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" + +from collections import namedtuple +from datetime import datetime, timedelta +import base64 +import json +import os +import re +import shutil +import unittest +from Crypto.Hash import SHA256, SHA512 +from Crypto.PublicKey import ECC, RSA +from Crypto.Signature import pkcs1_15, pss, DSS +from six.moves.urllib.parse import urlencode, urlparse + +import petstore_api +from petstore_api import Configuration, signing +from petstore_api.rest import ( + RESTClientObject, + RESTResponse +) + +import six + +from petstore_api.exceptions import ( + ApiException, + ApiValueError, + ApiTypeError, +) + +from .util import id_gen + +import urllib3 + +if six.PY3: + from unittest.mock import patch +else: + from mock import patch + +HOST = 'http://localhost/v2' + +# This test RSA private key below is published in Appendix C 'Test Values' of +# https://www.ietf.org/id/draft-cavage-http-signatures-12.txt +RSA_TEST_PRIVATE_KEY = """-----BEGIN RSA PRIVATE KEY----- +MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF +NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F +UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB +AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA +QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK +kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg +f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u +412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc +mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7 +kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA +gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW +G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI +7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA== +-----END RSA PRIVATE KEY-----""" + + +class TimeoutWithEqual(urllib3.Timeout): + def __init__(self, *arg, **kwargs): + super(TimeoutWithEqual, self).__init__(*arg, **kwargs) + + def __eq__(self, other): + return self._read == other._read and self._connect == other._connect and self.total == other.total + +class MockPoolManager(object): + def __init__(self, tc): + self._tc = tc + self._reqs = [] + + def expect_request(self, *args, **kwargs): + self._reqs.append((args, kwargs)) + + def set_signing_config(self, signing_cfg): + self.signing_cfg = signing_cfg + self._tc.assertIsNotNone(self.signing_cfg) + self.pubkey = self.signing_cfg.get_public_key() + self._tc.assertIsNotNone(self.pubkey) + + def request(self, *actual_request_target, **actual_request_headers_and_body): + self._tc.assertTrue(len(self._reqs) > 0) + expected_results = self._reqs.pop(0) + self._tc.maxDiff = None + expected_request_target = expected_results[0] # The expected HTTP method and URL path. + expected_request_headers_and_body = expected_results[1] # dict that contains the expected body, headers + self._tc.assertEqual(expected_request_target, actual_request_target) + # actual_request_headers_and_body is a dict that contains the actual body, headers + for k, expected in expected_request_headers_and_body.items(): + self._tc.assertIn(k, actual_request_headers_and_body) + if k == 'body': + actual_body = actual_request_headers_and_body[k] + self._tc.assertEqual(expected, actual_body) + elif k == 'headers': + actual_headers = actual_request_headers_and_body[k] + for expected_header_name, expected_header_value in expected.items(): + # Validate the generated request contains the expected header. + self._tc.assertIn(expected_header_name, actual_headers) + actual_header_value = actual_headers[expected_header_name] + # Compare the actual value of the header against the expected value. + pattern = re.compile(expected_header_value) + m = pattern.match(actual_header_value) + self._tc.assertTrue(m, msg="Expected:\n{0}\nActual:\n{1}".format( + expected_header_value,actual_header_value)) + if expected_header_name == 'Authorization': + self._validate_authorization_header( + expected_request_target, actual_headers, actual_header_value) + elif k == 'timeout': + self._tc.assertEqual(expected, actual_request_headers_and_body[k]) + return urllib3.HTTPResponse(status=200, body=b'test') + + def _validate_authorization_header(self, request_target, actual_headers, authorization_header): + """Validate the signature. + """ + # Extract (created) + r1 = re.compile(r'created=([0-9]+)') + m1 = r1.search(authorization_header) + self._tc.assertIsNotNone(m1) + created = m1.group(1) + + # Extract list of signed headers + r1 = re.compile(r'headers="([^"]+)"') + m1 = r1.search(authorization_header) + self._tc.assertIsNotNone(m1) + headers = m1.group(1).split(' ') + signed_headers_list = [] + for h in headers: + if h == '(created)': + signed_headers_list.append((h, created)) + elif h == '(request-target)': + url = request_target[1] + target_path = urlparse(url).path + signed_headers_list.append((h, "{0} {1}".format(request_target[0].lower(), target_path))) + else: + value = next((v for k, v in actual_headers.items() if k.lower() == h), None) + self._tc.assertIsNotNone(value) + signed_headers_list.append((h, value)) + header_items = [ + "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list] + string_to_sign = "\n".join(header_items) + digest = None + if self.signing_cfg.signing_scheme in {signing.SCHEME_RSA_SHA512, signing.SCHEME_HS2019}: + digest = SHA512.new() + elif self.signing_cfg.signing_scheme == signing.SCHEME_RSA_SHA256: + digest = SHA256.new() + else: + self._tc.fail("Unsupported signature scheme: {0}".format(self.signing_cfg.signing_scheme)) + digest.update(string_to_sign.encode()) + b64_body_digest = base64.b64encode(digest.digest()).decode() + + # Extract the signature + r2 = re.compile(r'signature="([^"]+)"') + m2 = r2.search(authorization_header) + self._tc.assertIsNotNone(m2) + b64_signature = m2.group(1) + signature = base64.b64decode(b64_signature) + # Build the message + signing_alg = self.signing_cfg.signing_algorithm + if signing_alg is None: + # Determine default + if isinstance(self.pubkey, RSA.RsaKey): + signing_alg = signing.ALGORITHM_RSASSA_PSS + elif isinstance(self.pubkey, ECC.EccKey): + signing_alg = signing.ALGORITHM_ECDSA_MODE_FIPS_186_3 + else: + self._tc.fail("Unsupported key: {0}".format(type(self.pubkey))) + + if signing_alg == signing.ALGORITHM_RSASSA_PKCS1v15: + pkcs1_15.new(self.pubkey).verify(digest, signature) + elif signing_alg == signing.ALGORITHM_RSASSA_PSS: + pss.new(self.pubkey).verify(digest, signature) + elif signing_alg == signing.ALGORITHM_ECDSA_MODE_FIPS_186_3: + verifier = DSS.new(self.pubkey, signing.ALGORITHM_ECDSA_MODE_FIPS_186_3) + verifier.verify(digest, signature) + elif signing_alg == signing.ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979: + verifier = DSS.new(self.pubkey, signing.ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979) + verifier.verify(digest, signature) + else: + self._tc.fail("Unsupported signing algorithm: {0}".format(signing_alg)) + +class PetApiTests(unittest.TestCase): + + def setUp(self): + self.setUpModels() + self.setUpFiles() + + + def setUpModels(self): + self.category = petstore_api.Category() + self.category.id = id_gen() + self.category.name = "dog" + self.tag = petstore_api.Tag() + self.tag.id = id_gen() + self.tag.name = "python-pet-tag" + self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) + self.pet.id = id_gen() + self.pet.status = "sold" + self.pet.category = self.category + self.pet.tags = [self.tag] + + def setUpFiles(self): + self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles") + self.test_file_dir = os.path.realpath(self.test_file_dir) + if not os.path.exists(self.test_file_dir): + os.mkdir(self.test_file_dir) + + self.private_key_passphrase = 'test-passphrase' + self.rsa_key_path = os.path.join(self.test_file_dir, 'rsa.pem') + self.rsa4096_key_path = os.path.join(self.test_file_dir, 'rsa4096.pem') + self.ec_p521_key_path = os.path.join(self.test_file_dir, 'ecP521.pem') + + if not os.path.exists(self.rsa_key_path): + with open(self.rsa_key_path, 'w') as f: + f.write(RSA_TEST_PRIVATE_KEY) + + if not os.path.exists(self.rsa4096_key_path): + key = RSA.generate(4096) + private_key = key.export_key( + passphrase=self.private_key_passphrase, + protection='PEM' + ) + with open(self.rsa4096_key_path, "wb") as f: + f.write(private_key) + + if not os.path.exists(self.ec_p521_key_path): + key = ECC.generate(curve='P-521') + private_key = key.export_key( + format='PEM', + passphrase=self.private_key_passphrase, + use_pkcs8=True, + protection='PBKDF2WithHMAC-SHA1AndAES128-CBC' + ) + with open(self.ec_p521_key_path, "wt") as f: + f.write(private_key) + + def test_valid_http_signature(self): + privkey_path = self.rsa_key_path + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + signing_scheme=signing.SCHEME_HS2019, + private_key_path=privkey_path, + private_key_passphrase=self.private_key_passphrase, + signing_algorithm=signing.ALGORITHM_RSASSA_PKCS1v15, + signed_headers=[ + signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type' + ] + ) + config = Configuration(host=HOST, signing_info=signing_cfg) + # Set the OAuth2 acces_token to None. Here we are interested in testing + # the HTTP signature scheme. + config.access_token = None + + api_client = petstore_api.ApiClient(config) + pet_api = petstore_api.PetApi(api_client) + + mock_pool = MockPoolManager(self) + api_client.rest_client.pool_manager = mock_pool + + mock_pool.set_signing_config(signing_cfg) + mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', + body=json.dumps(api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': r'application/json', + 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' + r'headers="\(request-target\) \(created\) host date digest content-type",' + r'signature="[a-zA-Z0-9+/]+="', + 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=None) + + pet_api.add_pet(self.pet) + + def test_valid_http_signature_with_defaults(self): + privkey_path = self.rsa4096_key_path + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + signing_scheme=signing.SCHEME_HS2019, + private_key_path=privkey_path, + private_key_passphrase=self.private_key_passphrase, + ) + config = Configuration(host=HOST, signing_info=signing_cfg) + # Set the OAuth2 acces_token to None. Here we are interested in testing + # the HTTP signature scheme. + config.access_token = None + + api_client = petstore_api.ApiClient(config) + pet_api = petstore_api.PetApi(api_client) + + mock_pool = MockPoolManager(self) + api_client.rest_client.pool_manager = mock_pool + + mock_pool.set_signing_config(signing_cfg) + mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', + body=json.dumps(api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': r'application/json', + 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' + r'headers="\(created\)",' + r'signature="[a-zA-Z0-9+/]+="', + 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=None) + + pet_api.add_pet(self.pet) + + def test_valid_http_signature_rsassa_pkcs1v15(self): + privkey_path = self.rsa4096_key_path + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + signing_scheme=signing.SCHEME_HS2019, + private_key_path=privkey_path, + private_key_passphrase=self.private_key_passphrase, + signing_algorithm=signing.ALGORITHM_RSASSA_PKCS1v15, + signed_headers=[ + signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + ] + ) + config = Configuration(host=HOST, signing_info=signing_cfg) + # Set the OAuth2 acces_token to None. Here we are interested in testing + # the HTTP signature scheme. + config.access_token = None + + api_client = petstore_api.ApiClient(config) + pet_api = petstore_api.PetApi(api_client) + + mock_pool = MockPoolManager(self) + api_client.rest_client.pool_manager = mock_pool + + mock_pool.set_signing_config(signing_cfg) + mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', + body=json.dumps(api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': r'application/json', + 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' + r'headers="\(request-target\) \(created\)",' + r'signature="[a-zA-Z0-9+/]+="', + 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=None) + + pet_api.add_pet(self.pet) + + def test_valid_http_signature_rsassa_pss(self): + privkey_path = self.rsa4096_key_path + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + signing_scheme=signing.SCHEME_HS2019, + private_key_path=privkey_path, + private_key_passphrase=self.private_key_passphrase, + signing_algorithm=signing.ALGORITHM_RSASSA_PSS, + signed_headers=[ + signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + ] + ) + config = Configuration(host=HOST, signing_info=signing_cfg) + # Set the OAuth2 acces_token to None. Here we are interested in testing + # the HTTP signature scheme. + config.access_token = None + + api_client = petstore_api.ApiClient(config) + pet_api = petstore_api.PetApi(api_client) + + mock_pool = MockPoolManager(self) + api_client.rest_client.pool_manager = mock_pool + + mock_pool.set_signing_config(signing_cfg) + mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', + body=json.dumps(api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': r'application/json', + 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' + r'headers="\(request-target\) \(created\)",' + r'signature="[a-zA-Z0-9+/]+="', + 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=None) + + pet_api.add_pet(self.pet) + + def test_valid_http_signature_ec_p521(self): + privkey_path = self.ec_p521_key_path + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + signing_scheme=signing.SCHEME_HS2019, + private_key_path=privkey_path, + private_key_passphrase=self.private_key_passphrase, + signed_headers=[ + signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + ] + ) + config = Configuration(host=HOST, signing_info=signing_cfg) + # Set the OAuth2 acces_token to None. Here we are interested in testing + # the HTTP signature scheme. + config.access_token = None + + api_client = petstore_api.ApiClient(config) + pet_api = petstore_api.PetApi(api_client) + + mock_pool = MockPoolManager(self) + api_client.rest_client.pool_manager = mock_pool + + mock_pool.set_signing_config(signing_cfg) + mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', + body=json.dumps(api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': r'application/json', + 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' + r'headers="\(request-target\) \(created\)",' + r'signature="[a-zA-Z0-9+/]+"', + 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=None) + + pet_api.add_pet(self.pet) + + def test_invalid_configuration(self): + # Signing scheme must be valid. + with self.assertRaises(Exception) as cm: + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + signing_scheme='foo', + private_key_path=self.ec_p521_key_path + ) + self.assertTrue(re.match('Unsupported security scheme', str(cm.exception)), + 'Exception message: {0}'.format(str(cm.exception))) + + # Signing scheme must be specified. + with self.assertRaises(Exception) as cm: + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + private_key_path=self.ec_p521_key_path, + signing_scheme=None + ) + self.assertTrue(re.match('Unsupported security scheme', str(cm.exception)), + 'Exception message: {0}'.format(str(cm.exception))) + + # Private key passphrase is missing but key is encrypted. + with self.assertRaises(Exception) as cm: + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + signing_scheme=signing.SCHEME_HS2019, + private_key_path=self.ec_p521_key_path, + ) + self.assertTrue(re.match('Not a valid clear PKCS#8 structure', str(cm.exception)), + 'Exception message: {0}'.format(str(cm.exception))) + + # File containing private key must exist. + with self.assertRaises(Exception) as cm: + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + signing_scheme=signing.SCHEME_HS2019, + private_key_path='foobar', + ) + self.assertTrue(re.match('Private key file does not exist', str(cm.exception)), + 'Exception message: {0}'.format(str(cm.exception))) + + # The max validity must be a positive value. + with self.assertRaises(Exception) as cm: + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + signing_scheme=signing.SCHEME_HS2019, + private_key_path=self.ec_p521_key_path, + signature_max_validity=timedelta(hours=-1) + ) + self.assertTrue(re.match('The signature max validity must be a positive value', + str(cm.exception)), + 'Exception message: {0}'.format(str(cm.exception))) + + # Cannot include the 'Authorization' header. + with self.assertRaises(Exception) as cm: + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + signing_scheme=signing.SCHEME_HS2019, + private_key_path=self.ec_p521_key_path, + signed_headers=['Authorization'] + ) + self.assertTrue(re.match("'Authorization' header cannot be included", str(cm.exception)), + 'Exception message: {0}'.format(str(cm.exception))) + + # Cannot specify duplicate headers. + with self.assertRaises(Exception) as cm: + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + signing_scheme=signing.SCHEME_HS2019, + private_key_path=self.ec_p521_key_path, + signed_headers=['Host', 'Date', 'Host'] + ) + self.assertTrue(re.match('Cannot have duplicates in the signed_headers parameter', + str(cm.exception)), + 'Exception message: {0}'.format(str(cm.exception))) + diff --git a/samples/openapi3/client/petstore/python-experimental/tests/util.py b/samples/openapi3/client/petstore/python-experimental/tests/util.py new file mode 100644 index 00000000000..113d7dcc547 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests/util.py @@ -0,0 +1,8 @@ +# flake8: noqa + +import random + + +def id_gen(bits=32): + """ Returns a n-bit randomly generated int """ + return int(random.getrandbits(bits)) diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index 60cb525776a..1bb8505ee8b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -37,6 +37,8 @@ class Configuration(object): The dict value is an API key prefix when generating the auth data. :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication + :param signing_info: Configuration parameters for HTTP signature. + Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: @@ -55,11 +57,50 @@ class Configuration(object): ) The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 + + Configure API client with HTTP basic authentication: + conf = petstore_api.Configuration( + username='the-user', + password='the-password', + ) + + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the petstore_api.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + + conf = petstore_api.Configuration( + signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) + ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, - username=None, password=None): + username=None, password=None, + signing_info=None): """Constructor """ self.host = host @@ -88,6 +129,11 @@ class Configuration(object): self.password = password """Password for HTTP basic authentication """ + if signing_info is not None: + signing_info.host = host + self.signing_info = signing_info + """The HTTP signing configuration + """ self.access_token = "" """access token for OAuth/Bearer """ From 45f26fe0bde2f134c89ca566381f279dae775e7c Mon Sep 17 00:00:00 2001 From: Bernd Hacker Date: Mon, 27 Jan 2020 09:31:36 +0100 Subject: [PATCH 34/85] [typescript-rxjs] performance improvements, bugfix for falsy parameters (#4250) * perf(typescript-rxjs): remove redundant check when building auth header * feat(typescript-rxjs): destructure request parameters, add throwIfNullOrUndefined helper, build query object more efficently * fix(typescript-rxjs): change form checks back from null to undefined * feat(typescript-rxjs): regenerate samples * feat(typescript-rxjs): add hasRequiredQueryParams flag for improved query object generation * feat(typescript-rxjs): remove trailing comma in param destructuring, improve formatting via hasOptionalQueryParams flag * feat(typescript-rxjs): remove useless generics in BaseAPI * feat(typescript-rxjs): regenerate samples * feat(typescript-rxjs): extend CodegenParameter by output.paramNameAlternative and output.paramNameOrAlternative * refactor(typescript-rxjs): remove obsolete reservedWords RequiredError and exists * feat(typescript-rxjs): add reservedParamNames list with headers, query and formData, extend param processing * feat(typescript-rxjs): use paramNameOrAlternative in api template * refactor(typescript-rxjs): replace paramNameOrAlternative prop with mustache partial * refactor(typescript-rxjs): reduce branching in configuration's apiKey() and accessToken() * refactor(typescript-rxjs): remove unused ModelPropertyNaming * feat(typescript-rxjs): regenerate samples * feat(typescript-rxjs): remove CodegenParamter's paramNameAlternative, use vendorExtensions instead * docs(typescript-rxjs): regenerate readme --- docs/generators/typescript-rxjs.md | 3 - .../TypeScriptRxjsClientCodegen.java | 88 +++++++---- .../resources/typescript-rxjs/apis.mustache | 106 +++++++++----- .../typescript-rxjs/paramNamePartial.mustache | 2 + .../typescript-rxjs/runtime.mustache | 41 +++--- .../builds/default/apis/PetApi.ts | 137 +++++++++--------- .../builds/default/apis/StoreApi.ts | 20 +-- .../builds/default/apis/UserApi.ts | 54 +++---- .../typescript-rxjs/builds/default/runtime.ts | 41 +++--- .../builds/es6-target/apis/PetApi.ts | 137 +++++++++--------- .../builds/es6-target/apis/StoreApi.ts | 20 +-- .../builds/es6-target/apis/UserApi.ts | 54 +++---- .../builds/es6-target/runtime.ts | 41 +++--- .../builds/with-interfaces/apis/PetApi.ts | 137 +++++++++--------- .../builds/with-interfaces/apis/StoreApi.ts | 20 +-- .../builds/with-interfaces/apis/UserApi.ts | 54 +++---- .../builds/with-interfaces/runtime.ts | 41 +++--- .../builds/with-npm-version/apis/PetApi.ts | 137 +++++++++--------- .../builds/with-npm-version/apis/StoreApi.ts | 20 +-- .../builds/with-npm-version/apis/UserApi.ts | 54 +++---- .../builds/with-npm-version/runtime.ts | 41 +++--- 21 files changed, 661 insertions(+), 587 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/typescript-rxjs/paramNamePartial.mustache diff --git a/docs/generators/typescript-rxjs.md b/docs/generators/typescript-rxjs.md index 3d8bf8a3318..0516372fef8 100644 --- a/docs/generators/typescript-rxjs.md +++ b/docs/generators/typescript-rxjs.md @@ -67,10 +67,8 @@ sidebar_label: typescript-rxjs
  • HttpMethod
  • HttpQuery
  • Middleware
  • -
  • ModelPropertyNaming
  • RequestArgs
  • RequestOpts
  • -
  • RequiredError
  • ResponseArgs
  • abstract
  • await
  • @@ -90,7 +88,6 @@ sidebar_label: typescript-rxjs
  • double
  • else
  • enum
  • -
  • exists
  • export
  • extends
  • false
  • diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java index 7510a25f09d..373a1e33a8e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptRxjsClientCodegen.java @@ -23,19 +23,20 @@ import io.swagger.v3.parser.util.SchemaTypeUtil; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.utils.ModelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.File; -import java.util.TreeSet; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; +import java.util.*; public class TypeScriptRxjsClientCodegen extends AbstractTypeScriptClientCodegen { + private static final Logger LOGGER = LoggerFactory.getLogger(AbstractTypeScriptClientCodegen.class); public static final String NPM_REPOSITORY = "npmRepository"; public static final String WITH_INTERFACES = "withInterfaces"; protected String npmRepository = null; + protected Set reservedParamNames = new HashSet<>(); public TypeScriptRxjsClientCodegen() { super(); @@ -58,6 +59,11 @@ public class TypeScriptRxjsClientCodegen extends AbstractTypeScriptClientCodegen this.cliOptions.add(new CliOption(NPM_REPOSITORY, "Use this property to set an url your private npmRepo in the package.json")); this.cliOptions.add(new CliOption(WITH_INTERFACES, "Setting this property to true will generate interfaces next to the default class implementations.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); + + // these are used in the api template for more efficient destructuring + this.reservedParamNames.add("headers"); + this.reservedParamNames.add("query"); + this.reservedParamNames.add("formData"); } @Override @@ -252,12 +258,18 @@ public class TypeScriptRxjsClientCodegen extends AbstractTypeScriptClientCodegen operations.put("hasEnums", hasEnums); } + private void setParamNameAlternative(CodegenParameter param, String paramName, String paramNameAlternative) { + if (param.paramName.equals(paramName)) { + param.vendorExtensions.put("paramNameAlternative", paramNameAlternative); + } + } + private void addConditionalImportInformation(Map operations) { // This method will determine if there are required parameters and if there are list containers Map _operations = (Map) operations.get("operations"); List operationList = (List) _operations.get("operation"); - boolean hasRequiredParameters = false; + boolean hasRequiredParams = false; boolean hasListContainers = false; boolean hasHttpHeaders = false; boolean hasQueryParams = false; @@ -265,25 +277,46 @@ public class TypeScriptRxjsClientCodegen extends AbstractTypeScriptClientCodegen for (ExtendedCodegenOperation op : operationList) { if (op.getHasRequiredParams()) { - hasRequiredParameters = true; + hasRequiredParams = true; } - - for (CodegenParameter param : op.headerParams) { - if (param.isListContainer) { - hasListContainers = true; - break; + + for (CodegenParameter p: op.allParams) { + String paramNameAlternative = null; + + if(this.reservedParamNames.contains(p.paramName)){ + paramNameAlternative = p.paramName + "Alias"; + LOGGER.info("param: "+p.paramName+" isReserved ––> "+paramNameAlternative); } - } - for (CodegenParameter param : op.queryParams) { - if (param.isListContainer && !param.isCollectionFormatMulti) { - hasListContainers = true; - break; + setParamNameAlternative(p, p.paramName, paramNameAlternative); + + for (CodegenParameter param : op.headerParams) { + if (param.isListContainer) { + hasListContainers = true; + } + setParamNameAlternative(param, p.paramName, paramNameAlternative); } - } - for (CodegenParameter param : op.formParams) { - if (param.isListContainer && !param.isCollectionFormatMulti) { - hasListContainers = true; - break; + + for (CodegenParameter param : op.queryParams) { + if (param.isListContainer && !param.isCollectionFormatMulti) { + hasListContainers = true; + } + if (param.required) { + op.hasRequiredQueryParams = true; + } else { + op.hasOptionalQueryParams = true; + } + setParamNameAlternative(param, p.paramName, paramNameAlternative); + } + + for (CodegenParameter param : op.formParams) { + if (param.isListContainer && !param.isCollectionFormatMulti) { + hasListContainers = true; + } + setParamNameAlternative(param, p.paramName, paramNameAlternative); + } + + for (CodegenParameter param : op.pathParams) { + setParamNameAlternative(param, p.paramName, paramNameAlternative); } } @@ -296,13 +329,9 @@ public class TypeScriptRxjsClientCodegen extends AbstractTypeScriptClientCodegen if (op.getHasPathParams()) { hasPathParams = true; } - - if(hasRequiredParameters && hasListContainers && hasHttpHeaders && hasQueryParams && hasPathParams){ - break; - } } - operations.put("hasRequiredParameters", hasRequiredParameters); + operations.put("hasRequiredParams", hasRequiredParams); operations.put("hasListContainers", hasListContainers); operations.put("hasHttpHeaders", hasHttpHeaders); operations.put("hasQueryParams", hasQueryParams); @@ -312,7 +341,6 @@ public class TypeScriptRxjsClientCodegen extends AbstractTypeScriptClientCodegen private void addExtraReservedWords() { this.reservedWords.add("BASE_PATH"); this.reservedWords.add("BaseAPI"); - this.reservedWords.add("RequiredError"); this.reservedWords.add("COLLECTION_FORMATS"); this.reservedWords.add("ConfigurationParameters"); this.reservedWords.add("Configuration"); @@ -320,11 +348,9 @@ public class TypeScriptRxjsClientCodegen extends AbstractTypeScriptClientCodegen this.reservedWords.add("HttpHeaders"); this.reservedWords.add("HttpQuery"); this.reservedWords.add("HttpBody"); - this.reservedWords.add("ModelPropertyNaming"); this.reservedWords.add("RequestArgs"); this.reservedWords.add("RequestOpts"); this.reservedWords.add("ResponseArgs"); - this.reservedWords.add("exists"); this.reservedWords.add("Middleware"); this.reservedWords.add("AjaxRequest"); this.reservedWords.add("AjaxResponse"); @@ -332,6 +358,8 @@ public class TypeScriptRxjsClientCodegen extends AbstractTypeScriptClientCodegen class ExtendedCodegenOperation extends CodegenOperation { public boolean hasHttpHeaders; + public boolean hasRequiredQueryParams; + public boolean hasOptionalQueryParams; public ExtendedCodegenOperation(CodegenOperation o) { super(); @@ -405,6 +433,8 @@ public class TypeScriptRxjsClientCodegen extends AbstractTypeScriptClientCodegen // new fields this.hasHttpHeaders = o.getHasHeaderParams() || o.getHasBodyParam() || o.hasAuthMethods; + this.hasRequiredQueryParams = false; // will be updated within addConditionalImportInformation + this.hasOptionalQueryParams = false; // will be updated within addConditionalImportInformation } } } diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache index 1528c0dcbb6..78ef140df22 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache @@ -1,7 +1,7 @@ // tslint:disable {{>licenseInfo}} import { Observable } from 'rxjs'; -import { BaseAPI{{#hasHttpHeaders}}, HttpHeaders{{/hasHttpHeaders}}{{#hasQueryParams}}, HttpQuery{{/hasQueryParams}}{{#hasRequiredParameters}}, throwIfRequired{{/hasRequiredParameters}}{{#hasPathParams}}, encodeURI{{/hasPathParams}}{{#hasListContainers}}, COLLECTION_FORMATS{{/hasListContainers}} } from '../runtime'; +import { BaseAPI{{#hasHttpHeaders}}, HttpHeaders{{/hasHttpHeaders}}{{#hasQueryParams}}, HttpQuery{{/hasQueryParams}}{{#hasRequiredParams}}, throwIfNullOrUndefined{{/hasRequiredParams}}{{#hasPathParams}}, encodeURI{{/hasPathParams}}{{#hasListContainers}}, COLLECTION_FORMATS{{/hasListContainers}} } from '../runtime'; {{#imports.0}} import { {{#imports}} @@ -37,11 +37,11 @@ export class {{classname}} extends BaseAPI { * {{&summary}} {{/summary}} */ - {{nickname}} = ({{#allParams.0}}requestParameters: {{operationIdCamelCase}}Request{{/allParams.0}}): Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> => { + {{nickname}} = ({{#allParams.0}}{ {{#allParams}}{{paramName}}{{#vendorExtensions.paramNameAlternative}}: {{vendorExtensions.paramNameAlternative}}{{/vendorExtensions.paramNameAlternative}}{{^-last}}, {{/-last}}{{/allParams}} }: {{operationIdCamelCase}}Request{{/allParams.0}}): Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> => { {{#hasParams}} {{#allParams}} {{#required}} - throwIfRequired(requestParameters, '{{paramName}}', '{{nickname}}'); + throwIfNullOrUndefined({{> paramNamePartial}}, '{{nickname}}'); {{/required}} {{/allParams}} @@ -58,15 +58,15 @@ export class {{classname}} extends BaseAPI { {{/bodyParam}} {{#headerParams}} {{#isListContainer}} - ...(requestParameters.{{paramName}} && { '{{baseName}}': requestParameters.{{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])) }), + ...({{> paramNamePartial}} != null ? { '{{baseName}}': {{> paramNamePartial}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])) } : undefined), {{/isListContainer}} {{^isListContainer}} - ...(requestParameters.{{paramName}} && { '{{baseName}}': String(requestParameters.{{paramName}}) }), + ...({{> paramNamePartial}} != null ? { '{{baseName}}': String({{> paramNamePartial}}) } : undefined), {{/isListContainer}} {{/headerParams}} {{#authMethods}} {{#isBasic}} - ...(this.configuration.username && this.configuration.password && { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` }), + ...(this.configuration.username != null && this.configuration.password != null ? { Authorization: `Basic ${btoa(this.configuration.username + ':' + this.configuration.password)}` } : undefined), {{/isBasic}} {{#isApiKey}} {{#isKeyInHeader}} @@ -75,77 +75,109 @@ export class {{classname}} extends BaseAPI { {{/isApiKey}} {{#isOAuth}} // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('{{name}}', [{{#scopes}}'{{{scope}}}'{{^-last}}, {{/-last}}{{/scopes}}]) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), {{/isOAuth}} {{/authMethods}} }; {{/hasHttpHeaders}} {{#hasQueryParams}} - const query: HttpQuery = { + {{^hasRequiredQueryParams}} + const query: HttpQuery = {}; + {{/hasRequiredQueryParams}} + {{#hasRequiredQueryParams}} + const query: HttpQuery = { // required parameters are used directly since they are already checked by throwIfNullOrUndefined {{#queryParams}} + {{#required}} {{#isListContainer}} {{#isCollectionFormatMulti}} - ...(requestParameters.{{paramName}} && { '{{baseName}}': requestParameters.{{paramName}} }), + '{{baseName}}': {{> paramNamePartial}}, {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - ...(requestParameters.{{paramName}} && { '{{baseName}}': requestParameters.{{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']) }), + '{{baseName}}': {{> paramNamePartial}}.join(COLLECTION_FORMATS['{{collectionFormat}}']), {{/isCollectionFormatMulti}} {{/isListContainer}} {{^isListContainer}} {{#isDateTime}} - ...(requestParameters.{{paramName}} && { '{{baseName}}': (requestParameters.{{paramName}} as any).toISOString() }), + '{{baseName}}': ({{> paramNamePartial}} as any).toISOString(), {{/isDateTime}} {{^isDateTime}} {{#isDate}} - ...(requestParameters.{{paramName}} && { '{{baseName}}': (requestParameters.{{paramName}} as any).toISOString() }), + '{{baseName}}': ({{> paramNamePartial}} as any).toISOString(), {{/isDate}} {{^isDate}} - ...(requestParameters.{{paramName}} && { '{{baseName}}': requestParameters.{{paramName}} }), + '{{baseName}}': {{> paramNamePartial}}, {{/isDate}} {{/isDateTime}} {{/isListContainer}} + {{/required}} {{/queryParams}} - {{#authMethods}} - {{#isApiKey}} - {{#isKeyInQuery}} - ...(this.configuration.apiKey && { '{{keyParamName}}': this.configuration.apiKey && this.configuration.apiKey('{{keyParamName}}') }), // {{name}} authentication - {{/isKeyInQuery}} - {{/isApiKey}} - {{/authMethods}} }; + {{/hasRequiredQueryParams}} + {{#hasOptionalQueryParams}} + + {{#queryParams}} + {{^required}} + {{#isListContainer}} + {{#isCollectionFormatMulti}} + if ({{> paramNamePartial}} != null) { query['{{baseName}}'] = {{> paramNamePartial}}; } + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} + if ({{> paramNamePartial}} != null) { query['{{baseName}}'] = {{> paramNamePartial}}.join(COLLECTION_FORMATS['{{collectionFormat}}']); } + {{/isCollectionFormatMulti}} + {{/isListContainer}} + {{^isListContainer}} + {{#isDateTime}} + if ({{> paramNamePartial}} != null) { query['{{baseName}}'] = ({{> paramNamePartial}} as any).toISOString(); } + {{/isDateTime}} + {{^isDateTime}} + {{#isDate}} + if ({{> paramNamePartial}} != null) { query['{{baseName}}'] = ({{> paramNamePartial}} as any).toISOString(); } + {{/isDate}} + {{^isDate}} + if ({{> paramNamePartial}} != null) { query['{{baseName}}'] = {{> paramNamePartial}}; } + {{/isDate}} + {{/isDateTime}} + {{/isListContainer}} + {{/required}} + {{/queryParams}} + {{/hasOptionalQueryParams}} + {{#authMethods}} + {{#isApiKey}} + {{#isKeyInQuery}} + if (this.configuration.apiKey != null) { query['{{keyParamName}}'] = this.configuration.apiKey('{{keyParamName}}'); } // {{name}} authentication + {{/isKeyInQuery}} + {{/isApiKey}} + {{/authMethods}} {{/hasQueryParams}} {{#hasFormParams}} const formData = new FormData(); - {{/hasFormParams}} {{#formParams}} {{#isListContainer}} - if (requestParameters.{{paramName}}) { + if ({{> paramNamePartial}} !== undefined) { {{#isCollectionFormatMulti}} - requestParameters.{{paramName}}.forEach((element) => { - formData.append('{{baseName}}', element as any); - }) + {{> paramNamePartial}}.forEach((element) => formData.append('{{baseName}}', element as any)) {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - formData.append('{{baseName}}', requestParameters.{{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])); + formData.append('{{baseName}}', {{> paramNamePartial}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])); {{/isCollectionFormatMulti}} } {{/isListContainer}} {{^isListContainer}} - if (requestParameters.{{paramName}} !== undefined) { - formData.append('{{baseName}}', requestParameters.{{paramName}} as any); - } - + if ({{> paramNamePartial}} !== undefined) { formData.append('{{baseName}}', {{> paramNamePartial}} as any); } {{/isListContainer}} {{/formParams}} + + {{/hasFormParams}} return this.request<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}>({ - path: '{{{path}}}'{{#pathParams}}.replace({{=<% %>=}}'{<%baseName%>}'<%={{ }}=%>, encodeURI(requestParameters.{{paramName}})){{/pathParams}}, + path: '{{{path}}}'{{#pathParams}}.replace({{=<% %>=}}'{<%baseName%>}'<%={{ }}=%>, encodeURI({{> paramNamePartial}})){{/pathParams}}, method: '{{httpMethod}}', {{#hasHttpHeaders}} headers, @@ -156,14 +188,14 @@ export class {{classname}} extends BaseAPI { {{#hasBodyParam}} {{#bodyParam}} {{#isContainer}} - body: requestParameters.{{paramName}}, + body: {{paramName}}, {{/isContainer}} {{^isContainer}} {{^isPrimitiveType}} - body: requestParameters.{{paramName}}, + body: {{paramName}}, {{/isPrimitiveType}} {{#isPrimitiveType}} - body: requestParameters.{{paramName}} as any, + body: {{paramName}} as any, {{/isPrimitiveType}} {{/isContainer}} {{/bodyParam}} diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/paramNamePartial.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/paramNamePartial.mustache new file mode 100644 index 00000000000..d406033c593 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/paramNamePartial.mustache @@ -0,0 +1,2 @@ +{{! helper to output the alias of a parameter if provided and to not clutter the main template }} +{{#vendorExtensions.paramNameAlternative}}{{vendorExtensions.paramNameAlternative}}{{/vendorExtensions.paramNameAlternative}}{{^vendorExtensions.paramNameAlternative}}{{paramName}}{{/vendorExtensions.paramNameAlternative}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache index 7c58be70a52..a978bd7d2cc 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache @@ -36,18 +36,12 @@ export class Configuration { get apiKey(): ((name: string) => string) | undefined { const apiKey = this.configuration.apiKey; - if (apiKey) { - return typeof apiKey === 'function' ? apiKey : () => apiKey; - } - return undefined; + return apiKey && (typeof apiKey === 'function' ? apiKey : () => apiKey); } get accessToken(): ((name: string, scopes?: string[]) => string) | undefined { const accessToken = this.configuration.accessToken; - if (accessToken) { - return typeof accessToken === 'function' ? accessToken : () => accessToken; - } - return undefined; + return accessToken && (typeof accessToken === 'function' ? accessToken : () => accessToken); } } @@ -61,17 +55,17 @@ export class BaseAPI { this.middleware = configuration.middleware; } - withMiddleware = (middlewares: Middleware[]) => { - const next = this.clone(); + withMiddleware = (middlewares: Middleware[]) => { + const next = this.clone(); next.middleware = next.middleware.concat(middlewares); return next; }; - withPreMiddleware = (preMiddlewares: Array) => - this.withMiddleware(preMiddlewares.map((pre) => ({ pre }))); + withPreMiddleware = (preMiddlewares: Array) => + this.withMiddleware(preMiddlewares.map((pre) => ({ pre }))); - withPostMiddleware = (postMiddlewares: Array) => - this.withMiddleware(postMiddlewares.map((post) => ({ post }))); + withPostMiddleware = (postMiddlewares: Array) => + this.withMiddleware(postMiddlewares.map((post) => ({ post }))); protected request = (requestOpts: RequestOpts): Observable => this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( @@ -121,11 +115,14 @@ export class BaseAPI { * Create a shallow clone of `this` by constructing a new instance * and then shallow cloning data members. */ - private clone = (): T => + private clone = (): BaseAPI => Object.assign(Object.create(Object.getPrototypeOf(this)), this); } -// export for not being a breaking change +/** + * @deprecated + * export for not being a breaking change + */ export class RequiredError extends Error { name: 'RequiredError' = 'RequiredError'; } @@ -142,7 +139,6 @@ export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HttpHeaders = { [key: string]: string }; export type HttpQuery = Partial<{ [key: string]: string | number | null | boolean | Array }>; // partial is needed for strict mode export type HttpBody = Json | FormData; -export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export interface RequestOpts { path: string; @@ -167,12 +163,21 @@ const queryString = (params: HttpQuery): string => Object.keys(params) // alias fallback for not being a breaking change export const querystring = queryString; +/** + * @deprecated + */ export const throwIfRequired = (params: {[key: string]: any}, key: string, nickname: string) => { - if (!params || params[key] === null || params[key] === undefined) { + if (!params || params[key] == null) { throw new RequiredError(`Required parameter ${key} was null or undefined when calling ${nickname}.`); } }; +export const throwIfNullOrUndefined = (value: any, nickname?: string) => { + if (value == null) { + throw new Error(`Parameter "${value}" was null or undefined when calling "${nickname}".`); + } +}; + // alias for easier importing export interface RequestArgs extends AjaxRequest {} export interface ResponseArgs extends AjaxResponse {} diff --git a/samples/client/petstore/typescript-rxjs/builds/default/apis/PetApi.ts b/samples/client/petstore/typescript-rxjs/builds/default/apis/PetApi.ts index a5328a8c728..3b3232c44db 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/apis/PetApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/apis/PetApi.ts @@ -12,7 +12,7 @@ */ import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, HttpQuery, throwIfRequired, encodeURI, COLLECTION_FORMATS } from '../runtime'; +import { BaseAPI, HttpHeaders, HttpQuery, throwIfNullOrUndefined, encodeURI, COLLECTION_FORMATS } from '../runtime'; import { ApiResponse, Pet, @@ -63,45 +63,47 @@ export class PetApi extends BaseAPI { /** * Add a new pet to the store */ - addPet = (requestParameters: AddPetRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'addPet'); + addPet = ({ body }: AddPetRequest): Observable => { + throwIfNullOrUndefined(body, 'addPet'); const headers: HttpHeaders = { 'Content-Type': 'application/json', // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; return this.request({ path: '/pet', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; /** * Deletes a pet */ - deletePet = (requestParameters: DeletePetRequest): Observable => { - throwIfRequired(requestParameters, 'petId', 'deletePet'); + deletePet = ({ petId, apiKey }: DeletePetRequest): Observable => { + throwIfNullOrUndefined(petId, 'deletePet'); const headers: HttpHeaders = { - ...(requestParameters.apiKey && { 'api_key': String(requestParameters.apiKey) }), + ...(apiKey != null ? { 'api_key': String(apiKey) } : undefined), // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; return this.request({ - path: '/pet/{petId}'.replace('{petId}', encodeURI(requestParameters.petId)), + path: '/pet/{petId}'.replace('{petId}', encodeURI(petId)), method: 'DELETE', headers, }); @@ -111,20 +113,21 @@ export class PetApi extends BaseAPI { * Multiple status values can be provided with comma separated strings * Finds Pets by status */ - findPetsByStatus = (requestParameters: FindPetsByStatusRequest): Observable> => { - throwIfRequired(requestParameters, 'status', 'findPetsByStatus'); + findPetsByStatus = ({ status }: FindPetsByStatusRequest): Observable> => { + throwIfNullOrUndefined(status, 'findPetsByStatus'); const headers: HttpHeaders = { // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; - const query: HttpQuery = { - ...(requestParameters.status && { 'status': requestParameters.status.join(COLLECTION_FORMATS['csv']) }), + const query: HttpQuery = { // required parameters are used directly since they are already checked by throwIfNullOrUndefined + 'status': status.join(COLLECTION_FORMATS['csv']), }; return this.request>({ @@ -139,20 +142,21 @@ export class PetApi extends BaseAPI { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * Finds Pets by tags */ - findPetsByTags = (requestParameters: FindPetsByTagsRequest): Observable> => { - throwIfRequired(requestParameters, 'tags', 'findPetsByTags'); + findPetsByTags = ({ tags }: FindPetsByTagsRequest): Observable> => { + throwIfNullOrUndefined(tags, 'findPetsByTags'); const headers: HttpHeaders = { // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; - const query: HttpQuery = { - ...(requestParameters.tags && { 'tags': requestParameters.tags.join(COLLECTION_FORMATS['csv']) }), + const query: HttpQuery = { // required parameters are used directly since they are already checked by throwIfNullOrUndefined + 'tags': tags.join(COLLECTION_FORMATS['csv']), }; return this.request>({ @@ -167,15 +171,15 @@ export class PetApi extends BaseAPI { * Returns a single pet * Find pet by ID */ - getPetById = (requestParameters: GetPetByIdRequest): Observable => { - throwIfRequired(requestParameters, 'petId', 'getPetById'); + getPetById = ({ petId }: GetPetByIdRequest): Observable => { + throwIfNullOrUndefined(petId, 'getPetById'); const headers: HttpHeaders = { ...(this.configuration.apiKey && { 'api_key': this.configuration.apiKey('api_key') }), // api_key authentication }; return this.request({ - path: '/pet/{petId}'.replace('{petId}', encodeURI(requestParameters.petId)), + path: '/pet/{petId}'.replace('{petId}', encodeURI(petId)), method: 'GET', headers, }); @@ -184,53 +188,50 @@ export class PetApi extends BaseAPI { /** * Update an existing pet */ - updatePet = (requestParameters: UpdatePetRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'updatePet'); + updatePet = ({ body }: UpdatePetRequest): Observable => { + throwIfNullOrUndefined(body, 'updatePet'); const headers: HttpHeaders = { 'Content-Type': 'application/json', // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; return this.request({ path: '/pet', method: 'PUT', headers, - body: requestParameters.body, + body: body, }); }; /** * Updates a pet in the store with form data */ - updatePetWithForm = (requestParameters: UpdatePetWithFormRequest): Observable => { - throwIfRequired(requestParameters, 'petId', 'updatePetWithForm'); + updatePetWithForm = ({ petId, name, status }: UpdatePetWithFormRequest): Observable => { + throwIfNullOrUndefined(petId, 'updatePetWithForm'); const headers: HttpHeaders = { // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; const formData = new FormData(); - if (requestParameters.name !== undefined) { - formData.append('name', requestParameters.name as any); - } - - if (requestParameters.status !== undefined) { - formData.append('status', requestParameters.status as any); - } + if (name !== undefined) { formData.append('name', name as any); } + if (status !== undefined) { formData.append('status', status as any); } return this.request({ - path: '/pet/{petId}'.replace('{petId}', encodeURI(requestParameters.petId)), + path: '/pet/{petId}'.replace('{petId}', encodeURI(petId)), method: 'POST', headers, body: formData, @@ -240,29 +241,25 @@ export class PetApi extends BaseAPI { /** * uploads an image */ - uploadFile = (requestParameters: UploadFileRequest): Observable => { - throwIfRequired(requestParameters, 'petId', 'uploadFile'); + uploadFile = ({ petId, additionalMetadata, file }: UploadFileRequest): Observable => { + throwIfNullOrUndefined(petId, 'uploadFile'); const headers: HttpHeaders = { // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; const formData = new FormData(); - if (requestParameters.additionalMetadata !== undefined) { - formData.append('additionalMetadata', requestParameters.additionalMetadata as any); - } - - if (requestParameters.file !== undefined) { - formData.append('file', requestParameters.file as any); - } + if (additionalMetadata !== undefined) { formData.append('additionalMetadata', additionalMetadata as any); } + if (file !== undefined) { formData.append('file', file as any); } return this.request({ - path: '/pet/{petId}/uploadImage'.replace('{petId}', encodeURI(requestParameters.petId)), + path: '/pet/{petId}/uploadImage'.replace('{petId}', encodeURI(petId)), method: 'POST', headers, body: formData, diff --git a/samples/client/petstore/typescript-rxjs/builds/default/apis/StoreApi.ts b/samples/client/petstore/typescript-rxjs/builds/default/apis/StoreApi.ts index 623b48bdede..aac36206d60 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/apis/StoreApi.ts @@ -12,7 +12,7 @@ */ import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, throwIfRequired, encodeURI } from '../runtime'; +import { BaseAPI, HttpHeaders, throwIfNullOrUndefined, encodeURI } from '../runtime'; import { Order, } from '../models'; @@ -38,11 +38,11 @@ export class StoreApi extends BaseAPI { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * Delete purchase order by ID */ - deleteOrder = (requestParameters: DeleteOrderRequest): Observable => { - throwIfRequired(requestParameters, 'orderId', 'deleteOrder'); + deleteOrder = ({ orderId }: DeleteOrderRequest): Observable => { + throwIfNullOrUndefined(orderId, 'deleteOrder'); return this.request({ - path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(requestParameters.orderId)), + path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(orderId)), method: 'DELETE', }); }; @@ -67,11 +67,11 @@ export class StoreApi extends BaseAPI { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * Find purchase order by ID */ - getOrderById = (requestParameters: GetOrderByIdRequest): Observable => { - throwIfRequired(requestParameters, 'orderId', 'getOrderById'); + getOrderById = ({ orderId }: GetOrderByIdRequest): Observable => { + throwIfNullOrUndefined(orderId, 'getOrderById'); return this.request({ - path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(requestParameters.orderId)), + path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(orderId)), method: 'GET', }); }; @@ -79,8 +79,8 @@ export class StoreApi extends BaseAPI { /** * Place an order for a pet */ - placeOrder = (requestParameters: PlaceOrderRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'placeOrder'); + placeOrder = ({ body }: PlaceOrderRequest): Observable => { + throwIfNullOrUndefined(body, 'placeOrder'); const headers: HttpHeaders = { 'Content-Type': 'application/json', @@ -90,7 +90,7 @@ export class StoreApi extends BaseAPI { path: '/store/order', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; diff --git a/samples/client/petstore/typescript-rxjs/builds/default/apis/UserApi.ts b/samples/client/petstore/typescript-rxjs/builds/default/apis/UserApi.ts index 2194fdfe9f6..1b3c07eea4f 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/apis/UserApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/apis/UserApi.ts @@ -12,7 +12,7 @@ */ import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, HttpQuery, throwIfRequired, encodeURI } from '../runtime'; +import { BaseAPI, HttpHeaders, HttpQuery, throwIfNullOrUndefined, encodeURI } from '../runtime'; import { User, } from '../models'; @@ -56,8 +56,8 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * Create user */ - createUser = (requestParameters: CreateUserRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'createUser'); + createUser = ({ body }: CreateUserRequest): Observable => { + throwIfNullOrUndefined(body, 'createUser'); const headers: HttpHeaders = { 'Content-Type': 'application/json', @@ -67,15 +67,15 @@ export class UserApi extends BaseAPI { path: '/user', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; /** * Creates list of users with given input array */ - createUsersWithArrayInput = (requestParameters: CreateUsersWithArrayInputRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'createUsersWithArrayInput'); + createUsersWithArrayInput = ({ body }: CreateUsersWithArrayInputRequest): Observable => { + throwIfNullOrUndefined(body, 'createUsersWithArrayInput'); const headers: HttpHeaders = { 'Content-Type': 'application/json', @@ -85,15 +85,15 @@ export class UserApi extends BaseAPI { path: '/user/createWithArray', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; /** * Creates list of users with given input array */ - createUsersWithListInput = (requestParameters: CreateUsersWithListInputRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'createUsersWithListInput'); + createUsersWithListInput = ({ body }: CreateUsersWithListInputRequest): Observable => { + throwIfNullOrUndefined(body, 'createUsersWithListInput'); const headers: HttpHeaders = { 'Content-Type': 'application/json', @@ -103,7 +103,7 @@ export class UserApi extends BaseAPI { path: '/user/createWithList', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; @@ -111,11 +111,11 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * Delete user */ - deleteUser = (requestParameters: DeleteUserRequest): Observable => { - throwIfRequired(requestParameters, 'username', 'deleteUser'); + deleteUser = ({ username }: DeleteUserRequest): Observable => { + throwIfNullOrUndefined(username, 'deleteUser'); return this.request({ - path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), + path: '/user/{username}'.replace('{username}', encodeURI(username)), method: 'DELETE', }); }; @@ -123,11 +123,11 @@ export class UserApi extends BaseAPI { /** * Get user by user name */ - getUserByName = (requestParameters: GetUserByNameRequest): Observable => { - throwIfRequired(requestParameters, 'username', 'getUserByName'); + getUserByName = ({ username }: GetUserByNameRequest): Observable => { + throwIfNullOrUndefined(username, 'getUserByName'); return this.request({ - path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), + path: '/user/{username}'.replace('{username}', encodeURI(username)), method: 'GET', }); }; @@ -135,13 +135,13 @@ export class UserApi extends BaseAPI { /** * Logs user into the system */ - loginUser = (requestParameters: LoginUserRequest): Observable => { - throwIfRequired(requestParameters, 'username', 'loginUser'); - throwIfRequired(requestParameters, 'password', 'loginUser'); + loginUser = ({ username, password }: LoginUserRequest): Observable => { + throwIfNullOrUndefined(username, 'loginUser'); + throwIfNullOrUndefined(password, 'loginUser'); - const query: HttpQuery = { - ...(requestParameters.username && { 'username': requestParameters.username }), - ...(requestParameters.password && { 'password': requestParameters.password }), + const query: HttpQuery = { // required parameters are used directly since they are already checked by throwIfNullOrUndefined + 'username': username, + 'password': password, }; return this.request({ @@ -165,19 +165,19 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * Updated user */ - updateUser = (requestParameters: UpdateUserRequest): Observable => { - throwIfRequired(requestParameters, 'username', 'updateUser'); - throwIfRequired(requestParameters, 'body', 'updateUser'); + updateUser = ({ username, body }: UpdateUserRequest): Observable => { + throwIfNullOrUndefined(username, 'updateUser'); + throwIfNullOrUndefined(body, 'updateUser'); const headers: HttpHeaders = { 'Content-Type': 'application/json', }; return this.request({ - path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), + path: '/user/{username}'.replace('{username}', encodeURI(username)), method: 'PUT', headers, - body: requestParameters.body, + body: body, }); }; diff --git a/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts index e71a012b04b..40d2e7b3947 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts @@ -47,18 +47,12 @@ export class Configuration { get apiKey(): ((name: string) => string) | undefined { const apiKey = this.configuration.apiKey; - if (apiKey) { - return typeof apiKey === 'function' ? apiKey : () => apiKey; - } - return undefined; + return apiKey && (typeof apiKey === 'function' ? apiKey : () => apiKey); } get accessToken(): ((name: string, scopes?: string[]) => string) | undefined { const accessToken = this.configuration.accessToken; - if (accessToken) { - return typeof accessToken === 'function' ? accessToken : () => accessToken; - } - return undefined; + return accessToken && (typeof accessToken === 'function' ? accessToken : () => accessToken); } } @@ -72,17 +66,17 @@ export class BaseAPI { this.middleware = configuration.middleware; } - withMiddleware = (middlewares: Middleware[]) => { - const next = this.clone(); + withMiddleware = (middlewares: Middleware[]) => { + const next = this.clone(); next.middleware = next.middleware.concat(middlewares); return next; }; - withPreMiddleware = (preMiddlewares: Array) => - this.withMiddleware(preMiddlewares.map((pre) => ({ pre }))); + withPreMiddleware = (preMiddlewares: Array) => + this.withMiddleware(preMiddlewares.map((pre) => ({ pre }))); - withPostMiddleware = (postMiddlewares: Array) => - this.withMiddleware(postMiddlewares.map((post) => ({ post }))); + withPostMiddleware = (postMiddlewares: Array) => + this.withMiddleware(postMiddlewares.map((post) => ({ post }))); protected request = (requestOpts: RequestOpts): Observable => this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( @@ -132,11 +126,14 @@ export class BaseAPI { * Create a shallow clone of `this` by constructing a new instance * and then shallow cloning data members. */ - private clone = (): T => + private clone = (): BaseAPI => Object.assign(Object.create(Object.getPrototypeOf(this)), this); } -// export for not being a breaking change +/** + * @deprecated + * export for not being a breaking change + */ export class RequiredError extends Error { name: 'RequiredError' = 'RequiredError'; } @@ -153,7 +150,6 @@ export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HttpHeaders = { [key: string]: string }; export type HttpQuery = Partial<{ [key: string]: string | number | null | boolean | Array }>; // partial is needed for strict mode export type HttpBody = Json | FormData; -export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export interface RequestOpts { path: string; @@ -178,12 +174,21 @@ const queryString = (params: HttpQuery): string => Object.keys(params) // alias fallback for not being a breaking change export const querystring = queryString; +/** + * @deprecated + */ export const throwIfRequired = (params: {[key: string]: any}, key: string, nickname: string) => { - if (!params || params[key] === null || params[key] === undefined) { + if (!params || params[key] == null) { throw new RequiredError(`Required parameter ${key} was null or undefined when calling ${nickname}.`); } }; +export const throwIfNullOrUndefined = (value: any, nickname?: string) => { + if (value == null) { + throw new Error(`Parameter "${value}" was null or undefined when calling "${nickname}".`); + } +}; + // alias for easier importing export interface RequestArgs extends AjaxRequest {} export interface ResponseArgs extends AjaxResponse {} diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/PetApi.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/PetApi.ts index a5328a8c728..3b3232c44db 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/PetApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/PetApi.ts @@ -12,7 +12,7 @@ */ import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, HttpQuery, throwIfRequired, encodeURI, COLLECTION_FORMATS } from '../runtime'; +import { BaseAPI, HttpHeaders, HttpQuery, throwIfNullOrUndefined, encodeURI, COLLECTION_FORMATS } from '../runtime'; import { ApiResponse, Pet, @@ -63,45 +63,47 @@ export class PetApi extends BaseAPI { /** * Add a new pet to the store */ - addPet = (requestParameters: AddPetRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'addPet'); + addPet = ({ body }: AddPetRequest): Observable => { + throwIfNullOrUndefined(body, 'addPet'); const headers: HttpHeaders = { 'Content-Type': 'application/json', // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; return this.request({ path: '/pet', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; /** * Deletes a pet */ - deletePet = (requestParameters: DeletePetRequest): Observable => { - throwIfRequired(requestParameters, 'petId', 'deletePet'); + deletePet = ({ petId, apiKey }: DeletePetRequest): Observable => { + throwIfNullOrUndefined(petId, 'deletePet'); const headers: HttpHeaders = { - ...(requestParameters.apiKey && { 'api_key': String(requestParameters.apiKey) }), + ...(apiKey != null ? { 'api_key': String(apiKey) } : undefined), // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; return this.request({ - path: '/pet/{petId}'.replace('{petId}', encodeURI(requestParameters.petId)), + path: '/pet/{petId}'.replace('{petId}', encodeURI(petId)), method: 'DELETE', headers, }); @@ -111,20 +113,21 @@ export class PetApi extends BaseAPI { * Multiple status values can be provided with comma separated strings * Finds Pets by status */ - findPetsByStatus = (requestParameters: FindPetsByStatusRequest): Observable> => { - throwIfRequired(requestParameters, 'status', 'findPetsByStatus'); + findPetsByStatus = ({ status }: FindPetsByStatusRequest): Observable> => { + throwIfNullOrUndefined(status, 'findPetsByStatus'); const headers: HttpHeaders = { // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; - const query: HttpQuery = { - ...(requestParameters.status && { 'status': requestParameters.status.join(COLLECTION_FORMATS['csv']) }), + const query: HttpQuery = { // required parameters are used directly since they are already checked by throwIfNullOrUndefined + 'status': status.join(COLLECTION_FORMATS['csv']), }; return this.request>({ @@ -139,20 +142,21 @@ export class PetApi extends BaseAPI { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * Finds Pets by tags */ - findPetsByTags = (requestParameters: FindPetsByTagsRequest): Observable> => { - throwIfRequired(requestParameters, 'tags', 'findPetsByTags'); + findPetsByTags = ({ tags }: FindPetsByTagsRequest): Observable> => { + throwIfNullOrUndefined(tags, 'findPetsByTags'); const headers: HttpHeaders = { // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; - const query: HttpQuery = { - ...(requestParameters.tags && { 'tags': requestParameters.tags.join(COLLECTION_FORMATS['csv']) }), + const query: HttpQuery = { // required parameters are used directly since they are already checked by throwIfNullOrUndefined + 'tags': tags.join(COLLECTION_FORMATS['csv']), }; return this.request>({ @@ -167,15 +171,15 @@ export class PetApi extends BaseAPI { * Returns a single pet * Find pet by ID */ - getPetById = (requestParameters: GetPetByIdRequest): Observable => { - throwIfRequired(requestParameters, 'petId', 'getPetById'); + getPetById = ({ petId }: GetPetByIdRequest): Observable => { + throwIfNullOrUndefined(petId, 'getPetById'); const headers: HttpHeaders = { ...(this.configuration.apiKey && { 'api_key': this.configuration.apiKey('api_key') }), // api_key authentication }; return this.request({ - path: '/pet/{petId}'.replace('{petId}', encodeURI(requestParameters.petId)), + path: '/pet/{petId}'.replace('{petId}', encodeURI(petId)), method: 'GET', headers, }); @@ -184,53 +188,50 @@ export class PetApi extends BaseAPI { /** * Update an existing pet */ - updatePet = (requestParameters: UpdatePetRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'updatePet'); + updatePet = ({ body }: UpdatePetRequest): Observable => { + throwIfNullOrUndefined(body, 'updatePet'); const headers: HttpHeaders = { 'Content-Type': 'application/json', // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; return this.request({ path: '/pet', method: 'PUT', headers, - body: requestParameters.body, + body: body, }); }; /** * Updates a pet in the store with form data */ - updatePetWithForm = (requestParameters: UpdatePetWithFormRequest): Observable => { - throwIfRequired(requestParameters, 'petId', 'updatePetWithForm'); + updatePetWithForm = ({ petId, name, status }: UpdatePetWithFormRequest): Observable => { + throwIfNullOrUndefined(petId, 'updatePetWithForm'); const headers: HttpHeaders = { // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; const formData = new FormData(); - if (requestParameters.name !== undefined) { - formData.append('name', requestParameters.name as any); - } - - if (requestParameters.status !== undefined) { - formData.append('status', requestParameters.status as any); - } + if (name !== undefined) { formData.append('name', name as any); } + if (status !== undefined) { formData.append('status', status as any); } return this.request({ - path: '/pet/{petId}'.replace('{petId}', encodeURI(requestParameters.petId)), + path: '/pet/{petId}'.replace('{petId}', encodeURI(petId)), method: 'POST', headers, body: formData, @@ -240,29 +241,25 @@ export class PetApi extends BaseAPI { /** * uploads an image */ - uploadFile = (requestParameters: UploadFileRequest): Observable => { - throwIfRequired(requestParameters, 'petId', 'uploadFile'); + uploadFile = ({ petId, additionalMetadata, file }: UploadFileRequest): Observable => { + throwIfNullOrUndefined(petId, 'uploadFile'); const headers: HttpHeaders = { // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; const formData = new FormData(); - if (requestParameters.additionalMetadata !== undefined) { - formData.append('additionalMetadata', requestParameters.additionalMetadata as any); - } - - if (requestParameters.file !== undefined) { - formData.append('file', requestParameters.file as any); - } + if (additionalMetadata !== undefined) { formData.append('additionalMetadata', additionalMetadata as any); } + if (file !== undefined) { formData.append('file', file as any); } return this.request({ - path: '/pet/{petId}/uploadImage'.replace('{petId}', encodeURI(requestParameters.petId)), + path: '/pet/{petId}/uploadImage'.replace('{petId}', encodeURI(petId)), method: 'POST', headers, body: formData, diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/StoreApi.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/StoreApi.ts index 623b48bdede..aac36206d60 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/StoreApi.ts @@ -12,7 +12,7 @@ */ import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, throwIfRequired, encodeURI } from '../runtime'; +import { BaseAPI, HttpHeaders, throwIfNullOrUndefined, encodeURI } from '../runtime'; import { Order, } from '../models'; @@ -38,11 +38,11 @@ export class StoreApi extends BaseAPI { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * Delete purchase order by ID */ - deleteOrder = (requestParameters: DeleteOrderRequest): Observable => { - throwIfRequired(requestParameters, 'orderId', 'deleteOrder'); + deleteOrder = ({ orderId }: DeleteOrderRequest): Observable => { + throwIfNullOrUndefined(orderId, 'deleteOrder'); return this.request({ - path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(requestParameters.orderId)), + path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(orderId)), method: 'DELETE', }); }; @@ -67,11 +67,11 @@ export class StoreApi extends BaseAPI { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * Find purchase order by ID */ - getOrderById = (requestParameters: GetOrderByIdRequest): Observable => { - throwIfRequired(requestParameters, 'orderId', 'getOrderById'); + getOrderById = ({ orderId }: GetOrderByIdRequest): Observable => { + throwIfNullOrUndefined(orderId, 'getOrderById'); return this.request({ - path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(requestParameters.orderId)), + path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(orderId)), method: 'GET', }); }; @@ -79,8 +79,8 @@ export class StoreApi extends BaseAPI { /** * Place an order for a pet */ - placeOrder = (requestParameters: PlaceOrderRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'placeOrder'); + placeOrder = ({ body }: PlaceOrderRequest): Observable => { + throwIfNullOrUndefined(body, 'placeOrder'); const headers: HttpHeaders = { 'Content-Type': 'application/json', @@ -90,7 +90,7 @@ export class StoreApi extends BaseAPI { path: '/store/order', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/UserApi.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/UserApi.ts index 2194fdfe9f6..1b3c07eea4f 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/UserApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/apis/UserApi.ts @@ -12,7 +12,7 @@ */ import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, HttpQuery, throwIfRequired, encodeURI } from '../runtime'; +import { BaseAPI, HttpHeaders, HttpQuery, throwIfNullOrUndefined, encodeURI } from '../runtime'; import { User, } from '../models'; @@ -56,8 +56,8 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * Create user */ - createUser = (requestParameters: CreateUserRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'createUser'); + createUser = ({ body }: CreateUserRequest): Observable => { + throwIfNullOrUndefined(body, 'createUser'); const headers: HttpHeaders = { 'Content-Type': 'application/json', @@ -67,15 +67,15 @@ export class UserApi extends BaseAPI { path: '/user', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; /** * Creates list of users with given input array */ - createUsersWithArrayInput = (requestParameters: CreateUsersWithArrayInputRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'createUsersWithArrayInput'); + createUsersWithArrayInput = ({ body }: CreateUsersWithArrayInputRequest): Observable => { + throwIfNullOrUndefined(body, 'createUsersWithArrayInput'); const headers: HttpHeaders = { 'Content-Type': 'application/json', @@ -85,15 +85,15 @@ export class UserApi extends BaseAPI { path: '/user/createWithArray', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; /** * Creates list of users with given input array */ - createUsersWithListInput = (requestParameters: CreateUsersWithListInputRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'createUsersWithListInput'); + createUsersWithListInput = ({ body }: CreateUsersWithListInputRequest): Observable => { + throwIfNullOrUndefined(body, 'createUsersWithListInput'); const headers: HttpHeaders = { 'Content-Type': 'application/json', @@ -103,7 +103,7 @@ export class UserApi extends BaseAPI { path: '/user/createWithList', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; @@ -111,11 +111,11 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * Delete user */ - deleteUser = (requestParameters: DeleteUserRequest): Observable => { - throwIfRequired(requestParameters, 'username', 'deleteUser'); + deleteUser = ({ username }: DeleteUserRequest): Observable => { + throwIfNullOrUndefined(username, 'deleteUser'); return this.request({ - path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), + path: '/user/{username}'.replace('{username}', encodeURI(username)), method: 'DELETE', }); }; @@ -123,11 +123,11 @@ export class UserApi extends BaseAPI { /** * Get user by user name */ - getUserByName = (requestParameters: GetUserByNameRequest): Observable => { - throwIfRequired(requestParameters, 'username', 'getUserByName'); + getUserByName = ({ username }: GetUserByNameRequest): Observable => { + throwIfNullOrUndefined(username, 'getUserByName'); return this.request({ - path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), + path: '/user/{username}'.replace('{username}', encodeURI(username)), method: 'GET', }); }; @@ -135,13 +135,13 @@ export class UserApi extends BaseAPI { /** * Logs user into the system */ - loginUser = (requestParameters: LoginUserRequest): Observable => { - throwIfRequired(requestParameters, 'username', 'loginUser'); - throwIfRequired(requestParameters, 'password', 'loginUser'); + loginUser = ({ username, password }: LoginUserRequest): Observable => { + throwIfNullOrUndefined(username, 'loginUser'); + throwIfNullOrUndefined(password, 'loginUser'); - const query: HttpQuery = { - ...(requestParameters.username && { 'username': requestParameters.username }), - ...(requestParameters.password && { 'password': requestParameters.password }), + const query: HttpQuery = { // required parameters are used directly since they are already checked by throwIfNullOrUndefined + 'username': username, + 'password': password, }; return this.request({ @@ -165,19 +165,19 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * Updated user */ - updateUser = (requestParameters: UpdateUserRequest): Observable => { - throwIfRequired(requestParameters, 'username', 'updateUser'); - throwIfRequired(requestParameters, 'body', 'updateUser'); + updateUser = ({ username, body }: UpdateUserRequest): Observable => { + throwIfNullOrUndefined(username, 'updateUser'); + throwIfNullOrUndefined(body, 'updateUser'); const headers: HttpHeaders = { 'Content-Type': 'application/json', }; return this.request({ - path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), + path: '/user/{username}'.replace('{username}', encodeURI(username)), method: 'PUT', headers, - body: requestParameters.body, + body: body, }); }; diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts index e71a012b04b..40d2e7b3947 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts @@ -47,18 +47,12 @@ export class Configuration { get apiKey(): ((name: string) => string) | undefined { const apiKey = this.configuration.apiKey; - if (apiKey) { - return typeof apiKey === 'function' ? apiKey : () => apiKey; - } - return undefined; + return apiKey && (typeof apiKey === 'function' ? apiKey : () => apiKey); } get accessToken(): ((name: string, scopes?: string[]) => string) | undefined { const accessToken = this.configuration.accessToken; - if (accessToken) { - return typeof accessToken === 'function' ? accessToken : () => accessToken; - } - return undefined; + return accessToken && (typeof accessToken === 'function' ? accessToken : () => accessToken); } } @@ -72,17 +66,17 @@ export class BaseAPI { this.middleware = configuration.middleware; } - withMiddleware = (middlewares: Middleware[]) => { - const next = this.clone(); + withMiddleware = (middlewares: Middleware[]) => { + const next = this.clone(); next.middleware = next.middleware.concat(middlewares); return next; }; - withPreMiddleware = (preMiddlewares: Array) => - this.withMiddleware(preMiddlewares.map((pre) => ({ pre }))); + withPreMiddleware = (preMiddlewares: Array) => + this.withMiddleware(preMiddlewares.map((pre) => ({ pre }))); - withPostMiddleware = (postMiddlewares: Array) => - this.withMiddleware(postMiddlewares.map((post) => ({ post }))); + withPostMiddleware = (postMiddlewares: Array) => + this.withMiddleware(postMiddlewares.map((post) => ({ post }))); protected request = (requestOpts: RequestOpts): Observable => this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( @@ -132,11 +126,14 @@ export class BaseAPI { * Create a shallow clone of `this` by constructing a new instance * and then shallow cloning data members. */ - private clone = (): T => + private clone = (): BaseAPI => Object.assign(Object.create(Object.getPrototypeOf(this)), this); } -// export for not being a breaking change +/** + * @deprecated + * export for not being a breaking change + */ export class RequiredError extends Error { name: 'RequiredError' = 'RequiredError'; } @@ -153,7 +150,6 @@ export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HttpHeaders = { [key: string]: string }; export type HttpQuery = Partial<{ [key: string]: string | number | null | boolean | Array }>; // partial is needed for strict mode export type HttpBody = Json | FormData; -export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export interface RequestOpts { path: string; @@ -178,12 +174,21 @@ const queryString = (params: HttpQuery): string => Object.keys(params) // alias fallback for not being a breaking change export const querystring = queryString; +/** + * @deprecated + */ export const throwIfRequired = (params: {[key: string]: any}, key: string, nickname: string) => { - if (!params || params[key] === null || params[key] === undefined) { + if (!params || params[key] == null) { throw new RequiredError(`Required parameter ${key} was null or undefined when calling ${nickname}.`); } }; +export const throwIfNullOrUndefined = (value: any, nickname?: string) => { + if (value == null) { + throw new Error(`Parameter "${value}" was null or undefined when calling "${nickname}".`); + } +}; + // alias for easier importing export interface RequestArgs extends AjaxRequest {} export interface ResponseArgs extends AjaxResponse {} diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/PetApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/PetApi.ts index a5328a8c728..3b3232c44db 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/PetApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/PetApi.ts @@ -12,7 +12,7 @@ */ import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, HttpQuery, throwIfRequired, encodeURI, COLLECTION_FORMATS } from '../runtime'; +import { BaseAPI, HttpHeaders, HttpQuery, throwIfNullOrUndefined, encodeURI, COLLECTION_FORMATS } from '../runtime'; import { ApiResponse, Pet, @@ -63,45 +63,47 @@ export class PetApi extends BaseAPI { /** * Add a new pet to the store */ - addPet = (requestParameters: AddPetRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'addPet'); + addPet = ({ body }: AddPetRequest): Observable => { + throwIfNullOrUndefined(body, 'addPet'); const headers: HttpHeaders = { 'Content-Type': 'application/json', // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; return this.request({ path: '/pet', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; /** * Deletes a pet */ - deletePet = (requestParameters: DeletePetRequest): Observable => { - throwIfRequired(requestParameters, 'petId', 'deletePet'); + deletePet = ({ petId, apiKey }: DeletePetRequest): Observable => { + throwIfNullOrUndefined(petId, 'deletePet'); const headers: HttpHeaders = { - ...(requestParameters.apiKey && { 'api_key': String(requestParameters.apiKey) }), + ...(apiKey != null ? { 'api_key': String(apiKey) } : undefined), // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; return this.request({ - path: '/pet/{petId}'.replace('{petId}', encodeURI(requestParameters.petId)), + path: '/pet/{petId}'.replace('{petId}', encodeURI(petId)), method: 'DELETE', headers, }); @@ -111,20 +113,21 @@ export class PetApi extends BaseAPI { * Multiple status values can be provided with comma separated strings * Finds Pets by status */ - findPetsByStatus = (requestParameters: FindPetsByStatusRequest): Observable> => { - throwIfRequired(requestParameters, 'status', 'findPetsByStatus'); + findPetsByStatus = ({ status }: FindPetsByStatusRequest): Observable> => { + throwIfNullOrUndefined(status, 'findPetsByStatus'); const headers: HttpHeaders = { // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; - const query: HttpQuery = { - ...(requestParameters.status && { 'status': requestParameters.status.join(COLLECTION_FORMATS['csv']) }), + const query: HttpQuery = { // required parameters are used directly since they are already checked by throwIfNullOrUndefined + 'status': status.join(COLLECTION_FORMATS['csv']), }; return this.request>({ @@ -139,20 +142,21 @@ export class PetApi extends BaseAPI { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * Finds Pets by tags */ - findPetsByTags = (requestParameters: FindPetsByTagsRequest): Observable> => { - throwIfRequired(requestParameters, 'tags', 'findPetsByTags'); + findPetsByTags = ({ tags }: FindPetsByTagsRequest): Observable> => { + throwIfNullOrUndefined(tags, 'findPetsByTags'); const headers: HttpHeaders = { // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; - const query: HttpQuery = { - ...(requestParameters.tags && { 'tags': requestParameters.tags.join(COLLECTION_FORMATS['csv']) }), + const query: HttpQuery = { // required parameters are used directly since they are already checked by throwIfNullOrUndefined + 'tags': tags.join(COLLECTION_FORMATS['csv']), }; return this.request>({ @@ -167,15 +171,15 @@ export class PetApi extends BaseAPI { * Returns a single pet * Find pet by ID */ - getPetById = (requestParameters: GetPetByIdRequest): Observable => { - throwIfRequired(requestParameters, 'petId', 'getPetById'); + getPetById = ({ petId }: GetPetByIdRequest): Observable => { + throwIfNullOrUndefined(petId, 'getPetById'); const headers: HttpHeaders = { ...(this.configuration.apiKey && { 'api_key': this.configuration.apiKey('api_key') }), // api_key authentication }; return this.request({ - path: '/pet/{petId}'.replace('{petId}', encodeURI(requestParameters.petId)), + path: '/pet/{petId}'.replace('{petId}', encodeURI(petId)), method: 'GET', headers, }); @@ -184,53 +188,50 @@ export class PetApi extends BaseAPI { /** * Update an existing pet */ - updatePet = (requestParameters: UpdatePetRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'updatePet'); + updatePet = ({ body }: UpdatePetRequest): Observable => { + throwIfNullOrUndefined(body, 'updatePet'); const headers: HttpHeaders = { 'Content-Type': 'application/json', // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; return this.request({ path: '/pet', method: 'PUT', headers, - body: requestParameters.body, + body: body, }); }; /** * Updates a pet in the store with form data */ - updatePetWithForm = (requestParameters: UpdatePetWithFormRequest): Observable => { - throwIfRequired(requestParameters, 'petId', 'updatePetWithForm'); + updatePetWithForm = ({ petId, name, status }: UpdatePetWithFormRequest): Observable => { + throwIfNullOrUndefined(petId, 'updatePetWithForm'); const headers: HttpHeaders = { // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; const formData = new FormData(); - if (requestParameters.name !== undefined) { - formData.append('name', requestParameters.name as any); - } - - if (requestParameters.status !== undefined) { - formData.append('status', requestParameters.status as any); - } + if (name !== undefined) { formData.append('name', name as any); } + if (status !== undefined) { formData.append('status', status as any); } return this.request({ - path: '/pet/{petId}'.replace('{petId}', encodeURI(requestParameters.petId)), + path: '/pet/{petId}'.replace('{petId}', encodeURI(petId)), method: 'POST', headers, body: formData, @@ -240,29 +241,25 @@ export class PetApi extends BaseAPI { /** * uploads an image */ - uploadFile = (requestParameters: UploadFileRequest): Observable => { - throwIfRequired(requestParameters, 'petId', 'uploadFile'); + uploadFile = ({ petId, additionalMetadata, file }: UploadFileRequest): Observable => { + throwIfNullOrUndefined(petId, 'uploadFile'); const headers: HttpHeaders = { // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; const formData = new FormData(); - if (requestParameters.additionalMetadata !== undefined) { - formData.append('additionalMetadata', requestParameters.additionalMetadata as any); - } - - if (requestParameters.file !== undefined) { - formData.append('file', requestParameters.file as any); - } + if (additionalMetadata !== undefined) { formData.append('additionalMetadata', additionalMetadata as any); } + if (file !== undefined) { formData.append('file', file as any); } return this.request({ - path: '/pet/{petId}/uploadImage'.replace('{petId}', encodeURI(requestParameters.petId)), + path: '/pet/{petId}/uploadImage'.replace('{petId}', encodeURI(petId)), method: 'POST', headers, body: formData, diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/StoreApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/StoreApi.ts index 623b48bdede..aac36206d60 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/StoreApi.ts @@ -12,7 +12,7 @@ */ import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, throwIfRequired, encodeURI } from '../runtime'; +import { BaseAPI, HttpHeaders, throwIfNullOrUndefined, encodeURI } from '../runtime'; import { Order, } from '../models'; @@ -38,11 +38,11 @@ export class StoreApi extends BaseAPI { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * Delete purchase order by ID */ - deleteOrder = (requestParameters: DeleteOrderRequest): Observable => { - throwIfRequired(requestParameters, 'orderId', 'deleteOrder'); + deleteOrder = ({ orderId }: DeleteOrderRequest): Observable => { + throwIfNullOrUndefined(orderId, 'deleteOrder'); return this.request({ - path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(requestParameters.orderId)), + path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(orderId)), method: 'DELETE', }); }; @@ -67,11 +67,11 @@ export class StoreApi extends BaseAPI { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * Find purchase order by ID */ - getOrderById = (requestParameters: GetOrderByIdRequest): Observable => { - throwIfRequired(requestParameters, 'orderId', 'getOrderById'); + getOrderById = ({ orderId }: GetOrderByIdRequest): Observable => { + throwIfNullOrUndefined(orderId, 'getOrderById'); return this.request({ - path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(requestParameters.orderId)), + path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(orderId)), method: 'GET', }); }; @@ -79,8 +79,8 @@ export class StoreApi extends BaseAPI { /** * Place an order for a pet */ - placeOrder = (requestParameters: PlaceOrderRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'placeOrder'); + placeOrder = ({ body }: PlaceOrderRequest): Observable => { + throwIfNullOrUndefined(body, 'placeOrder'); const headers: HttpHeaders = { 'Content-Type': 'application/json', @@ -90,7 +90,7 @@ export class StoreApi extends BaseAPI { path: '/store/order', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/UserApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/UserApi.ts index 2194fdfe9f6..1b3c07eea4f 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/UserApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/apis/UserApi.ts @@ -12,7 +12,7 @@ */ import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, HttpQuery, throwIfRequired, encodeURI } from '../runtime'; +import { BaseAPI, HttpHeaders, HttpQuery, throwIfNullOrUndefined, encodeURI } from '../runtime'; import { User, } from '../models'; @@ -56,8 +56,8 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * Create user */ - createUser = (requestParameters: CreateUserRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'createUser'); + createUser = ({ body }: CreateUserRequest): Observable => { + throwIfNullOrUndefined(body, 'createUser'); const headers: HttpHeaders = { 'Content-Type': 'application/json', @@ -67,15 +67,15 @@ export class UserApi extends BaseAPI { path: '/user', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; /** * Creates list of users with given input array */ - createUsersWithArrayInput = (requestParameters: CreateUsersWithArrayInputRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'createUsersWithArrayInput'); + createUsersWithArrayInput = ({ body }: CreateUsersWithArrayInputRequest): Observable => { + throwIfNullOrUndefined(body, 'createUsersWithArrayInput'); const headers: HttpHeaders = { 'Content-Type': 'application/json', @@ -85,15 +85,15 @@ export class UserApi extends BaseAPI { path: '/user/createWithArray', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; /** * Creates list of users with given input array */ - createUsersWithListInput = (requestParameters: CreateUsersWithListInputRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'createUsersWithListInput'); + createUsersWithListInput = ({ body }: CreateUsersWithListInputRequest): Observable => { + throwIfNullOrUndefined(body, 'createUsersWithListInput'); const headers: HttpHeaders = { 'Content-Type': 'application/json', @@ -103,7 +103,7 @@ export class UserApi extends BaseAPI { path: '/user/createWithList', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; @@ -111,11 +111,11 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * Delete user */ - deleteUser = (requestParameters: DeleteUserRequest): Observable => { - throwIfRequired(requestParameters, 'username', 'deleteUser'); + deleteUser = ({ username }: DeleteUserRequest): Observable => { + throwIfNullOrUndefined(username, 'deleteUser'); return this.request({ - path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), + path: '/user/{username}'.replace('{username}', encodeURI(username)), method: 'DELETE', }); }; @@ -123,11 +123,11 @@ export class UserApi extends BaseAPI { /** * Get user by user name */ - getUserByName = (requestParameters: GetUserByNameRequest): Observable => { - throwIfRequired(requestParameters, 'username', 'getUserByName'); + getUserByName = ({ username }: GetUserByNameRequest): Observable => { + throwIfNullOrUndefined(username, 'getUserByName'); return this.request({ - path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), + path: '/user/{username}'.replace('{username}', encodeURI(username)), method: 'GET', }); }; @@ -135,13 +135,13 @@ export class UserApi extends BaseAPI { /** * Logs user into the system */ - loginUser = (requestParameters: LoginUserRequest): Observable => { - throwIfRequired(requestParameters, 'username', 'loginUser'); - throwIfRequired(requestParameters, 'password', 'loginUser'); + loginUser = ({ username, password }: LoginUserRequest): Observable => { + throwIfNullOrUndefined(username, 'loginUser'); + throwIfNullOrUndefined(password, 'loginUser'); - const query: HttpQuery = { - ...(requestParameters.username && { 'username': requestParameters.username }), - ...(requestParameters.password && { 'password': requestParameters.password }), + const query: HttpQuery = { // required parameters are used directly since they are already checked by throwIfNullOrUndefined + 'username': username, + 'password': password, }; return this.request({ @@ -165,19 +165,19 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * Updated user */ - updateUser = (requestParameters: UpdateUserRequest): Observable => { - throwIfRequired(requestParameters, 'username', 'updateUser'); - throwIfRequired(requestParameters, 'body', 'updateUser'); + updateUser = ({ username, body }: UpdateUserRequest): Observable => { + throwIfNullOrUndefined(username, 'updateUser'); + throwIfNullOrUndefined(body, 'updateUser'); const headers: HttpHeaders = { 'Content-Type': 'application/json', }; return this.request({ - path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), + path: '/user/{username}'.replace('{username}', encodeURI(username)), method: 'PUT', headers, - body: requestParameters.body, + body: body, }); }; diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts index e71a012b04b..40d2e7b3947 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts @@ -47,18 +47,12 @@ export class Configuration { get apiKey(): ((name: string) => string) | undefined { const apiKey = this.configuration.apiKey; - if (apiKey) { - return typeof apiKey === 'function' ? apiKey : () => apiKey; - } - return undefined; + return apiKey && (typeof apiKey === 'function' ? apiKey : () => apiKey); } get accessToken(): ((name: string, scopes?: string[]) => string) | undefined { const accessToken = this.configuration.accessToken; - if (accessToken) { - return typeof accessToken === 'function' ? accessToken : () => accessToken; - } - return undefined; + return accessToken && (typeof accessToken === 'function' ? accessToken : () => accessToken); } } @@ -72,17 +66,17 @@ export class BaseAPI { this.middleware = configuration.middleware; } - withMiddleware = (middlewares: Middleware[]) => { - const next = this.clone(); + withMiddleware = (middlewares: Middleware[]) => { + const next = this.clone(); next.middleware = next.middleware.concat(middlewares); return next; }; - withPreMiddleware = (preMiddlewares: Array) => - this.withMiddleware(preMiddlewares.map((pre) => ({ pre }))); + withPreMiddleware = (preMiddlewares: Array) => + this.withMiddleware(preMiddlewares.map((pre) => ({ pre }))); - withPostMiddleware = (postMiddlewares: Array) => - this.withMiddleware(postMiddlewares.map((post) => ({ post }))); + withPostMiddleware = (postMiddlewares: Array) => + this.withMiddleware(postMiddlewares.map((post) => ({ post }))); protected request = (requestOpts: RequestOpts): Observable => this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( @@ -132,11 +126,14 @@ export class BaseAPI { * Create a shallow clone of `this` by constructing a new instance * and then shallow cloning data members. */ - private clone = (): T => + private clone = (): BaseAPI => Object.assign(Object.create(Object.getPrototypeOf(this)), this); } -// export for not being a breaking change +/** + * @deprecated + * export for not being a breaking change + */ export class RequiredError extends Error { name: 'RequiredError' = 'RequiredError'; } @@ -153,7 +150,6 @@ export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HttpHeaders = { [key: string]: string }; export type HttpQuery = Partial<{ [key: string]: string | number | null | boolean | Array }>; // partial is needed for strict mode export type HttpBody = Json | FormData; -export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export interface RequestOpts { path: string; @@ -178,12 +174,21 @@ const queryString = (params: HttpQuery): string => Object.keys(params) // alias fallback for not being a breaking change export const querystring = queryString; +/** + * @deprecated + */ export const throwIfRequired = (params: {[key: string]: any}, key: string, nickname: string) => { - if (!params || params[key] === null || params[key] === undefined) { + if (!params || params[key] == null) { throw new RequiredError(`Required parameter ${key} was null or undefined when calling ${nickname}.`); } }; +export const throwIfNullOrUndefined = (value: any, nickname?: string) => { + if (value == null) { + throw new Error(`Parameter "${value}" was null or undefined when calling "${nickname}".`); + } +}; + // alias for easier importing export interface RequestArgs extends AjaxRequest {} export interface ResponseArgs extends AjaxResponse {} diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/PetApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/PetApi.ts index a5328a8c728..3b3232c44db 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/PetApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/PetApi.ts @@ -12,7 +12,7 @@ */ import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, HttpQuery, throwIfRequired, encodeURI, COLLECTION_FORMATS } from '../runtime'; +import { BaseAPI, HttpHeaders, HttpQuery, throwIfNullOrUndefined, encodeURI, COLLECTION_FORMATS } from '../runtime'; import { ApiResponse, Pet, @@ -63,45 +63,47 @@ export class PetApi extends BaseAPI { /** * Add a new pet to the store */ - addPet = (requestParameters: AddPetRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'addPet'); + addPet = ({ body }: AddPetRequest): Observable => { + throwIfNullOrUndefined(body, 'addPet'); const headers: HttpHeaders = { 'Content-Type': 'application/json', // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; return this.request({ path: '/pet', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; /** * Deletes a pet */ - deletePet = (requestParameters: DeletePetRequest): Observable => { - throwIfRequired(requestParameters, 'petId', 'deletePet'); + deletePet = ({ petId, apiKey }: DeletePetRequest): Observable => { + throwIfNullOrUndefined(petId, 'deletePet'); const headers: HttpHeaders = { - ...(requestParameters.apiKey && { 'api_key': String(requestParameters.apiKey) }), + ...(apiKey != null ? { 'api_key': String(apiKey) } : undefined), // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; return this.request({ - path: '/pet/{petId}'.replace('{petId}', encodeURI(requestParameters.petId)), + path: '/pet/{petId}'.replace('{petId}', encodeURI(petId)), method: 'DELETE', headers, }); @@ -111,20 +113,21 @@ export class PetApi extends BaseAPI { * Multiple status values can be provided with comma separated strings * Finds Pets by status */ - findPetsByStatus = (requestParameters: FindPetsByStatusRequest): Observable> => { - throwIfRequired(requestParameters, 'status', 'findPetsByStatus'); + findPetsByStatus = ({ status }: FindPetsByStatusRequest): Observable> => { + throwIfNullOrUndefined(status, 'findPetsByStatus'); const headers: HttpHeaders = { // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; - const query: HttpQuery = { - ...(requestParameters.status && { 'status': requestParameters.status.join(COLLECTION_FORMATS['csv']) }), + const query: HttpQuery = { // required parameters are used directly since they are already checked by throwIfNullOrUndefined + 'status': status.join(COLLECTION_FORMATS['csv']), }; return this.request>({ @@ -139,20 +142,21 @@ export class PetApi extends BaseAPI { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * Finds Pets by tags */ - findPetsByTags = (requestParameters: FindPetsByTagsRequest): Observable> => { - throwIfRequired(requestParameters, 'tags', 'findPetsByTags'); + findPetsByTags = ({ tags }: FindPetsByTagsRequest): Observable> => { + throwIfNullOrUndefined(tags, 'findPetsByTags'); const headers: HttpHeaders = { // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; - const query: HttpQuery = { - ...(requestParameters.tags && { 'tags': requestParameters.tags.join(COLLECTION_FORMATS['csv']) }), + const query: HttpQuery = { // required parameters are used directly since they are already checked by throwIfNullOrUndefined + 'tags': tags.join(COLLECTION_FORMATS['csv']), }; return this.request>({ @@ -167,15 +171,15 @@ export class PetApi extends BaseAPI { * Returns a single pet * Find pet by ID */ - getPetById = (requestParameters: GetPetByIdRequest): Observable => { - throwIfRequired(requestParameters, 'petId', 'getPetById'); + getPetById = ({ petId }: GetPetByIdRequest): Observable => { + throwIfNullOrUndefined(petId, 'getPetById'); const headers: HttpHeaders = { ...(this.configuration.apiKey && { 'api_key': this.configuration.apiKey('api_key') }), // api_key authentication }; return this.request({ - path: '/pet/{petId}'.replace('{petId}', encodeURI(requestParameters.petId)), + path: '/pet/{petId}'.replace('{petId}', encodeURI(petId)), method: 'GET', headers, }); @@ -184,53 +188,50 @@ export class PetApi extends BaseAPI { /** * Update an existing pet */ - updatePet = (requestParameters: UpdatePetRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'updatePet'); + updatePet = ({ body }: UpdatePetRequest): Observable => { + throwIfNullOrUndefined(body, 'updatePet'); const headers: HttpHeaders = { 'Content-Type': 'application/json', // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; return this.request({ path: '/pet', method: 'PUT', headers, - body: requestParameters.body, + body: body, }); }; /** * Updates a pet in the store with form data */ - updatePetWithForm = (requestParameters: UpdatePetWithFormRequest): Observable => { - throwIfRequired(requestParameters, 'petId', 'updatePetWithForm'); + updatePetWithForm = ({ petId, name, status }: UpdatePetWithFormRequest): Observable => { + throwIfNullOrUndefined(petId, 'updatePetWithForm'); const headers: HttpHeaders = { // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; const formData = new FormData(); - if (requestParameters.name !== undefined) { - formData.append('name', requestParameters.name as any); - } - - if (requestParameters.status !== undefined) { - formData.append('status', requestParameters.status as any); - } + if (name !== undefined) { formData.append('name', name as any); } + if (status !== undefined) { formData.append('status', status as any); } return this.request({ - path: '/pet/{petId}'.replace('{petId}', encodeURI(requestParameters.petId)), + path: '/pet/{petId}'.replace('{petId}', encodeURI(petId)), method: 'POST', headers, body: formData, @@ -240,29 +241,25 @@ export class PetApi extends BaseAPI { /** * uploads an image */ - uploadFile = (requestParameters: UploadFileRequest): Observable => { - throwIfRequired(requestParameters, 'petId', 'uploadFile'); + uploadFile = ({ petId, additionalMetadata, file }: UploadFileRequest): Observable => { + throwIfNullOrUndefined(petId, 'uploadFile'); const headers: HttpHeaders = { // oauth required - ...(this.configuration.accessToken && { - Authorization: this.configuration.accessToken && (typeof this.configuration.accessToken === 'function' + ...(this.configuration.accessToken != null + ? { Authorization: typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken('petstore_auth', ['write:pets', 'read:pets']) - : this.configuration.accessToken) - }), + : this.configuration.accessToken } + : undefined + ), }; const formData = new FormData(); - if (requestParameters.additionalMetadata !== undefined) { - formData.append('additionalMetadata', requestParameters.additionalMetadata as any); - } - - if (requestParameters.file !== undefined) { - formData.append('file', requestParameters.file as any); - } + if (additionalMetadata !== undefined) { formData.append('additionalMetadata', additionalMetadata as any); } + if (file !== undefined) { formData.append('file', file as any); } return this.request({ - path: '/pet/{petId}/uploadImage'.replace('{petId}', encodeURI(requestParameters.petId)), + path: '/pet/{petId}/uploadImage'.replace('{petId}', encodeURI(petId)), method: 'POST', headers, body: formData, diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/StoreApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/StoreApi.ts index 623b48bdede..aac36206d60 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/StoreApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/StoreApi.ts @@ -12,7 +12,7 @@ */ import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, throwIfRequired, encodeURI } from '../runtime'; +import { BaseAPI, HttpHeaders, throwIfNullOrUndefined, encodeURI } from '../runtime'; import { Order, } from '../models'; @@ -38,11 +38,11 @@ export class StoreApi extends BaseAPI { * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * Delete purchase order by ID */ - deleteOrder = (requestParameters: DeleteOrderRequest): Observable => { - throwIfRequired(requestParameters, 'orderId', 'deleteOrder'); + deleteOrder = ({ orderId }: DeleteOrderRequest): Observable => { + throwIfNullOrUndefined(orderId, 'deleteOrder'); return this.request({ - path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(requestParameters.orderId)), + path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(orderId)), method: 'DELETE', }); }; @@ -67,11 +67,11 @@ export class StoreApi extends BaseAPI { * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * Find purchase order by ID */ - getOrderById = (requestParameters: GetOrderByIdRequest): Observable => { - throwIfRequired(requestParameters, 'orderId', 'getOrderById'); + getOrderById = ({ orderId }: GetOrderByIdRequest): Observable => { + throwIfNullOrUndefined(orderId, 'getOrderById'); return this.request({ - path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(requestParameters.orderId)), + path: '/store/order/{orderId}'.replace('{orderId}', encodeURI(orderId)), method: 'GET', }); }; @@ -79,8 +79,8 @@ export class StoreApi extends BaseAPI { /** * Place an order for a pet */ - placeOrder = (requestParameters: PlaceOrderRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'placeOrder'); + placeOrder = ({ body }: PlaceOrderRequest): Observable => { + throwIfNullOrUndefined(body, 'placeOrder'); const headers: HttpHeaders = { 'Content-Type': 'application/json', @@ -90,7 +90,7 @@ export class StoreApi extends BaseAPI { path: '/store/order', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/UserApi.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/UserApi.ts index 2194fdfe9f6..1b3c07eea4f 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/UserApi.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/apis/UserApi.ts @@ -12,7 +12,7 @@ */ import { Observable } from 'rxjs'; -import { BaseAPI, HttpHeaders, HttpQuery, throwIfRequired, encodeURI } from '../runtime'; +import { BaseAPI, HttpHeaders, HttpQuery, throwIfNullOrUndefined, encodeURI } from '../runtime'; import { User, } from '../models'; @@ -56,8 +56,8 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * Create user */ - createUser = (requestParameters: CreateUserRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'createUser'); + createUser = ({ body }: CreateUserRequest): Observable => { + throwIfNullOrUndefined(body, 'createUser'); const headers: HttpHeaders = { 'Content-Type': 'application/json', @@ -67,15 +67,15 @@ export class UserApi extends BaseAPI { path: '/user', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; /** * Creates list of users with given input array */ - createUsersWithArrayInput = (requestParameters: CreateUsersWithArrayInputRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'createUsersWithArrayInput'); + createUsersWithArrayInput = ({ body }: CreateUsersWithArrayInputRequest): Observable => { + throwIfNullOrUndefined(body, 'createUsersWithArrayInput'); const headers: HttpHeaders = { 'Content-Type': 'application/json', @@ -85,15 +85,15 @@ export class UserApi extends BaseAPI { path: '/user/createWithArray', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; /** * Creates list of users with given input array */ - createUsersWithListInput = (requestParameters: CreateUsersWithListInputRequest): Observable => { - throwIfRequired(requestParameters, 'body', 'createUsersWithListInput'); + createUsersWithListInput = ({ body }: CreateUsersWithListInputRequest): Observable => { + throwIfNullOrUndefined(body, 'createUsersWithListInput'); const headers: HttpHeaders = { 'Content-Type': 'application/json', @@ -103,7 +103,7 @@ export class UserApi extends BaseAPI { path: '/user/createWithList', method: 'POST', headers, - body: requestParameters.body, + body: body, }); }; @@ -111,11 +111,11 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * Delete user */ - deleteUser = (requestParameters: DeleteUserRequest): Observable => { - throwIfRequired(requestParameters, 'username', 'deleteUser'); + deleteUser = ({ username }: DeleteUserRequest): Observable => { + throwIfNullOrUndefined(username, 'deleteUser'); return this.request({ - path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), + path: '/user/{username}'.replace('{username}', encodeURI(username)), method: 'DELETE', }); }; @@ -123,11 +123,11 @@ export class UserApi extends BaseAPI { /** * Get user by user name */ - getUserByName = (requestParameters: GetUserByNameRequest): Observable => { - throwIfRequired(requestParameters, 'username', 'getUserByName'); + getUserByName = ({ username }: GetUserByNameRequest): Observable => { + throwIfNullOrUndefined(username, 'getUserByName'); return this.request({ - path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), + path: '/user/{username}'.replace('{username}', encodeURI(username)), method: 'GET', }); }; @@ -135,13 +135,13 @@ export class UserApi extends BaseAPI { /** * Logs user into the system */ - loginUser = (requestParameters: LoginUserRequest): Observable => { - throwIfRequired(requestParameters, 'username', 'loginUser'); - throwIfRequired(requestParameters, 'password', 'loginUser'); + loginUser = ({ username, password }: LoginUserRequest): Observable => { + throwIfNullOrUndefined(username, 'loginUser'); + throwIfNullOrUndefined(password, 'loginUser'); - const query: HttpQuery = { - ...(requestParameters.username && { 'username': requestParameters.username }), - ...(requestParameters.password && { 'password': requestParameters.password }), + const query: HttpQuery = { // required parameters are used directly since they are already checked by throwIfNullOrUndefined + 'username': username, + 'password': password, }; return this.request({ @@ -165,19 +165,19 @@ export class UserApi extends BaseAPI { * This can only be done by the logged in user. * Updated user */ - updateUser = (requestParameters: UpdateUserRequest): Observable => { - throwIfRequired(requestParameters, 'username', 'updateUser'); - throwIfRequired(requestParameters, 'body', 'updateUser'); + updateUser = ({ username, body }: UpdateUserRequest): Observable => { + throwIfNullOrUndefined(username, 'updateUser'); + throwIfNullOrUndefined(body, 'updateUser'); const headers: HttpHeaders = { 'Content-Type': 'application/json', }; return this.request({ - path: '/user/{username}'.replace('{username}', encodeURI(requestParameters.username)), + path: '/user/{username}'.replace('{username}', encodeURI(username)), method: 'PUT', headers, - body: requestParameters.body, + body: body, }); }; diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts index e71a012b04b..40d2e7b3947 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts @@ -47,18 +47,12 @@ export class Configuration { get apiKey(): ((name: string) => string) | undefined { const apiKey = this.configuration.apiKey; - if (apiKey) { - return typeof apiKey === 'function' ? apiKey : () => apiKey; - } - return undefined; + return apiKey && (typeof apiKey === 'function' ? apiKey : () => apiKey); } get accessToken(): ((name: string, scopes?: string[]) => string) | undefined { const accessToken = this.configuration.accessToken; - if (accessToken) { - return typeof accessToken === 'function' ? accessToken : () => accessToken; - } - return undefined; + return accessToken && (typeof accessToken === 'function' ? accessToken : () => accessToken); } } @@ -72,17 +66,17 @@ export class BaseAPI { this.middleware = configuration.middleware; } - withMiddleware = (middlewares: Middleware[]) => { - const next = this.clone(); + withMiddleware = (middlewares: Middleware[]) => { + const next = this.clone(); next.middleware = next.middleware.concat(middlewares); return next; }; - withPreMiddleware = (preMiddlewares: Array) => - this.withMiddleware(preMiddlewares.map((pre) => ({ pre }))); + withPreMiddleware = (preMiddlewares: Array) => + this.withMiddleware(preMiddlewares.map((pre) => ({ pre }))); - withPostMiddleware = (postMiddlewares: Array) => - this.withMiddleware(postMiddlewares.map((post) => ({ post }))); + withPostMiddleware = (postMiddlewares: Array) => + this.withMiddleware(postMiddlewares.map((post) => ({ post }))); protected request = (requestOpts: RequestOpts): Observable => this.rxjsRequest(this.createRequestArgs(requestOpts)).pipe( @@ -132,11 +126,14 @@ export class BaseAPI { * Create a shallow clone of `this` by constructing a new instance * and then shallow cloning data members. */ - private clone = (): T => + private clone = (): BaseAPI => Object.assign(Object.create(Object.getPrototypeOf(this)), this); } -// export for not being a breaking change +/** + * @deprecated + * export for not being a breaking change + */ export class RequiredError extends Error { name: 'RequiredError' = 'RequiredError'; } @@ -153,7 +150,6 @@ export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' export type HttpHeaders = { [key: string]: string }; export type HttpQuery = Partial<{ [key: string]: string | number | null | boolean | Array }>; // partial is needed for strict mode export type HttpBody = Json | FormData; -export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; export interface RequestOpts { path: string; @@ -178,12 +174,21 @@ const queryString = (params: HttpQuery): string => Object.keys(params) // alias fallback for not being a breaking change export const querystring = queryString; +/** + * @deprecated + */ export const throwIfRequired = (params: {[key: string]: any}, key: string, nickname: string) => { - if (!params || params[key] === null || params[key] === undefined) { + if (!params || params[key] == null) { throw new RequiredError(`Required parameter ${key} was null or undefined when calling ${nickname}.`); } }; +export const throwIfNullOrUndefined = (value: any, nickname?: string) => { + if (value == null) { + throw new Error(`Parameter "${value}" was null or undefined when calling "${nickname}".`); + } +}; + // alias for easier importing export interface RequestArgs extends AjaxRequest {} export interface ResponseArgs extends AjaxResponse {} From 19a5f1248e2edf40407afabbeea4361df9300edd Mon Sep 17 00:00:00 2001 From: Marcin Stefaniuk Date: Mon, 27 Jan 2020 09:40:28 +0100 Subject: [PATCH 35/85] Typescript Axios returned types and export paths fixed (#5102) * Typescript Axiom templates fixed Templates fixed to have `withInterfaces` and `withSeparateModelsAndApi` options working combined. * Added petstore generated samples for typescript-axios * Fixing line endings * Remove unnecessary change in function signature Co-Authored-By: Esteban Gehring * re-generate typescript-axios samples Co-authored-by: Esteban Gehring --- .../resources/typescript-axios/api.mustache | 2 +- .../typescript-axios/apiInner.mustache | 6 +- .../typescript-axios/builds/default/api.ts | 40 ++++++------ .../typescript-axios/builds/es6-target/api.ts | 40 ++++++------ .../builds/with-complex-headers/api.ts | 40 ++++++------ .../builds/with-interfaces/api.ts | 62 +++++++++---------- .../api.ts | 6 +- .../api/another/level/pet-api.ts | 16 ++--- .../api/another/level/store-api.ts | 8 +-- .../api/another/level/user-api.ts | 16 ++--- .../builds/with-npm-version/api.ts | 40 ++++++------ 11 files changed, 138 insertions(+), 138 deletions(-) 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 de8ce193d87..d209bdae09f 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache @@ -16,6 +16,6 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } fr {{>apiInner}} {{/apis}}{{/apiInfo}} {{/withSeparateModelsAndApi}}{{#withSeparateModelsAndApi}} -{{#apiInfo}}{{#apis}}{{#operations}}export * from './{{apiPackage}}/{{classFilename}}'; +{{#apiInfo}}{{#apis}}{{#operations}}export * from './{{tsApiPackage}}/{{classFilename}}'; {{/operations}}{{/apis}}{{/apiInfo}} {{/withSeparateModelsAndApi}} diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache index deaeb9319ec..167ac840849 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -78,7 +78,7 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur {{#isBasicBasic}} // http basic authentication required if (configuration && (configuration.username || configuration.password)) { - localVarRequestOptions["auth"] = { username: configuration.username, password: configuration.password }; + localVarRequestOptions["auth"] = { username: configuration.username, password: configuration.password }; } {{/isBasicBasic}} {{#isBasicBearer}} @@ -256,7 +256,7 @@ export const {{classname}}Factory = function (configuration?: Configuration, bas * @param {*} [options] Override http request option. * @throws {RequiredError} */ - {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any) { + {{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)(axios, basePath); }, {{/operation}} @@ -284,7 +284,7 @@ export interface {{classname}}Interface { * @throws {RequiredError} * @memberof {{classname}}Interface */ - {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): AxiosPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}>; + {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): AxiosPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}>; {{/operation}} } diff --git a/samples/client/petstore/typescript-axios/builds/default/api.ts b/samples/client/petstore/typescript-axios/builds/default/api.ts index 2680cf57f47..8785e2e2ccf 100644 --- a/samples/client/petstore/typescript-axios/builds/default/api.ts +++ b/samples/client/petstore/typescript-axios/builds/default/api.ts @@ -790,7 +790,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any) { + addPet(body: Pet, options?: any): AxiosPromise { return PetApiFp(configuration).addPet(body, options)(axios, basePath); }, /** @@ -801,7 +801,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any) { + deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { return PetApiFp(configuration).deletePet(petId, apiKey, options)(axios, basePath); }, /** @@ -811,7 +811,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any) { + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): AxiosPromise> { return PetApiFp(configuration).findPetsByStatus(status, options)(axios, basePath); }, /** @@ -821,7 +821,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByTags(tags: Array, options?: any) { + findPetsByTags(tags: Array, options?: any): AxiosPromise> { return PetApiFp(configuration).findPetsByTags(tags, options)(axios, basePath); }, /** @@ -831,7 +831,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPetById(petId: number, options?: any) { + getPetById(petId: number, options?: any): AxiosPromise { return PetApiFp(configuration).getPetById(petId, options)(axios, basePath); }, /** @@ -841,7 +841,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any) { + updatePet(body: Pet, options?: any): AxiosPromise { return PetApiFp(configuration).updatePet(body, options)(axios, basePath); }, /** @@ -853,7 +853,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any) { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { return PetApiFp(configuration).updatePetWithForm(petId, name, status, options)(axios, basePath); }, /** @@ -865,7 +865,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): AxiosPromise { return PetApiFp(configuration).uploadFile(petId, additionalMetadata, file, options)(axios, basePath); }, }; @@ -1213,7 +1213,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any) { + deleteOrder(orderId: string, options?: any): AxiosPromise { return StoreApiFp(configuration).deleteOrder(orderId, options)(axios, basePath); }, /** @@ -1222,7 +1222,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: any) { + getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { return StoreApiFp(configuration).getInventory(options)(axios, basePath); }, /** @@ -1232,7 +1232,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderById(orderId: number, options?: any) { + getOrderById(orderId: number, options?: any): AxiosPromise { return StoreApiFp(configuration).getOrderById(orderId, options)(axios, basePath); }, /** @@ -1242,7 +1242,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - placeOrder(body: Order, options?: any) { + placeOrder(body: Order, options?: any): AxiosPromise { return StoreApiFp(configuration).placeOrder(body, options)(axios, basePath); }, }; @@ -1753,7 +1753,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any) { + createUser(body: User, options?: any): AxiosPromise { return UserApiFp(configuration).createUser(body, options)(axios, basePath); }, /** @@ -1763,7 +1763,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any) { + createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { return UserApiFp(configuration).createUsersWithArrayInput(body, options)(axios, basePath); }, /** @@ -1773,7 +1773,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any) { + createUsersWithListInput(body: Array, options?: any): AxiosPromise { return UserApiFp(configuration).createUsersWithListInput(body, options)(axios, basePath); }, /** @@ -1783,7 +1783,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any) { + deleteUser(username: string, options?: any): AxiosPromise { return UserApiFp(configuration).deleteUser(username, options)(axios, basePath); }, /** @@ -1793,7 +1793,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByName(username: string, options?: any) { + getUserByName(username: string, options?: any): AxiosPromise { return UserApiFp(configuration).getUserByName(username, options)(axios, basePath); }, /** @@ -1804,7 +1804,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginUser(username: string, password: string, options?: any) { + loginUser(username: string, password: string, options?: any): AxiosPromise { return UserApiFp(configuration).loginUser(username, password, options)(axios, basePath); }, /** @@ -1813,7 +1813,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any) { + logoutUser(options?: any): AxiosPromise { return UserApiFp(configuration).logoutUser(options)(axios, basePath); }, /** @@ -1824,7 +1824,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any) { + updateUser(username: string, body: User, options?: any): AxiosPromise { return UserApiFp(configuration).updateUser(username, body, options)(axios, basePath); }, }; 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 2680cf57f47..8785e2e2ccf 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts @@ -790,7 +790,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any) { + addPet(body: Pet, options?: any): AxiosPromise { return PetApiFp(configuration).addPet(body, options)(axios, basePath); }, /** @@ -801,7 +801,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any) { + deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { return PetApiFp(configuration).deletePet(petId, apiKey, options)(axios, basePath); }, /** @@ -811,7 +811,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any) { + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): AxiosPromise> { return PetApiFp(configuration).findPetsByStatus(status, options)(axios, basePath); }, /** @@ -821,7 +821,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByTags(tags: Array, options?: any) { + findPetsByTags(tags: Array, options?: any): AxiosPromise> { return PetApiFp(configuration).findPetsByTags(tags, options)(axios, basePath); }, /** @@ -831,7 +831,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPetById(petId: number, options?: any) { + getPetById(petId: number, options?: any): AxiosPromise { return PetApiFp(configuration).getPetById(petId, options)(axios, basePath); }, /** @@ -841,7 +841,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any) { + updatePet(body: Pet, options?: any): AxiosPromise { return PetApiFp(configuration).updatePet(body, options)(axios, basePath); }, /** @@ -853,7 +853,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any) { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { return PetApiFp(configuration).updatePetWithForm(petId, name, status, options)(axios, basePath); }, /** @@ -865,7 +865,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): AxiosPromise { return PetApiFp(configuration).uploadFile(petId, additionalMetadata, file, options)(axios, basePath); }, }; @@ -1213,7 +1213,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any) { + deleteOrder(orderId: string, options?: any): AxiosPromise { return StoreApiFp(configuration).deleteOrder(orderId, options)(axios, basePath); }, /** @@ -1222,7 +1222,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: any) { + getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { return StoreApiFp(configuration).getInventory(options)(axios, basePath); }, /** @@ -1232,7 +1232,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderById(orderId: number, options?: any) { + getOrderById(orderId: number, options?: any): AxiosPromise { return StoreApiFp(configuration).getOrderById(orderId, options)(axios, basePath); }, /** @@ -1242,7 +1242,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - placeOrder(body: Order, options?: any) { + placeOrder(body: Order, options?: any): AxiosPromise { return StoreApiFp(configuration).placeOrder(body, options)(axios, basePath); }, }; @@ -1753,7 +1753,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any) { + createUser(body: User, options?: any): AxiosPromise { return UserApiFp(configuration).createUser(body, options)(axios, basePath); }, /** @@ -1763,7 +1763,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any) { + createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { return UserApiFp(configuration).createUsersWithArrayInput(body, options)(axios, basePath); }, /** @@ -1773,7 +1773,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any) { + createUsersWithListInput(body: Array, options?: any): AxiosPromise { return UserApiFp(configuration).createUsersWithListInput(body, options)(axios, basePath); }, /** @@ -1783,7 +1783,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any) { + deleteUser(username: string, options?: any): AxiosPromise { return UserApiFp(configuration).deleteUser(username, options)(axios, basePath); }, /** @@ -1793,7 +1793,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByName(username: string, options?: any) { + getUserByName(username: string, options?: any): AxiosPromise { return UserApiFp(configuration).getUserByName(username, options)(axios, basePath); }, /** @@ -1804,7 +1804,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginUser(username: string, password: string, options?: any) { + loginUser(username: string, password: string, options?: any): AxiosPromise { return UserApiFp(configuration).loginUser(username, password, options)(axios, basePath); }, /** @@ -1813,7 +1813,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any) { + logoutUser(options?: any): AxiosPromise { return UserApiFp(configuration).logoutUser(options)(axios, basePath); }, /** @@ -1824,7 +1824,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any) { + updateUser(username: string, body: User, options?: any): AxiosPromise { return UserApiFp(configuration).updateUser(username, body, options)(axios, basePath); }, }; 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 3c08f74d7da..b31f48eef27 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 @@ -843,7 +843,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(pet: Pet, header1?: Pet, header2?: Array, options?: any) { + addPet(pet: Pet, header1?: Pet, header2?: Array, options?: any): AxiosPromise { return PetApiFp(configuration).addPet(pet, header1, header2, options)(axios, basePath); }, /** @@ -854,7 +854,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any) { + deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { return PetApiFp(configuration).deletePet(petId, apiKey, options)(axios, basePath); }, /** @@ -864,7 +864,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any) { + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): AxiosPromise> { return PetApiFp(configuration).findPetsByStatus(status, options)(axios, basePath); }, /** @@ -874,7 +874,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByTags(tags: Array, options?: any) { + findPetsByTags(tags: Array, options?: any): AxiosPromise> { return PetApiFp(configuration).findPetsByTags(tags, options)(axios, basePath); }, /** @@ -884,7 +884,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPetById(petId: number, options?: any) { + getPetById(petId: number, options?: any): AxiosPromise { return PetApiFp(configuration).getPetById(petId, options)(axios, basePath); }, /** @@ -894,7 +894,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(pet: Pet, options?: any) { + updatePet(pet: Pet, options?: any): AxiosPromise { return PetApiFp(configuration).updatePet(pet, options)(axios, basePath); }, /** @@ -906,7 +906,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any) { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { return PetApiFp(configuration).updatePetWithForm(petId, name, status, options)(axios, basePath); }, /** @@ -918,7 +918,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): AxiosPromise { return PetApiFp(configuration).uploadFile(petId, additionalMetadata, file, options)(axios, basePath); }, }; @@ -1268,7 +1268,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any) { + deleteOrder(orderId: string, options?: any): AxiosPromise { return StoreApiFp(configuration).deleteOrder(orderId, options)(axios, basePath); }, /** @@ -1277,7 +1277,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: any) { + getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { return StoreApiFp(configuration).getInventory(options)(axios, basePath); }, /** @@ -1287,7 +1287,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderById(orderId: number, options?: any) { + getOrderById(orderId: number, options?: any): AxiosPromise { return StoreApiFp(configuration).getOrderById(orderId, options)(axios, basePath); }, /** @@ -1297,7 +1297,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - placeOrder(order: Order, options?: any) { + placeOrder(order: Order, options?: any): AxiosPromise { return StoreApiFp(configuration).placeOrder(order, options)(axios, basePath); }, }; @@ -1808,7 +1808,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(user: User, options?: any) { + createUser(user: User, options?: any): AxiosPromise { return UserApiFp(configuration).createUser(user, options)(axios, basePath); }, /** @@ -1818,7 +1818,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(user: Array, options?: any) { + createUsersWithArrayInput(user: Array, options?: any): AxiosPromise { return UserApiFp(configuration).createUsersWithArrayInput(user, options)(axios, basePath); }, /** @@ -1828,7 +1828,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(user: Array, options?: any) { + createUsersWithListInput(user: Array, options?: any): AxiosPromise { return UserApiFp(configuration).createUsersWithListInput(user, options)(axios, basePath); }, /** @@ -1838,7 +1838,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any) { + deleteUser(username: string, options?: any): AxiosPromise { return UserApiFp(configuration).deleteUser(username, options)(axios, basePath); }, /** @@ -1848,7 +1848,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByName(username: string, options?: any) { + getUserByName(username: string, options?: any): AxiosPromise { return UserApiFp(configuration).getUserByName(username, options)(axios, basePath); }, /** @@ -1859,7 +1859,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginUser(username: string, password: string, options?: any) { + loginUser(username: string, password: string, options?: any): AxiosPromise { return UserApiFp(configuration).loginUser(username, password, options)(axios, basePath); }, /** @@ -1868,7 +1868,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any) { + logoutUser(options?: any): AxiosPromise { return UserApiFp(configuration).logoutUser(options)(axios, basePath); }, /** @@ -1879,7 +1879,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, user: User, options?: any) { + updateUser(username: string, user: User, options?: any): AxiosPromise { return UserApiFp(configuration).updateUser(username, user, options)(axios, basePath); }, }; 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 a7777a08a4a..37f4fd36fb9 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts @@ -790,7 +790,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any) { + addPet(body: Pet, options?: any): AxiosPromise { return PetApiFp(configuration).addPet(body, options)(axios, basePath); }, /** @@ -801,7 +801,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any) { + deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { return PetApiFp(configuration).deletePet(petId, apiKey, options)(axios, basePath); }, /** @@ -811,7 +811,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any) { + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): AxiosPromise> { return PetApiFp(configuration).findPetsByStatus(status, options)(axios, basePath); }, /** @@ -821,7 +821,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByTags(tags: Array, options?: any) { + findPetsByTags(tags: Array, options?: any): AxiosPromise> { return PetApiFp(configuration).findPetsByTags(tags, options)(axios, basePath); }, /** @@ -831,7 +831,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPetById(petId: number, options?: any) { + getPetById(petId: number, options?: any): AxiosPromise { return PetApiFp(configuration).getPetById(petId, options)(axios, basePath); }, /** @@ -841,7 +841,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any) { + updatePet(body: Pet, options?: any): AxiosPromise { return PetApiFp(configuration).updatePet(body, options)(axios, basePath); }, /** @@ -853,7 +853,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any) { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { return PetApiFp(configuration).updatePetWithForm(petId, name, status, options)(axios, basePath); }, /** @@ -865,7 +865,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): AxiosPromise { return PetApiFp(configuration).uploadFile(petId, additionalMetadata, file, options)(axios, basePath); }, }; @@ -885,7 +885,7 @@ export interface PetApiInterface { * @throws {RequiredError} * @memberof PetApiInterface */ - addPet(body: Pet, options?: any): AxiosPromise<{}>; + addPet(body: Pet, options?: any): AxiosPromise; /** * @@ -896,7 +896,7 @@ export interface PetApiInterface { * @throws {RequiredError} * @memberof PetApiInterface */ - deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise<{}>; + deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise; /** * Multiple status values can be provided with comma separated strings @@ -936,7 +936,7 @@ export interface PetApiInterface { * @throws {RequiredError} * @memberof PetApiInterface */ - updatePet(body: Pet, options?: any): AxiosPromise<{}>; + updatePet(body: Pet, options?: any): AxiosPromise; /** * @@ -948,7 +948,7 @@ export interface PetApiInterface { * @throws {RequiredError} * @memberof PetApiInterface */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise<{}>; + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise; /** * @@ -1306,7 +1306,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any) { + deleteOrder(orderId: string, options?: any): AxiosPromise { return StoreApiFp(configuration).deleteOrder(orderId, options)(axios, basePath); }, /** @@ -1315,7 +1315,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: any) { + getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { return StoreApiFp(configuration).getInventory(options)(axios, basePath); }, /** @@ -1325,7 +1325,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderById(orderId: number, options?: any) { + getOrderById(orderId: number, options?: any): AxiosPromise { return StoreApiFp(configuration).getOrderById(orderId, options)(axios, basePath); }, /** @@ -1335,7 +1335,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - placeOrder(body: Order, options?: any) { + placeOrder(body: Order, options?: any): AxiosPromise { return StoreApiFp(configuration).placeOrder(body, options)(axios, basePath); }, }; @@ -1355,7 +1355,7 @@ export interface StoreApiInterface { * @throws {RequiredError} * @memberof StoreApiInterface */ - deleteOrder(orderId: string, options?: any): AxiosPromise<{}>; + deleteOrder(orderId: string, options?: any): AxiosPromise; /** * Returns a map of status codes to quantities @@ -1893,7 +1893,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any) { + createUser(body: User, options?: any): AxiosPromise { return UserApiFp(configuration).createUser(body, options)(axios, basePath); }, /** @@ -1903,7 +1903,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any) { + createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { return UserApiFp(configuration).createUsersWithArrayInput(body, options)(axios, basePath); }, /** @@ -1913,7 +1913,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any) { + createUsersWithListInput(body: Array, options?: any): AxiosPromise { return UserApiFp(configuration).createUsersWithListInput(body, options)(axios, basePath); }, /** @@ -1923,7 +1923,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any) { + deleteUser(username: string, options?: any): AxiosPromise { return UserApiFp(configuration).deleteUser(username, options)(axios, basePath); }, /** @@ -1933,7 +1933,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByName(username: string, options?: any) { + getUserByName(username: string, options?: any): AxiosPromise { return UserApiFp(configuration).getUserByName(username, options)(axios, basePath); }, /** @@ -1944,7 +1944,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginUser(username: string, password: string, options?: any) { + loginUser(username: string, password: string, options?: any): AxiosPromise { return UserApiFp(configuration).loginUser(username, password, options)(axios, basePath); }, /** @@ -1953,7 +1953,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any) { + logoutUser(options?: any): AxiosPromise { return UserApiFp(configuration).logoutUser(options)(axios, basePath); }, /** @@ -1964,7 +1964,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any) { + updateUser(username: string, body: User, options?: any): AxiosPromise { return UserApiFp(configuration).updateUser(username, body, options)(axios, basePath); }, }; @@ -1984,7 +1984,7 @@ export interface UserApiInterface { * @throws {RequiredError} * @memberof UserApiInterface */ - createUser(body: User, options?: any): AxiosPromise<{}>; + createUser(body: User, options?: any): AxiosPromise; /** * @@ -1994,7 +1994,7 @@ export interface UserApiInterface { * @throws {RequiredError} * @memberof UserApiInterface */ - createUsersWithArrayInput(body: Array, options?: any): AxiosPromise<{}>; + createUsersWithArrayInput(body: Array, options?: any): AxiosPromise; /** * @@ -2004,7 +2004,7 @@ export interface UserApiInterface { * @throws {RequiredError} * @memberof UserApiInterface */ - createUsersWithListInput(body: Array, options?: any): AxiosPromise<{}>; + createUsersWithListInput(body: Array, options?: any): AxiosPromise; /** * This can only be done by the logged in user. @@ -2014,7 +2014,7 @@ export interface UserApiInterface { * @throws {RequiredError} * @memberof UserApiInterface */ - deleteUser(username: string, options?: any): AxiosPromise<{}>; + deleteUser(username: string, options?: any): AxiosPromise; /** * @@ -2044,7 +2044,7 @@ export interface UserApiInterface { * @throws {RequiredError} * @memberof UserApiInterface */ - logoutUser(options?: any): AxiosPromise<{}>; + logoutUser(options?: any): AxiosPromise; /** * This can only be done by the logged in user. @@ -2055,7 +2055,7 @@ export interface UserApiInterface { * @throws {RequiredError} * @memberof UserApiInterface */ - updateUser(username: string, body: User, options?: any): AxiosPromise<{}>; + updateUser(username: string, body: User, options?: any): AxiosPromise; } diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api.ts index e16c9dd6319..ac5b143e660 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api.ts @@ -13,7 +13,7 @@ -export * from './api.another.level/pet-api'; -export * from './api.another.level/store-api'; -export * from './api.another.level/user-api'; +export * from './api/another/level/pet-api'; +export * from './api/another/level/store-api'; +export * from './api/another/level/user-api'; 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 578ac53ef77..0d01d428b7a 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 @@ -565,7 +565,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any) { + addPet(body: Pet, options?: any): AxiosPromise { return PetApiFp(configuration).addPet(body, options)(axios, basePath); }, /** @@ -576,7 +576,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any) { + deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { return PetApiFp(configuration).deletePet(petId, apiKey, options)(axios, basePath); }, /** @@ -586,7 +586,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any) { + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): AxiosPromise> { return PetApiFp(configuration).findPetsByStatus(status, options)(axios, basePath); }, /** @@ -596,7 +596,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByTags(tags: Array, options?: any) { + findPetsByTags(tags: Array, options?: any): AxiosPromise> { return PetApiFp(configuration).findPetsByTags(tags, options)(axios, basePath); }, /** @@ -606,7 +606,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPetById(petId: number, options?: any) { + getPetById(petId: number, options?: any): AxiosPromise { return PetApiFp(configuration).getPetById(petId, options)(axios, basePath); }, /** @@ -616,7 +616,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any) { + updatePet(body: Pet, options?: any): AxiosPromise { return PetApiFp(configuration).updatePet(body, options)(axios, basePath); }, /** @@ -628,7 +628,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any) { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { return PetApiFp(configuration).updatePetWithForm(petId, name, status, options)(axios, basePath); }, /** @@ -640,7 +640,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): AxiosPromise { return PetApiFp(configuration).uploadFile(petId, additionalMetadata, file, options)(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 65c0f296582..302b1bcd470 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 @@ -251,7 +251,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any) { + deleteOrder(orderId: string, options?: any): AxiosPromise { return StoreApiFp(configuration).deleteOrder(orderId, options)(axios, basePath); }, /** @@ -260,7 +260,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: any) { + getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { return StoreApiFp(configuration).getInventory(options)(axios, basePath); }, /** @@ -270,7 +270,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderById(orderId: number, options?: any) { + getOrderById(orderId: number, options?: any): AxiosPromise { return StoreApiFp(configuration).getOrderById(orderId, options)(axios, basePath); }, /** @@ -280,7 +280,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - placeOrder(body: Order, options?: any) { + placeOrder(body: Order, options?: any): AxiosPromise { return StoreApiFp(configuration).placeOrder(body, options)(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 a7fd1b542c2..c06bbbcde13 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 @@ -468,7 +468,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any) { + createUser(body: User, options?: any): AxiosPromise { return UserApiFp(configuration).createUser(body, options)(axios, basePath); }, /** @@ -478,7 +478,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any) { + createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { return UserApiFp(configuration).createUsersWithArrayInput(body, options)(axios, basePath); }, /** @@ -488,7 +488,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any) { + createUsersWithListInput(body: Array, options?: any): AxiosPromise { return UserApiFp(configuration).createUsersWithListInput(body, options)(axios, basePath); }, /** @@ -498,7 +498,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any) { + deleteUser(username: string, options?: any): AxiosPromise { return UserApiFp(configuration).deleteUser(username, options)(axios, basePath); }, /** @@ -508,7 +508,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByName(username: string, options?: any) { + getUserByName(username: string, options?: any): AxiosPromise { return UserApiFp(configuration).getUserByName(username, options)(axios, basePath); }, /** @@ -519,7 +519,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginUser(username: string, password: string, options?: any) { + loginUser(username: string, password: string, options?: any): AxiosPromise { return UserApiFp(configuration).loginUser(username, password, options)(axios, basePath); }, /** @@ -528,7 +528,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any) { + logoutUser(options?: any): AxiosPromise { return UserApiFp(configuration).logoutUser(options)(axios, basePath); }, /** @@ -539,7 +539,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any) { + updateUser(username: string, body: User, options?: any): AxiosPromise { return UserApiFp(configuration).updateUser(username, body, options)(axios, basePath); }, }; 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 2680cf57f47..8785e2e2ccf 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 @@ -790,7 +790,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - addPet(body: Pet, options?: any) { + addPet(body: Pet, options?: any): AxiosPromise { return PetApiFp(configuration).addPet(body, options)(axios, basePath); }, /** @@ -801,7 +801,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deletePet(petId: number, apiKey?: string, options?: any) { + deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { return PetApiFp(configuration).deletePet(petId, apiKey, options)(axios, basePath); }, /** @@ -811,7 +811,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any) { + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): AxiosPromise> { return PetApiFp(configuration).findPetsByStatus(status, options)(axios, basePath); }, /** @@ -821,7 +821,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - findPetsByTags(tags: Array, options?: any) { + findPetsByTags(tags: Array, options?: any): AxiosPromise> { return PetApiFp(configuration).findPetsByTags(tags, options)(axios, basePath); }, /** @@ -831,7 +831,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getPetById(petId: number, options?: any) { + getPetById(petId: number, options?: any): AxiosPromise { return PetApiFp(configuration).getPetById(petId, options)(axios, basePath); }, /** @@ -841,7 +841,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePet(body: Pet, options?: any) { + updatePet(body: Pet, options?: any): AxiosPromise { return PetApiFp(configuration).updatePet(body, options)(axios, basePath); }, /** @@ -853,7 +853,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updatePetWithForm(petId: number, name?: string, status?: string, options?: any) { + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { return PetApiFp(configuration).updatePetWithForm(petId, name, status, options)(axios, basePath); }, /** @@ -865,7 +865,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): AxiosPromise { return PetApiFp(configuration).uploadFile(petId, additionalMetadata, file, options)(axios, basePath); }, }; @@ -1213,7 +1213,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteOrder(orderId: string, options?: any) { + deleteOrder(orderId: string, options?: any): AxiosPromise { return StoreApiFp(configuration).deleteOrder(orderId, options)(axios, basePath); }, /** @@ -1222,7 +1222,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInventory(options?: any) { + getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { return StoreApiFp(configuration).getInventory(options)(axios, basePath); }, /** @@ -1232,7 +1232,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderById(orderId: number, options?: any) { + getOrderById(orderId: number, options?: any): AxiosPromise { return StoreApiFp(configuration).getOrderById(orderId, options)(axios, basePath); }, /** @@ -1242,7 +1242,7 @@ export const StoreApiFactory = function (configuration?: Configuration, basePath * @param {*} [options] Override http request option. * @throws {RequiredError} */ - placeOrder(body: Order, options?: any) { + placeOrder(body: Order, options?: any): AxiosPromise { return StoreApiFp(configuration).placeOrder(body, options)(axios, basePath); }, }; @@ -1753,7 +1753,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUser(body: User, options?: any) { + createUser(body: User, options?: any): AxiosPromise { return UserApiFp(configuration).createUser(body, options)(axios, basePath); }, /** @@ -1763,7 +1763,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithArrayInput(body: Array, options?: any) { + createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { return UserApiFp(configuration).createUsersWithArrayInput(body, options)(axios, basePath); }, /** @@ -1773,7 +1773,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - createUsersWithListInput(body: Array, options?: any) { + createUsersWithListInput(body: Array, options?: any): AxiosPromise { return UserApiFp(configuration).createUsersWithListInput(body, options)(axios, basePath); }, /** @@ -1783,7 +1783,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteUser(username: string, options?: any) { + deleteUser(username: string, options?: any): AxiosPromise { return UserApiFp(configuration).deleteUser(username, options)(axios, basePath); }, /** @@ -1793,7 +1793,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getUserByName(username: string, options?: any) { + getUserByName(username: string, options?: any): AxiosPromise { return UserApiFp(configuration).getUserByName(username, options)(axios, basePath); }, /** @@ -1804,7 +1804,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - loginUser(username: string, password: string, options?: any) { + loginUser(username: string, password: string, options?: any): AxiosPromise { return UserApiFp(configuration).loginUser(username, password, options)(axios, basePath); }, /** @@ -1813,7 +1813,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - logoutUser(options?: any) { + logoutUser(options?: any): AxiosPromise { return UserApiFp(configuration).logoutUser(options)(axios, basePath); }, /** @@ -1824,7 +1824,7 @@ export const UserApiFactory = function (configuration?: Configuration, basePath? * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateUser(username: string, body: User, options?: any) { + updateUser(username: string, body: User, options?: any): AxiosPromise { return UserApiFp(configuration).updateUser(username, body, options)(axios, basePath); }, }; From d111e3a35920b8475043aa5548f95b938ee7baa4 Mon Sep 17 00:00:00 2001 From: aanno2 <33512482+aanno2@users.noreply.github.com> Date: Mon, 27 Jan 2020 09:40:59 +0100 Subject: [PATCH 36/85] [REQ][typescript-angular]: support for object as query parameters (#4407) * https://github.com/OpenAPITools/openapi-generator/pull/4407 squashed from original, and better author (I failed to refer the right PR the first time) * removed isArrayLike in favour of Array.isArray * support collectionFormat the old way * fixed type and rebuild samples * revert samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/package.json * reverted samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/tsconfig.json * rebase-to-master-fix: isDateTime stuff is now handled within this.addToHttpParams * run bin/typescript-angular-petstore-all.sh on the rebased PR * applying proposed fix of @macjohnny * run bin/typescript-angular-petstore-all.sh to regenerate samples Co-authored-by: aanno --- .../typescript-angular/api.service.mustache | 46 +++++++++++++++---- .../default/api/pet.service.ts | 38 ++++++++++++++- .../default/api/store.service.ts | 32 +++++++++++++ .../default/api/user.service.ts | 38 ++++++++++++++- .../npm/api/pet.service.ts | 38 ++++++++++++++- .../npm/api/store.service.ts | 32 +++++++++++++ .../npm/api/user.service.ts | 38 ++++++++++++++- .../with-interfaces/api/pet.service.ts | 38 ++++++++++++++- .../with-interfaces/api/store.service.ts | 32 +++++++++++++ .../with-interfaces/api/user.service.ts | 38 ++++++++++++++- .../npm/api/pet.service.ts | 38 ++++++++++++++- .../npm/api/store.service.ts | 32 +++++++++++++ .../npm/api/user.service.ts | 38 ++++++++++++++- .../npm/api/pet.service.ts | 38 ++++++++++++++- .../npm/api/store.service.ts | 32 +++++++++++++ .../npm/api/user.service.ts | 38 ++++++++++++++- .../builds/default/api/pet.service.ts | 38 ++++++++++++++- .../builds/default/api/store.service.ts | 32 +++++++++++++ .../builds/default/api/user.service.ts | 38 ++++++++++++++- .../builds/with-npm/api/pet.service.ts | 38 ++++++++++++++- .../builds/with-npm/api/store.service.ts | 32 +++++++++++++ .../builds/with-npm/api/user.service.ts | 38 ++++++++++++++- .../builds/default/api/pet.service.ts | 38 ++++++++++++++- .../builds/default/api/store.service.ts | 32 +++++++++++++ .../builds/default/api/user.service.ts | 38 ++++++++++++++- .../builds/with-npm/api/pet.service.ts | 38 ++++++++++++++- .../builds/with-npm/api/store.service.ts | 32 +++++++++++++ .../builds/with-npm/api/user.service.ts | 38 ++++++++++++++- .../builds/default/api/pet.service.ts | 38 ++++++++++++++- .../builds/default/api/store.service.ts | 32 +++++++++++++ .../builds/default/api/user.service.ts | 38 ++++++++++++++- .../builds/with-npm/api/pet.service.ts | 38 ++++++++++++++- .../builds/with-npm/api/store.service.ts | 32 +++++++++++++ .../builds/with-npm/api/user.service.ts | 38 ++++++++++++++- .../builds/default/api/pet.service.ts | 38 ++++++++++++++- .../builds/default/api/store.service.ts | 32 +++++++++++++ .../builds/default/api/user.service.ts | 38 ++++++++++++++- .../builds/with-npm/api/pet.service.ts | 38 ++++++++++++++- .../builds/with-npm/api/store.service.ts | 32 +++++++++++++ .../builds/with-npm/api/user.service.ts | 38 ++++++++++++++- .../api/pet.service.ts | 38 ++++++++++++++- .../api/store.service.ts | 32 +++++++++++++ .../api/user.service.ts | 38 ++++++++++++++- .../builds/with-npm/api/pet.service.ts | 38 ++++++++++++++- .../builds/with-npm/api/store.service.ts | 32 +++++++++++++ .../builds/with-npm/api/user.service.ts | 38 ++++++++++++++- .../api/pet.service.ts | 38 ++++++++++++++- .../api/store.service.ts | 32 +++++++++++++ .../api/user.service.ts | 38 ++++++++++++++- 49 files changed, 1702 insertions(+), 72 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index c719ae838d6..9682a0c7447 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -151,6 +151,38 @@ export class {{classname}} { {{/operation}} {{/useHttpClient}} + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + {{#useHttpClient}}httpParams = {{/useHttpClient}}this.addToHttpParamsRecursive(httpParams, value); + } else { + {{#useHttpClient}}httpParams = {{/useHttpClient}}this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + {{#useHttpClient}}httpParams = {{/useHttpClient}}httpParams.append(key, + (value as Date).toISOString(){{^isDateTime}}.substr(0, 10)){{/isDateTime}}; + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => {{#useHttpClient}}httpParams = {{/useHttpClient}}this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + {{#useHttpClient}}httpParams = {{/useHttpClient}}httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + {{#operation}} /** {{#summary}} @@ -206,22 +238,20 @@ export class {{classname}} { if ({{paramName}}) { {{#isCollectionFormatMulti}} {{paramName}}.forEach((element) => { - {{#useHttpClient}}queryParameters = {{/useHttpClient}}queryParameters.append('{{baseName}}', element); + {{#useHttpClient}}queryParameters = {{/useHttpClient}}this.addToHttpParams(queryParameters, + element, '{{baseName}}'); }) {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - {{#useHttpClient}}queryParameters = {{/useHttpClient}}queryParameters.set('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}'])); + {{#useHttpClient}}queryParameters = {{/useHttpClient}}this.addToHttpParams(queryParameters, + {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']), '{{baseName}}'); {{/isCollectionFormatMulti}} } {{/isListContainer}} {{^isListContainer}} if ({{paramName}} !== undefined && {{paramName}} !== null) { - {{#isDateTime}} - {{#useHttpClient}}queryParameters = {{/useHttpClient}}queryParameters.set('{{baseName}}', ({{paramName}} as any instanceof Date) ? ({{paramName}} as any).toISOString(): {{paramName}}); - {{/isDateTime}} - {{^isDateTime}} - {{#useHttpClient}}queryParameters = {{/useHttpClient}}queryParameters.set('{{baseName}}', {{paramName}}); - {{/isDateTime}} + {{#useHttpClient}}queryParameters = {{/useHttpClient}}this.addToHttpParams(queryParameters, + {{paramName}}, '{{baseName}}'); } {{/isListContainer}} {{/queryParams}} diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index 1e305aa26e2..6c550afa6c7 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -204,6 +204,38 @@ export class PetService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + this.addToHttpParamsRecursive(httpParams, value); + } else { + this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Add a new pet to the store * @param body Pet object that needs to be added to the store @@ -321,7 +353,8 @@ export class PetService { let queryParameters = new URLSearchParams('', this.encoder); if (status) { - queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -375,7 +408,8 @@ export class PetService { let queryParameters = new URLSearchParams('', this.encoder); if (tags) { - queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index dd89404c1b8..6168be9b6e4 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -116,6 +116,38 @@ export class StoreService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + this.addToHttpParamsRecursive(httpParams, value); + } else { + this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index e7f2aed548a..526147a1361 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -186,6 +186,38 @@ export class UserService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + this.addToHttpParamsRecursive(httpParams, value); + } else { + this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Create user * This can only be done by the logged in user. @@ -417,10 +449,12 @@ export class UserService { let queryParameters = new URLSearchParams('', this.encoder); if (username !== undefined && username !== null) { - queryParameters.set('username', username); + this.addToHttpParams(queryParameters, + username, 'username'); } if (password !== undefined && password !== null) { - queryParameters.set('password', password); + this.addToHttpParams(queryParameters, + password, 'password'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index 1e305aa26e2..6c550afa6c7 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -204,6 +204,38 @@ export class PetService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + this.addToHttpParamsRecursive(httpParams, value); + } else { + this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Add a new pet to the store * @param body Pet object that needs to be added to the store @@ -321,7 +353,8 @@ export class PetService { let queryParameters = new URLSearchParams('', this.encoder); if (status) { - queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -375,7 +408,8 @@ export class PetService { let queryParameters = new URLSearchParams('', this.encoder); if (tags) { - queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index dd89404c1b8..6168be9b6e4 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -116,6 +116,38 @@ export class StoreService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + this.addToHttpParamsRecursive(httpParams, value); + } else { + this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index e7f2aed548a..526147a1361 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -186,6 +186,38 @@ export class UserService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + this.addToHttpParamsRecursive(httpParams, value); + } else { + this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Create user * This can only be done by the logged in user. @@ -417,10 +449,12 @@ export class UserService { let queryParameters = new URLSearchParams('', this.encoder); if (username !== undefined && username !== null) { - queryParameters.set('username', username); + this.addToHttpParams(queryParameters, + username, 'username'); } if (password !== undefined && password !== null) { - queryParameters.set('password', password); + this.addToHttpParams(queryParameters, + password, 'password'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index 5225e2ceddc..76fa4937370 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -207,6 +207,38 @@ export class PetService implements PetServiceInterface { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + this.addToHttpParamsRecursive(httpParams, value); + } else { + this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Add a new pet to the store * @param body Pet object that needs to be added to the store @@ -324,7 +356,8 @@ export class PetService implements PetServiceInterface { let queryParameters = new URLSearchParams('', this.encoder); if (status) { - queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -378,7 +411,8 @@ export class PetService implements PetServiceInterface { let queryParameters = new URLSearchParams('', this.encoder); if (tags) { - queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index b2b11558a35..ab60c271c7d 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -119,6 +119,38 @@ export class StoreService implements StoreServiceInterface { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + this.addToHttpParamsRecursive(httpParams, value); + } else { + this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index 3b7effa5d28..20909bc6a51 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -189,6 +189,38 @@ export class UserService implements UserServiceInterface { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + this.addToHttpParamsRecursive(httpParams, value); + } else { + this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Create user * This can only be done by the logged in user. @@ -420,10 +452,12 @@ export class UserService implements UserServiceInterface { let queryParameters = new URLSearchParams('', this.encoder); if (username !== undefined && username !== null) { - queryParameters.set('username', username); + this.addToHttpParams(queryParameters, + username, 'username'); } if (password !== undefined && password !== null) { - queryParameters.set('password', password); + this.addToHttpParams(queryParameters, + password, 'password'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts index 575d13d4689..1b73575c4bd 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts @@ -61,6 +61,38 @@ export class PetService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Add a new pet to the store * @param body Pet object that needs to be added to the store @@ -197,7 +229,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (status) { - queryParameters = queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); } let headers = this.defaultHeaders; @@ -258,7 +291,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (tags) { - queryParameters = queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts index e275f1bb4e3..5265ec4464a 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts @@ -47,6 +47,38 @@ export class StoreService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts index 79bb71eab44..24ba9cb94cf 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts @@ -47,6 +47,38 @@ export class UserService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Create user * This can only be done by the logged in user. @@ -318,10 +350,12 @@ export class UserService { let queryParameters = new HttpParams({encoder: this.encoder}); if (username !== undefined && username !== null) { - queryParameters = queryParameters.set('username', username); + queryParameters = this.addToHttpParams(queryParameters, + username, 'username'); } if (password !== undefined && password !== null) { - queryParameters = queryParameters.set('password', password); + queryParameters = this.addToHttpParams(queryParameters, + password, 'password'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts index 1e305aa26e2..6c550afa6c7 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts @@ -204,6 +204,38 @@ export class PetService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + this.addToHttpParamsRecursive(httpParams, value); + } else { + this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Add a new pet to the store * @param body Pet object that needs to be added to the store @@ -321,7 +353,8 @@ export class PetService { let queryParameters = new URLSearchParams('', this.encoder); if (status) { - queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 @@ -375,7 +408,8 @@ export class PetService { let queryParameters = new URLSearchParams('', this.encoder); if (tags) { - queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts index dd89404c1b8..6168be9b6e4 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts @@ -116,6 +116,38 @@ export class StoreService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + this.addToHttpParamsRecursive(httpParams, value); + } else { + this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts index e7f2aed548a..526147a1361 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts @@ -186,6 +186,38 @@ export class UserService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + this.addToHttpParamsRecursive(httpParams, value); + } else { + this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Create user * This can only be done by the logged in user. @@ -417,10 +449,12 @@ export class UserService { let queryParameters = new URLSearchParams('', this.encoder); if (username !== undefined && username !== null) { - queryParameters.set('username', username); + this.addToHttpParams(queryParameters, + username, 'username'); } if (password !== undefined && password !== null) { - queryParameters.set('password', password); + this.addToHttpParams(queryParameters, + password, 'password'); } let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts index 3baa93b09d4..49865a3d370 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts @@ -61,6 +61,38 @@ export class PetService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Add a new pet to the store * @param body Pet object that needs to be added to the store @@ -197,7 +229,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (status) { - queryParameters = queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); } let headers = this.defaultHeaders; @@ -258,7 +291,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (tags) { - queryParameters = queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts index 9423bd8b423..594b4e9df35 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts @@ -47,6 +47,38 @@ export class StoreService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts index 0cefb7e9a47..00cb3a60312 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts @@ -47,6 +47,38 @@ export class UserService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Create user * This can only be done by the logged in user. @@ -318,10 +350,12 @@ export class UserService { let queryParameters = new HttpParams({encoder: this.encoder}); if (username !== undefined && username !== null) { - queryParameters = queryParameters.set('username', username); + queryParameters = this.addToHttpParams(queryParameters, + username, 'username'); } if (password !== undefined && password !== null) { - queryParameters = queryParameters.set('password', password); + queryParameters = this.addToHttpParams(queryParameters, + password, 'password'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts index 3baa93b09d4..49865a3d370 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -61,6 +61,38 @@ export class PetService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Add a new pet to the store * @param body Pet object that needs to be added to the store @@ -197,7 +229,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (status) { - queryParameters = queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); } let headers = this.defaultHeaders; @@ -258,7 +291,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (tags) { - queryParameters = queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts index 9423bd8b423..594b4e9df35 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -47,6 +47,38 @@ export class StoreService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts index 0cefb7e9a47..00cb3a60312 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -47,6 +47,38 @@ export class UserService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Create user * This can only be done by the logged in user. @@ -318,10 +350,12 @@ export class UserService { let queryParameters = new HttpParams({encoder: this.encoder}); if (username !== undefined && username !== null) { - queryParameters = queryParameters.set('username', username); + queryParameters = this.addToHttpParams(queryParameters, + username, 'username'); } if (password !== undefined && password !== null) { - queryParameters = queryParameters.set('password', password); + queryParameters = this.addToHttpParams(queryParameters, + password, 'password'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts index 752adbf45c7..f11d19b64df 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts @@ -63,6 +63,38 @@ export class PetService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Add a new pet to the store * @param body Pet object that needs to be added to the store @@ -199,7 +231,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (status) { - queryParameters = queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); } let headers = this.defaultHeaders; @@ -260,7 +293,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (tags) { - queryParameters = queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts index 478959481a9..e5cca603af8 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts @@ -49,6 +49,38 @@ export class StoreService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts index 6240c41d44a..e4a83db33b1 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts @@ -49,6 +49,38 @@ export class UserService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Create user * This can only be done by the logged in user. @@ -320,10 +352,12 @@ export class UserService { let queryParameters = new HttpParams({encoder: this.encoder}); if (username !== undefined && username !== null) { - queryParameters = queryParameters.set('username', username); + queryParameters = this.addToHttpParams(queryParameters, + username, 'username'); } if (password !== undefined && password !== null) { - queryParameters = queryParameters.set('password', password); + queryParameters = this.addToHttpParams(queryParameters, + password, 'password'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts index 752adbf45c7..f11d19b64df 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts @@ -63,6 +63,38 @@ export class PetService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Add a new pet to the store * @param body Pet object that needs to be added to the store @@ -199,7 +231,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (status) { - queryParameters = queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); } let headers = this.defaultHeaders; @@ -260,7 +293,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (tags) { - queryParameters = queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts index 478959481a9..e5cca603af8 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts @@ -49,6 +49,38 @@ export class StoreService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts index 6240c41d44a..e4a83db33b1 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts @@ -49,6 +49,38 @@ export class UserService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Create user * This can only be done by the logged in user. @@ -320,10 +352,12 @@ export class UserService { let queryParameters = new HttpParams({encoder: this.encoder}); if (username !== undefined && username !== null) { - queryParameters = queryParameters.set('username', username); + queryParameters = this.addToHttpParams(queryParameters, + username, 'username'); } if (password !== undefined && password !== null) { - queryParameters = queryParameters.set('password', password); + queryParameters = this.addToHttpParams(queryParameters, + password, 'password'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts index 3baa93b09d4..49865a3d370 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts @@ -61,6 +61,38 @@ export class PetService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Add a new pet to the store * @param body Pet object that needs to be added to the store @@ -197,7 +229,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (status) { - queryParameters = queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); } let headers = this.defaultHeaders; @@ -258,7 +291,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (tags) { - queryParameters = queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts index 9423bd8b423..594b4e9df35 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts @@ -47,6 +47,38 @@ export class StoreService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts index 0cefb7e9a47..00cb3a60312 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts @@ -47,6 +47,38 @@ export class UserService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Create user * This can only be done by the logged in user. @@ -318,10 +350,12 @@ export class UserService { let queryParameters = new HttpParams({encoder: this.encoder}); if (username !== undefined && username !== null) { - queryParameters = queryParameters.set('username', username); + queryParameters = this.addToHttpParams(queryParameters, + username, 'username'); } if (password !== undefined && password !== null) { - queryParameters = queryParameters.set('password', password); + queryParameters = this.addToHttpParams(queryParameters, + password, 'password'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts index 3baa93b09d4..49865a3d370 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -61,6 +61,38 @@ export class PetService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Add a new pet to the store * @param body Pet object that needs to be added to the store @@ -197,7 +229,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (status) { - queryParameters = queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); } let headers = this.defaultHeaders; @@ -258,7 +291,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (tags) { - queryParameters = queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts index 9423bd8b423..594b4e9df35 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -47,6 +47,38 @@ export class StoreService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts index 0cefb7e9a47..00cb3a60312 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -47,6 +47,38 @@ export class UserService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Create user * This can only be done by the logged in user. @@ -318,10 +350,12 @@ export class UserService { let queryParameters = new HttpParams({encoder: this.encoder}); if (username !== undefined && username !== null) { - queryParameters = queryParameters.set('username', username); + queryParameters = this.addToHttpParams(queryParameters, + username, 'username'); } if (password !== undefined && password !== null) { - queryParameters = queryParameters.set('password', password); + queryParameters = this.addToHttpParams(queryParameters, + password, 'password'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts index 752adbf45c7..f11d19b64df 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts @@ -63,6 +63,38 @@ export class PetService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Add a new pet to the store * @param body Pet object that needs to be added to the store @@ -199,7 +231,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (status) { - queryParameters = queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); } let headers = this.defaultHeaders; @@ -260,7 +293,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (tags) { - queryParameters = queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts index 478959481a9..e5cca603af8 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts @@ -49,6 +49,38 @@ export class StoreService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts index 6240c41d44a..e4a83db33b1 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts @@ -49,6 +49,38 @@ export class UserService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Create user * This can only be done by the logged in user. @@ -320,10 +352,12 @@ export class UserService { let queryParameters = new HttpParams({encoder: this.encoder}); if (username !== undefined && username !== null) { - queryParameters = queryParameters.set('username', username); + queryParameters = this.addToHttpParams(queryParameters, + username, 'username'); } if (password !== undefined && password !== null) { - queryParameters = queryParameters.set('password', password); + queryParameters = this.addToHttpParams(queryParameters, + password, 'password'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts index 752adbf45c7..f11d19b64df 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts @@ -63,6 +63,38 @@ export class PetService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Add a new pet to the store * @param body Pet object that needs to be added to the store @@ -199,7 +231,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (status) { - queryParameters = queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); } let headers = this.defaultHeaders; @@ -260,7 +293,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (tags) { - queryParameters = queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts index 478959481a9..e5cca603af8 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts @@ -49,6 +49,38 @@ export class StoreService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts index 6240c41d44a..e4a83db33b1 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts @@ -49,6 +49,38 @@ export class UserService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Create user * This can only be done by the logged in user. @@ -320,10 +352,12 @@ export class UserService { let queryParameters = new HttpParams({encoder: this.encoder}); if (username !== undefined && username !== null) { - queryParameters = queryParameters.set('username', username); + queryParameters = this.addToHttpParams(queryParameters, + username, 'username'); } if (password !== undefined && password !== null) { - queryParameters = queryParameters.set('password', password); + queryParameters = this.addToHttpParams(queryParameters, + password, 'password'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts index beae55938b5..f3722d434cc 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts @@ -100,6 +100,38 @@ export class PetService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Add a new pet to the store * @param requestParameters @@ -239,7 +271,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (status) { - queryParameters = queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); } let headers = this.defaultHeaders; @@ -301,7 +334,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (tags) { - queryParameters = queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts index fd0cff4bc09..47658366d4e 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts @@ -61,6 +61,38 @@ export class StoreService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts index 44e12277eb7..10c54226525 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts @@ -79,6 +79,38 @@ export class UserService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Create user * This can only be done by the logged in user. @@ -356,10 +388,12 @@ export class UserService { let queryParameters = new HttpParams({encoder: this.encoder}); if (username !== undefined && username !== null) { - queryParameters = queryParameters.set('username', username); + queryParameters = this.addToHttpParams(queryParameters, + username, 'username'); } if (password !== undefined && password !== null) { - queryParameters = queryParameters.set('password', password); + queryParameters = this.addToHttpParams(queryParameters, + password, 'password'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts index 752adbf45c7..f11d19b64df 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts @@ -63,6 +63,38 @@ export class PetService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Add a new pet to the store * @param body Pet object that needs to be added to the store @@ -199,7 +231,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (status) { - queryParameters = queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); } let headers = this.defaultHeaders; @@ -260,7 +293,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (tags) { - queryParameters = queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts index 478959481a9..e5cca603af8 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts @@ -49,6 +49,38 @@ export class StoreService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts index 6240c41d44a..e4a83db33b1 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts @@ -49,6 +49,38 @@ export class UserService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Create user * This can only be done by the logged in user. @@ -320,10 +352,12 @@ export class UserService { let queryParameters = new HttpParams({encoder: this.encoder}); if (username !== undefined && username !== null) { - queryParameters = queryParameters.set('username', username); + queryParameters = this.addToHttpParams(queryParameters, + username, 'username'); } if (password !== undefined && password !== null) { - queryParameters = queryParameters.set('password', password); + queryParameters = this.addToHttpParams(queryParameters, + password, 'password'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts index 752adbf45c7..f11d19b64df 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts @@ -63,6 +63,38 @@ export class PetService { } + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Add a new pet to the store * @param body Pet object that needs to be added to the store @@ -199,7 +231,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (status) { - queryParameters = queryParameters.set('status', status.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + status.join(COLLECTION_FORMATS['csv']), 'status'); } let headers = this.defaultHeaders; @@ -260,7 +293,8 @@ export class PetService { let queryParameters = new HttpParams({encoder: this.encoder}); if (tags) { - queryParameters = queryParameters.set('tags', tags.join(COLLECTION_FORMATS['csv'])); + queryParameters = this.addToHttpParams(queryParameters, + tags.join(COLLECTION_FORMATS['csv']), 'tags'); } let headers = this.defaultHeaders; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts index 478959481a9..e5cca603af8 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts @@ -49,6 +49,38 @@ export class StoreService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts index 6240c41d44a..e4a83db33b1 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts @@ -49,6 +49,38 @@ export class UserService { + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, + (value as Date).toISOString().substr(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + /** * Create user * This can only be done by the logged in user. @@ -320,10 +352,12 @@ export class UserService { let queryParameters = new HttpParams({encoder: this.encoder}); if (username !== undefined && username !== null) { - queryParameters = queryParameters.set('username', username); + queryParameters = this.addToHttpParams(queryParameters, + username, 'username'); } if (password !== undefined && password !== null) { - queryParameters = queryParameters.set('password', password); + queryParameters = this.addToHttpParams(queryParameters, + password, 'password'); } let headers = this.defaultHeaders; From a42ff37a42479690217bb5b8cb887d707d5f8fba Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Mon, 27 Jan 2020 14:23:20 +0100 Subject: [PATCH 37/85] [java][client] oneOf support for jackson clients (#5120) --- .../codegen/CodegenDiscriminator.java | 18 ++ .../openapitools/codegen/DefaultCodegen.java | 9 +- .../codegen/languages/JavaClientCodegen.java | 275 +++++++++++++++++- .../src/main/resources/Java/model.mustache | 2 +- .../main/resources/Java/model_test.mustache | 2 + .../resources/Java/oneof_interface.mustache | 6 + .../src/main/resources/Java/pojo.mustache | 2 +- .../src/main/resources/Java/pojo_doc.mustache | 19 +- .../Java/typeInfoAnnotation.mustache | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../docs/AdditionalPropertiesAnyType.md | 4 + .../docs/AdditionalPropertiesArray.md | 4 + .../docs/AdditionalPropertiesBoolean.md | 4 + .../docs/AdditionalPropertiesClass.md | 4 + .../docs/AdditionalPropertiesInteger.md | 4 + .../docs/AdditionalPropertiesNumber.md | 4 + .../docs/AdditionalPropertiesObject.md | 4 + .../docs/AdditionalPropertiesString.md | 4 + .../docs/Animal.md | 4 + .../docs/ArrayOfArrayOfNumberOnly.md | 4 + .../docs/ArrayOfNumberOnly.md | 4 + .../docs/ArrayTest.md | 4 + .../docs/BigCat.md | 4 + .../docs/BigCatAllOf.md | 4 + .../docs/Capitalization.md | 4 + .../okhttp-gson-parcelableModel/docs/Cat.md | 4 + .../docs/CatAllOf.md | 4 + .../docs/Category.md | 4 + .../docs/ClassModel.md | 4 + .../docs/Client.md | 4 + .../okhttp-gson-parcelableModel/docs/Dog.md | 4 + .../docs/DogAllOf.md | 4 + .../docs/EnumArrays.md | 4 + .../docs/EnumTest.md | 4 + .../docs/FileSchemaTestClass.md | 4 + .../docs/FormatTest.md | 4 + .../docs/HasOnlyReadOnly.md | 4 + .../docs/MapTest.md | 4 + ...dPropertiesAndAdditionalPropertiesClass.md | 4 + .../docs/Model200Response.md | 4 + .../docs/ModelApiResponse.md | 4 + .../docs/ModelReturn.md | 4 + .../okhttp-gson-parcelableModel/docs/Name.md | 4 + .../docs/NumberOnly.md | 4 + .../okhttp-gson-parcelableModel/docs/Order.md | 4 + .../docs/OuterComposite.md | 4 + .../okhttp-gson-parcelableModel/docs/Pet.md | 4 + .../docs/ReadOnlyFirst.md | 4 + .../docs/SpecialModelName.md | 4 + .../okhttp-gson-parcelableModel/docs/Tag.md | 4 + .../docs/TypeHolderDefault.md | 4 + .../docs/TypeHolderExample.md | 4 + .../okhttp-gson-parcelableModel/docs/User.md | 4 + .../docs/XmlItem.md | 4 + .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- 69 files changed, 521 insertions(+), 22 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/Java/oneof_interface.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java index 9b548e8b549..73d85052e70 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java @@ -10,6 +10,8 @@ import java.util.Set; public class CodegenDiscriminator { private String propertyName; private String propertyBaseName; + private String propertyGetter; + private String propertyType; private Map mapping; private Set mappedModels = new LinkedHashSet<>(); @@ -21,6 +23,14 @@ public class CodegenDiscriminator { this.propertyName = propertyName; } + public String getPropertyGetter() { + return propertyGetter; + } + + public void setPropertyGetter(String propertyGetter) { + this.propertyGetter = propertyGetter; + } + public String getPropertyBaseName() { return propertyBaseName; } @@ -29,6 +39,14 @@ public class CodegenDiscriminator { this.propertyBaseName = propertyBaseName; } + public String getPropertyType() { + return propertyType; + } + + public void setPropertyType(String propertyType) { + this.propertyType = propertyType; + } + public Map getMapping() { return mapping; } 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 45677bb61e6..dba4783d282 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 @@ -1663,6 +1663,10 @@ public class DefaultCodegen implements CodegenConfig { */ @SuppressWarnings("static-method") public String toOneOfName(List names, ComposedSchema composedSchema) { + Map exts = composedSchema.getExtensions(); + if (exts != null && exts.containsKey("x-oneOf-name")) { + return (String) exts.get("x-oneOf-name"); + } return "oneOf<" + String.join(",", names) + ">"; } @@ -2126,13 +2130,16 @@ public class DefaultCodegen implements CodegenConfig { return m; } - private CodegenDiscriminator createDiscriminator(String schemaName, Schema schema) { + protected CodegenDiscriminator createDiscriminator(String schemaName, Schema schema) { if (schema.getDiscriminator() == null) { return null; } CodegenDiscriminator discriminator = new CodegenDiscriminator(); discriminator.setPropertyName(toVarName(schema.getDiscriminator().getPropertyName())); discriminator.setPropertyBaseName(schema.getDiscriminator().getPropertyName()); + discriminator.setPropertyGetter(toGetter(discriminator.getPropertyName())); + // FIXME: for now, we assume that the discriminator property is String + discriminator.setPropertyType(typeMapping.get("string")); discriminator.setMapping(schema.getDiscriminator().getMapping()); if (schema.getDiscriminator().getMapping() != null && !schema.getDiscriminator().getMapping().isEmpty()) { for (Entry e : schema.getDiscriminator().getMapping().entrySet()) { 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 4fbba05d820..571717ceb27 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 @@ -25,12 +25,19 @@ import org.openapitools.codegen.languages.features.GzipFeatures; import org.openapitools.codegen.languages.features.PerformBeanValidationFeatures; import org.openapitools.codegen.meta.features.DocumentationFeature; import org.openapitools.codegen.templating.mustache.CaseFormatLambda; +import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.ProcessUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.parameters.RequestBody; +import io.swagger.v3.oas.models.responses.ApiResponse; import java.io.File; import java.util.*; @@ -103,6 +110,9 @@ public class JavaClientCodegen extends AbstractJavaCodegen protected String authFolder; protected String serializationLibrary = null; + protected boolean useOneOfInterfaces = false; + protected List addOneOfInterfaces = new ArrayList(); + public JavaClientCodegen() { super(); @@ -488,6 +498,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen additionalProperties.remove(SERIALIZATION_LIBRARY_GSON); } + if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_JACKSON)) { + useOneOfInterfaces = true; + } + } private boolean usesAnyRetrofitLibrary() { @@ -712,9 +726,10 @@ public class JavaClientCodegen extends AbstractJavaCodegen @Override public Map postProcessModels(Map objs) { objs = super.postProcessModels(objs); + List models = (List) objs.get("models"); + if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_JACKSON) && !JERSEY1.equals(getLibrary())) { List> imports = (List>) objs.get("imports"); - List models = (List) objs.get("models"); for (Object _mo : models) { Map mo = (Map) _mo; CodegenModel cm = (CodegenModel) mo.get("model"); @@ -741,6 +756,20 @@ 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"); + cm.getVendorExtensions().putIfAbsent("implements", new ArrayList()); + List impl = (List) cm.getVendorExtensions().get("implements"); + if (this.parcelableModel) { + impl.add("Parcelable"); + } + if (this.serializableModel) { + impl.add("Serializable"); + } + } + return objs; } @@ -816,6 +845,250 @@ public class JavaClientCodegen extends AbstractJavaCodegen } } + public void addOneOfNameExtension(Schema s, String name) { + ComposedSchema cs = (ComposedSchema) s; + if (cs.getOneOf() != null && cs.getOneOf().size() > 0) { + cs.addExtension("x-oneOf-name", name); + } + } + + public void addOneOfInterfaceModel(ComposedSchema cs, String type) { + CodegenModel cm = new CodegenModel(); + + for (Schema o : cs.getOneOf()) { + // TODO: inline objects + cm.oneOf.add(toModelName(ModelUtils.getSimpleRef(o.get$ref()))); + } + cm.name = type; + cm.classname = type; + cm.vendorExtensions.put("isOneOfInterface", true); + cm.discriminator = createDiscriminator("", (Schema) cs); + cm.interfaceModels = new ArrayList(); + + addOneOfInterfaces.add(cm); + } + + @Override + public void preprocessOpenAPI(OpenAPI openAPI) { + // we process the openapi schema here to find oneOf schemas here and create interface models for them + super.preprocessOpenAPI(openAPI); + Map schemas = new HashMap(openAPI.getComponents().getSchemas()); + if (schemas == null) { + schemas = new HashMap(); + } + Map pathItems = openAPI.getPaths(); + + // we need to add all request and response bodies to processed schemas + if (pathItems != null) { + for (Map.Entry e : pathItems.entrySet()) { + for (Map.Entry op : e.getValue().readOperationsMap().entrySet()) { + String opId = getOrGenerateOperationId(op.getValue(), e.getKey(), op.getKey().toString()); + // process request body + RequestBody b = ModelUtils.getReferencedRequestBody(openAPI, op.getValue().getRequestBody()); + Schema requestSchema = null; + if (b != null) { + requestSchema = ModelUtils.getSchemaFromRequestBody(b); + } + if (requestSchema != null) { + schemas.put(opId, requestSchema); + } + // process all response bodies + for (Map.Entry ar : op.getValue().getResponses().entrySet()) { + ApiResponse a = ModelUtils.getReferencedApiResponse(openAPI, ar.getValue()); + Schema responseSchema = ModelUtils.getSchemaFromResponse(a); + if (responseSchema != null) { + schemas.put(opId + ar.getKey(), responseSchema); + } + } + } + } + } + + for (Map.Entry e : schemas.entrySet()) { + String n = toModelName(e.getKey()); + Schema s = e.getValue(); + String nOneOf = toModelName(n + "OneOf"); + if (ModelUtils.isComposedSchema(s)) { + addOneOfNameExtension(s, n); + } else if (ModelUtils.isArraySchema(s)) { + Schema items = ((ArraySchema) s).getItems(); + if (ModelUtils.isComposedSchema(items)) { + addOneOfNameExtension(items, nOneOf); + addOneOfInterfaceModel((ComposedSchema) items, nOneOf); + } + } else if (ModelUtils.isMapSchema(s)) { + Schema addProps = ModelUtils.getAdditionalProperties(s); + if (addProps != null && ModelUtils.isComposedSchema(addProps)) { + addOneOfNameExtension(addProps, nOneOf); + addOneOfInterfaceModel((ComposedSchema) addProps, nOneOf); + } + } + } + } + + private class OneOfImplementorAdditionalData { + private String implementorName; + private List additionalInterfaces = new ArrayList(); + private List additionalProps = new ArrayList(); + private List> additionalImports = new ArrayList>(); + + public OneOfImplementorAdditionalData(String implementorName) { + this.implementorName = implementorName; + } + + public String getImplementorName() { + return implementorName; + } + + public void addFromInterfaceModel(CodegenModel cm, List> modelsImports) { + // Add cm as implemented interface + additionalInterfaces.add(cm.classname); + + // Add all vars defined on cm + // a "oneOf" model (cm) by default inherits all properties from its "interfaceModels", + // but we only want to add properties defined on cm itself + List toAdd = new ArrayList(cm.vars); + // note that we can't just toAdd.removeAll(m.vars) for every interfaceModel, + // as they might have different value of `hasMore` and thus are not equal + List omitAdding = new ArrayList(); + for (CodegenModel m : cm.interfaceModels) { + for (CodegenProperty v : m.vars) { + omitAdding.add(v.baseName); + } + } + for (CodegenProperty v : toAdd) { + if (!omitAdding.contains(v.baseName)) { + additionalProps.add(v.clone()); + } + } + + // Add all imports of cm + for (Map importMap : modelsImports) { + // we're ok with shallow clone here, because imports are strings only + additionalImports.add(new HashMap(importMap)); + } + } + + public void addToImplementor(CodegenModel implcm, List> implImports) { + implcm.getVendorExtensions().putIfAbsent("implements", new ArrayList()); + + // Add implemented interfaces + for (String intf : additionalInterfaces) { + List impl = (List) implcm.getVendorExtensions().get("implements"); + impl.add(intf); + // Add imports for interfaces + implcm.imports.add(intf); + Map importsItem = new HashMap(); + importsItem.put("import", toModelImport(intf)); + implImports.add(importsItem); + } + + // Add oneOf-containing models properties - we need to properly set the hasMore values to make renderind correct + if (implcm.vars.size() > 0 && additionalProps.size() > 0) { + implcm.vars.get(implcm.vars.size() - 1).hasMore = true; + } + for (int i = 0; i < additionalProps.size(); i++) { + CodegenProperty var = additionalProps.get(i); + if (i == additionalProps.size() - 1) { + var.hasMore = false; + } else { + var.hasMore = true; + } + implcm.vars.add(var); + } + + // Add imports + for (Map oneImport : additionalImports) { + // exclude imports from this package - these are imports that only the oneOf interface needs + if (!implImports.contains(oneImport) && !oneImport.getOrDefault("import", "").startsWith(modelPackage())) { + implImports.add(oneImport); + } + } + } + } + + @Override + public Map postProcessAllModels(Map objs) { + objs = super.postProcessAllModels(objs); + + if (this.useOneOfInterfaces) { + // First, add newly created oneOf interfaces + for (CodegenModel cm : addOneOfInterfaces) { + Map modelValue = new HashMap() {{ + putAll(additionalProperties()); + put("model", cm); + }}; + List modelsValue = Arrays.asList(modelValue); + List> importsValue = new ArrayList>(); + for (String i : Arrays.asList("JsonSubTypes", "JsonTypeInfo")) { + Map oneImport = new HashMap() {{ + put("import", importMapping.get(i)); + }}; + importsValue.add(oneImport); + } + Map objsValue = new HashMap() {{ + put("models", modelsValue); + put("package", modelPackage()); + put("imports", importsValue); + put("classname", cm.classname); + putAll(additionalProperties); + }}; + objs.put(cm.name, objsValue); + } + + // - Add all "oneOf" models as interfaces to be implemented by the models that + // are the choices in "oneOf"; also mark the models containing "oneOf" as interfaces + // - Add all properties of "oneOf" to the implementing classes (NOTE that this + // would be problematic if the class was in multiple such "oneOf" models, in which + // case it would get all their properties, but it's probably better than not doing this) + // - Add all imports of "oneOf" model to all the implementing classes (this might not + // be optimal, as it can contain more than necessary, but it's good enough) + Map additionalDataMap = new HashMap(); + for (Map.Entry modelsEntry : objs.entrySet()) { + Map modelsAttrs = (Map) modelsEntry.getValue(); + List models = (List) modelsAttrs.get("models"); + List> modelsImports = (List>) modelsAttrs.getOrDefault("imports", new ArrayList>()); + for (Object _mo : models) { + Map mo = (Map) _mo; + CodegenModel cm = (CodegenModel) mo.get("model"); + if (cm.oneOf.size() > 0) { + cm.vendorExtensions.put("isOneOfInterface", true); + // if this is oneOf interface, make sure we include the necessary jackson imports for it + for (String s : Arrays.asList("JsonTypeInfo", "JsonSubTypes")) { + Map i = new HashMap() {{ + put("import", importMapping.get(s)); + }}; + if (!modelsImports.contains(i)) { + modelsImports.add(i); + } + } + for (String one : cm.oneOf) { + if (!additionalDataMap.containsKey(one)) { + additionalDataMap.put(one, new OneOfImplementorAdditionalData(one)); + } + additionalDataMap.get(one).addFromInterfaceModel(cm, modelsImports); + } + } + } + } + + for (Map.Entry modelsEntry : objs.entrySet()) { + Map modelsAttrs = (Map) modelsEntry.getValue(); + List models = (List) modelsAttrs.get("models"); + List> imports = (List>) modelsAttrs.get("imports"); + for (Object _implmo : models) { + Map implmo = (Map) _implmo; + CodegenModel implcm = (CodegenModel) implmo.get("model"); + if (additionalDataMap.containsKey(implcm.name)) { + additionalDataMap.get(implcm.name).addToImplementor(implcm, imports); + } + } + } + } + + return objs; + } + public void forceSerializationLibrary(String serializationLibrary) { if((this.serializationLibrary != null) && !this.serializationLibrary.equalsIgnoreCase(serializationLibrary)) { LOGGER.warn("The configured serializationLibrary '" + this.serializationLibrary + "', is not supported by the library: '" + getLibrary() + "', switching back to: " + serializationLibrary); diff --git a/modules/openapi-generator/src/main/resources/Java/model.mustache b/modules/openapi-generator/src/main/resources/Java/model.mustache index 2194bbfdb39..8763e3bd08b 100644 --- a/modules/openapi-generator/src/main/resources/Java/model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/model.mustache @@ -42,6 +42,6 @@ import org.hibernate.validator.constraints.*; {{#models}} {{#model}} -{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>pojo}}{{/isEnum}} +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#vendorExtensions.isOneOfInterface}}{{>oneof_interface}}{{/vendorExtensions.isOneOfInterface}}{{^vendorExtensions.isOneOfInterface}}{{>pojo}}{{/vendorExtensions.isOneOfInterface}}{{/isEnum}} {{/model}} {{/models}} diff --git a/modules/openapi-generator/src/main/resources/Java/model_test.mustache b/modules/openapi-generator/src/main/resources/Java/model_test.mustache index e72796cdb93..0258f350074 100644 --- a/modules/openapi-generator/src/main/resources/Java/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/model_test.mustache @@ -21,6 +21,7 @@ import java.util.Map; public class {{classname}}Test { {{#models}} {{#model}} + {{^vendorExtensions.isOneOfInterface}} {{^isEnum}} private final {{classname}} model = new {{classname}}(); @@ -43,6 +44,7 @@ public class {{classname}}Test { } {{/allVars}} + {{/vendorExtensions.isOneOfInterface}} {{/model}} {{/models}} } diff --git a/modules/openapi-generator/src/main/resources/Java/oneof_interface.mustache b/modules/openapi-generator/src/main/resources/Java/oneof_interface.mustache new file mode 100644 index 00000000000..c17cf0b31ca --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/oneof_interface.mustache @@ -0,0 +1,6 @@ +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>typeInfoAnnotation}}{{>xmlAnnotation}} +public interface {{classname}} {{#vendorExtensions.implements}}{{#-first}}extends {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.implements}} { + {{#discriminator}} + public {{propertyType}} {{propertyGetter}}(); + {{/discriminator}} +} diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache index 796f9a7ec14..3386b1b969a 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache @@ -10,7 +10,7 @@ }) {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} -public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcelableModel}}implements Parcelable {{#serializableModel}}, Serializable {{/serializableModel}}{{/parcelableModel}}{{^parcelableModel}}{{#serializableModel}}implements Serializable {{/serializableModel}}{{/parcelableModel}}{ +public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorExtensions.implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; diff --git a/modules/openapi-generator/src/main/resources/Java/pojo_doc.mustache b/modules/openapi-generator/src/main/resources/Java/pojo_doc.mustache index 313e61ba7e6..e63db5e2720 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo_doc.mustache @@ -1,7 +1,8 @@ -# {{classname}} +# {{#vendorExtensions.isOneOfInterface}}Interface {{/vendorExtensions.isOneOfInterface}}{{classname}} {{#description}}{{&description}} {{/description}} +{{^vendorExtensions.isOneOfInterface}} ## Properties Name | Type | Description | Notes @@ -17,3 +18,19 @@ Name | Value ---- | -----{{#allowableValues}}{{#enumVars}} {{name}} | {{value}}{{/enumVars}}{{/allowableValues}} {{/isEnum}}{{/vars}} +{{#vendorExtensions.implements.0}} + +## Implemented Interfaces + +{{#vendorExtensions.implements}} +* {{{.}}} +{{/vendorExtensions.implements}} +{{/vendorExtensions.implements.0}} +{{/vendorExtensions.isOneOfInterface}} +{{#vendorExtensions.isOneOfInterface}} +## Implementing Classes + +{{#oneOf}} +* {{{.}}} +{{/oneOf}} +{{/vendorExtensions.isOneOfInterface}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache b/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache index a8ab10768e6..81c2ba05f90 100644 --- a/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache +++ b/modules/openapi-generator/src/main/resources/Java/typeInfoAnnotation.mustache @@ -1,6 +1,6 @@ {{#jackson}} -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true) @JsonSubTypes({ {{#discriminator.mappedModels}} @JsonSubTypes.Type(value = {{modelName}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"), 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 714c03c8e78..00db7a1b7b6 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 @@ -34,7 +34,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; }) @javax.annotation.concurrent.Immutable -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java index a17f713859c..e0ae875483b 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java @@ -33,7 +33,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; Animal.JSON_PROPERTY_COLOR }) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), 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 a17f713859c..e0ae875483b 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 @@ -33,7 +33,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; Animal.JSON_PROPERTY_COLOR }) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), 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 a17f713859c..e0ae875483b 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 @@ -33,7 +33,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; Animal.JSON_PROPERTY_COLOR }) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java index 741e51b2a6e..b5b4f315c16 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java @@ -32,7 +32,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; Animal.JSON_PROPERTY_COLOR }) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), 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 a17f713859c..e0ae875483b 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 @@ -33,7 +33,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; Animal.JSON_PROPERTY_COLOR }) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java index a17f713859c..e0ae875483b 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java @@ -33,7 +33,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; Animal.JSON_PROPERTY_COLOR }) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java index a17f713859c..e0ae875483b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java @@ -33,7 +33,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; Animal.JSON_PROPERTY_COLOR }) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), 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 36e18162001..30d3a23d8ca 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**](.md) | | [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 a48aa23e78e..4837dc1710b 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>>**](List.md) | | [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 fa2909211a0..410688d7e9d 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>**](BigDecimal.md) | | [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 9ad1c9814a5..b34fafc372f 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>>**](List.md) | | [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 61eb95f22fe..d97f8dba04b 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 d138e921902..23ae5975ddb 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**](BigDecimal.md) | | [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 c35c3cf2c0b..b8c5d4519d5 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 3dc283ae493..171e8d6d161 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 1c12b6adf3b..f3534eb5d83 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**](BigDecimal.md) | | [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 409fc4cc961..ae879c241b4 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 e0629221884..4ce678abed3 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 37ac007b793..a64a5b131dc 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 a338fc900cb..51542d07e47 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 f8858da6066..eb9f10825b6 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 6065fd1f4e5..6c2cf677553 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/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 a17f713859c..e0ae875483b 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 @@ -33,7 +33,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; Animal.JSON_PROPERTY_COLOR }) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), 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 9b0fa3ff89d..af9c0df7038 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 @@ -35,7 +35,7 @@ import javax.xml.bind.annotation.*; Animal.JSON_PROPERTY_COLOR }) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), 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 a17f713859c..e0ae875483b 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 @@ -33,7 +33,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; Animal.JSON_PROPERTY_COLOR }) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java index 6f607263996..38b0a1b2f15 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java @@ -35,7 +35,7 @@ import javax.validation.Valid; Animal.JSON_PROPERTY_COLOR }) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java index 6f607263996..38b0a1b2f15 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java @@ -35,7 +35,7 @@ import javax.validation.Valid; Animal.JSON_PROPERTY_COLOR }) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), 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 6f607263996..38b0a1b2f15 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 @@ -35,7 +35,7 @@ import javax.validation.Valid; Animal.JSON_PROPERTY_COLOR }) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), 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 a17f713859c..e0ae875483b 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 @@ -33,7 +33,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; Animal.JSON_PROPERTY_COLOR }) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), 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 a17f713859c..e0ae875483b 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 @@ -33,7 +33,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; Animal.JSON_PROPERTY_COLOR }) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), From ab5f224634836d69c709556cc85ebc8b9b425b9f Mon Sep 17 00:00:00 2001 From: sunn <33183834+etherealjoy@users.noreply.github.com> Date: Mon, 27 Jan 2020 16:00:58 +0100 Subject: [PATCH 38/85] Support abort operation (#5114) --- .../cpp-qt5-client/api-body.mustache | 6 +++++- .../cpp-qt5-client/api-header.mustache | 3 +++ .../petstore/cpp-qt5/client/PFXPetApi.cpp | 20 +++++++++++-------- .../petstore/cpp-qt5/client/PFXPetApi.h | 3 +++ .../petstore/cpp-qt5/client/PFXStoreApi.cpp | 12 +++++++---- .../petstore/cpp-qt5/client/PFXStoreApi.h | 3 +++ .../petstore/cpp-qt5/client/PFXUserApi.cpp | 20 +++++++++++-------- .../petstore/cpp-qt5/client/PFXUserApi.h | 3 +++ 8 files changed, 49 insertions(+), 21 deletions(-) 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 311afc60b95..ac4dbb88c09 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 @@ -57,6 +57,10 @@ void {{classname}}::enableResponseCompression() { isResponseCompressionEnabled = true; } +void {{classname}}::abortRequests(){ + emit abortRequestsSignal(); +} + {{#operations}} {{#operation}} void {{classname}}::{{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { @@ -143,7 +147,7 @@ void {{classname}}::{{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &{{prefix}}HttpRequestWorker::on_execution_finished, this, &{{classname}}::{{nickname}}Callback); - + connect(this, &{{classname}}::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache index 9fdf7b80c61..2768c2ee561 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache @@ -29,6 +29,7 @@ public: void addHeaders(const QString &key, const QString &value); void enableRequestCompression(); void enableResponseCompression(); + void abortRequests(); {{#operations}}{{#operation}} void {{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/operation}}{{/operations}} @@ -53,6 +54,8 @@ signals: void {{nickname}}SignalE({{#returnType}}{{{returnType}}} summary, {{/returnType}}QNetworkReply::NetworkError error_type, QString error_str);{{/operation}}{{/operations}} {{#operations}}{{#operation}} void {{nickname}}SignalEFull({{prefix}}HttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);{{/operation}}{{/operations}} + + void abortRequestsSignal(); }; {{#cppNamespaceDeclarations}} diff --git a/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp index ca1579559c7..0d293c27d74 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp @@ -65,6 +65,10 @@ void PFXPetApi::enableResponseCompression() { isResponseCompressionEnabled = true; } +void PFXPetApi::abortRequests(){ + emit abortRequestsSignal(); +} + void PFXPetApi::addPet(const PFXPet &body) { QString fullPath = QString("%1://%2%3%4%5") .arg(_scheme) @@ -84,7 +88,7 @@ void PFXPetApi::addPet(const PFXPet &body) { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::addPetCallback); - + connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } @@ -133,7 +137,7 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const QString &api_key) { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::deletePetCallback); - + connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } @@ -213,7 +217,7 @@ void PFXPetApi::findPetsByStatus(const QList &status) { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::findPetsByStatusCallback); - + connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } @@ -303,7 +307,7 @@ void PFXPetApi::findPetsByTags(const QList &tags) { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::findPetsByTagsCallback); - + connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } @@ -358,7 +362,7 @@ void PFXPetApi::getPetById(const qint64 &pet_id) { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::getPetByIdCallback); - + connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } @@ -404,7 +408,7 @@ void PFXPetApi::updatePet(const PFXPet &body) { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::updatePetCallback); - + connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } @@ -451,7 +455,7 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const QString &name, con foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::updatePetWithFormCallback); - + connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } @@ -498,7 +502,7 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const QString &additional_metad foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXPetApi::uploadFileCallback); - + connect(this, &PFXPetApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } diff --git a/samples/client/petstore/cpp-qt5/client/PFXPetApi.h b/samples/client/petstore/cpp-qt5/client/PFXPetApi.h index 9d31bf46d65..6ea632eb49d 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXPetApi.h +++ b/samples/client/petstore/cpp-qt5/client/PFXPetApi.h @@ -39,6 +39,7 @@ public: void addHeaders(const QString &key, const QString &value); void enableRequestCompression(); void enableResponseCompression(); + void abortRequests(); void addPet(const PFXPet &body); void deletePet(const qint64 &pet_id, const QString &api_key); @@ -105,6 +106,8 @@ signals: void updatePetSignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str); void updatePetWithFormSignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str); void uploadFileSignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str); + + void abortRequestsSignal(); }; } // namespace test_namespace diff --git a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp index b63ec811f70..7b9b770c96d 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp @@ -65,6 +65,10 @@ void PFXStoreApi::enableResponseCompression() { isResponseCompressionEnabled = true; } +void PFXStoreApi::abortRequests(){ + emit abortRequestsSignal(); +} + void PFXStoreApi::deleteOrder(const QString &order_id) { QString fullPath = QString("%1://%2%3%4%5") .arg(_scheme) @@ -84,7 +88,7 @@ void PFXStoreApi::deleteOrder(const QString &order_id) { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXStoreApi::deleteOrderCallback); - + connect(this, &PFXStoreApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } @@ -126,7 +130,7 @@ void PFXStoreApi::getInventory() { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXStoreApi::getInventoryCallback); - + connect(this, &PFXStoreApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } @@ -181,7 +185,7 @@ void PFXStoreApi::getOrderById(const qint64 &order_id) { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXStoreApi::getOrderByIdCallback); - + connect(this, &PFXStoreApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } @@ -227,7 +231,7 @@ void PFXStoreApi::placeOrder(const PFXOrder &body) { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXStoreApi::placeOrderCallback); - + connect(this, &PFXStoreApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } diff --git a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h index c983a15c881..fc5e44d75bd 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h +++ b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h @@ -38,6 +38,7 @@ public: void addHeaders(const QString &key, const QString &value); void enableRequestCompression(); void enableResponseCompression(); + void abortRequests(); void deleteOrder(const QString &order_id); void getInventory(); @@ -80,6 +81,8 @@ signals: void getInventorySignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str); void getOrderByIdSignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str); void placeOrderSignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str); + + void abortRequestsSignal(); }; } // namespace test_namespace diff --git a/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp index f5a440adc3b..a372b73dbcb 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp @@ -65,6 +65,10 @@ void PFXUserApi::enableResponseCompression() { isResponseCompressionEnabled = true; } +void PFXUserApi::abortRequests(){ + emit abortRequestsSignal(); +} + void PFXUserApi::createUser(const PFXUser &body) { QString fullPath = QString("%1://%2%3%4%5") .arg(_scheme) @@ -84,7 +88,7 @@ void PFXUserApi::createUser(const PFXUser &body) { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::createUserCallback); - + connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } @@ -130,7 +134,7 @@ void PFXUserApi::createUsersWithArrayInput(const QList &body) { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::createUsersWithArrayInputCallback); - + connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } @@ -176,7 +180,7 @@ void PFXUserApi::createUsersWithListInput(const QList &body) { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::createUsersWithListInputCallback); - + connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } @@ -221,7 +225,7 @@ void PFXUserApi::deleteUser(const QString &username) { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::deleteUserCallback); - + connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } @@ -266,7 +270,7 @@ void PFXUserApi::getUserByName(const QString &username) { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::getUserByNameCallback); - + connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } @@ -321,7 +325,7 @@ void PFXUserApi::loginUser(const QString &username, const QString &password) { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::loginUserCallback); - + connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } @@ -365,7 +369,7 @@ void PFXUserApi::logoutUser() { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::logoutUserCallback); - + connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } @@ -413,7 +417,7 @@ void PFXUserApi::updateUser(const QString &username, const PFXUser &body) { foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } connect(worker, &PFXHttpRequestWorker::on_execution_finished, this, &PFXUserApi::updateUserCallback); - + connect(this, &PFXUserApi::abortRequestsSignal, worker, &QObject::deleteLater); worker->execute(&input); } diff --git a/samples/client/petstore/cpp-qt5/client/PFXUserApi.h b/samples/client/petstore/cpp-qt5/client/PFXUserApi.h index 3b3db0279f9..da5cb322574 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXUserApi.h +++ b/samples/client/petstore/cpp-qt5/client/PFXUserApi.h @@ -38,6 +38,7 @@ public: void addHeaders(const QString &key, const QString &value); void enableRequestCompression(); void enableResponseCompression(); + void abortRequests(); void createUser(const PFXUser &body); void createUsersWithArrayInput(const QList &body); @@ -104,6 +105,8 @@ signals: void loginUserSignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str); void logoutUserSignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str); void updateUserSignalEFull(PFXHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str); + + void abortRequestsSignal(); }; } // namespace test_namespace From 105ce99039150abfdf32b814196dc22584be6e63 Mon Sep 17 00:00:00 2001 From: Alexey Makhrov Date: Mon, 27 Jan 2020 23:23:18 -0800 Subject: [PATCH 39/85] [typescript-angular] Import models from a single model/models.ts (#5128) * Make api to models from a single model/models.ts instead of individual model files. Fixes inconsistent usage of file names with inline models (inline-model-1, inline-model-2, ...) * Remove additional mapped filename prop from api imports (since it's not reliable) * Rerun ./bin/typescript-angular-petstore-all.sh * Restore the `filename` property passed to the templates, with a comment it's no longer used --- .../codegen/languages/TypeScriptAngularClientCodegen.java | 1 + .../main/resources/typescript-angular/api.service.mustache | 2 +- .../main/resources/typescript-angular/apiInterface.mustache | 2 +- .../petstore/typescript-angular-v2/default/api/pet.service.ts | 4 ++-- .../typescript-angular-v2/default/api/store.service.ts | 2 +- .../typescript-angular-v2/default/api/user.service.ts | 2 +- .../petstore/typescript-angular-v2/npm/api/pet.service.ts | 4 ++-- .../petstore/typescript-angular-v2/npm/api/store.service.ts | 2 +- .../petstore/typescript-angular-v2/npm/api/user.service.ts | 2 +- .../typescript-angular-v2/with-interfaces/api/pet.service.ts | 4 ++-- .../with-interfaces/api/pet.serviceInterface.ts | 4 ++-- .../with-interfaces/api/store.service.ts | 2 +- .../with-interfaces/api/store.serviceInterface.ts | 2 +- .../typescript-angular-v2/with-interfaces/api/user.service.ts | 2 +- .../with-interfaces/api/user.serviceInterface.ts | 2 +- .../petstore/typescript-angular-v4.3/npm/api/pet.service.ts | 4 ++-- .../petstore/typescript-angular-v4.3/npm/api/store.service.ts | 2 +- .../petstore/typescript-angular-v4.3/npm/api/user.service.ts | 2 +- .../petstore/typescript-angular-v4/npm/api/pet.service.ts | 4 ++-- .../petstore/typescript-angular-v4/npm/api/store.service.ts | 2 +- .../petstore/typescript-angular-v4/npm/api/user.service.ts | 2 +- .../builds/default/api/pet.service.ts | 4 ++-- .../builds/default/api/store.service.ts | 2 +- .../builds/default/api/user.service.ts | 2 +- .../builds/with-npm/api/pet.service.ts | 4 ++-- .../builds/with-npm/api/store.service.ts | 2 +- .../builds/with-npm/api/user.service.ts | 2 +- .../builds/default/api/pet.service.ts | 4 ++-- .../builds/default/api/store.service.ts | 2 +- .../builds/default/api/user.service.ts | 2 +- .../builds/with-npm/api/pet.service.ts | 4 ++-- .../builds/with-npm/api/store.service.ts | 2 +- .../builds/with-npm/api/user.service.ts | 2 +- .../builds/default/api/pet.service.ts | 4 ++-- .../builds/default/api/store.service.ts | 2 +- .../builds/default/api/user.service.ts | 2 +- .../builds/with-npm/api/pet.service.ts | 4 ++-- .../builds/with-npm/api/store.service.ts | 2 +- .../builds/with-npm/api/user.service.ts | 2 +- .../builds/default/api/pet.service.ts | 4 ++-- .../builds/default/api/store.service.ts | 2 +- .../builds/default/api/user.service.ts | 2 +- .../builds/with-npm/api/pet.service.ts | 4 ++-- .../builds/with-npm/api/store.service.ts | 2 +- .../builds/with-npm/api/user.service.ts | 2 +- .../builds/single-request-parameter/api/pet.service.ts | 4 ++-- .../builds/single-request-parameter/api/store.service.ts | 2 +- .../builds/single-request-parameter/api/user.service.ts | 2 +- .../builds/with-npm/api/pet.service.ts | 4 ++-- .../builds/with-npm/api/store.service.ts | 2 +- .../builds/with-npm/api/user.service.ts | 2 +- .../builds/with-prefixed-module-name/api/pet.service.ts | 4 ++-- .../builds/with-prefixed-module-name/api/store.service.ts | 2 +- .../builds/with-prefixed-module-name/api/user.service.ts | 2 +- 54 files changed, 71 insertions(+), 70 deletions(-) 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 67528278944..fc0f886c1df 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 @@ -451,6 +451,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode // Add additional filename information for model imports in the services List> imports = (List>) operations.get("imports"); for (Map im : imports) { + // This property is not used in the templates any more, subject for removal im.put("filename", im.get("import")); im.put("classname", im.get("classname")); } diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index 9682a0c7447..87cadfeffd0 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -24,7 +24,7 @@ import '../rxjs-operators'; {{/useHttpClient}} {{#imports}} -import { {{classname}} } from '../{{filename}}'; +import { {{classname}} } from '../model/models'; {{/imports}} import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache index 9f2f19a8129..f300098fc8e 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/apiInterface.mustache @@ -14,7 +14,7 @@ import { Observable } from 'rxjs'; {{/useRxJS6}} {{#imports}} -import { {{classname}} } from '../{{filename}}'; +import { {{classname}} } from '../model/models'; {{/imports}} diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index 6c550afa6c7..b3e2c36aff6 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -19,8 +19,8 @@ import { CustomQueryEncoderHelper } from '../encoder'; import { Observable } from 'rxjs/Observable'; import '../rxjs-operators'; -import { ApiResponse } from '../model/apiResponse'; -import { Pet } from '../model/pet'; +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index 6168be9b6e4..8a1423204db 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -19,7 +19,7 @@ import { CustomQueryEncoderHelper } from '../encoder'; import { Observable } from 'rxjs/Observable'; import '../rxjs-operators'; -import { Order } from '../model/order'; +import { Order } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index 526147a1361..f2645795095 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -19,7 +19,7 @@ import { CustomQueryEncoderHelper } from '../encoder'; import { Observable } from 'rxjs/Observable'; import '../rxjs-operators'; -import { User } from '../model/user'; +import { User } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index 6c550afa6c7..b3e2c36aff6 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -19,8 +19,8 @@ import { CustomQueryEncoderHelper } from '../encoder'; import { Observable } from 'rxjs/Observable'; import '../rxjs-operators'; -import { ApiResponse } from '../model/apiResponse'; -import { Pet } from '../model/pet'; +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index 6168be9b6e4..8a1423204db 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -19,7 +19,7 @@ import { CustomQueryEncoderHelper } from '../encoder'; import { Observable } from 'rxjs/Observable'; import '../rxjs-operators'; -import { Order } from '../model/order'; +import { Order } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index 526147a1361..f2645795095 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -19,7 +19,7 @@ import { CustomQueryEncoderHelper } from '../encoder'; import { Observable } from 'rxjs/Observable'; import '../rxjs-operators'; -import { User } from '../model/user'; +import { User } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index 76fa4937370..465d6937c64 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -19,8 +19,8 @@ import { CustomQueryEncoderHelper } from '../encoder'; import { Observable } from 'rxjs/Observable'; import '../rxjs-operators'; -import { ApiResponse } from '../model/apiResponse'; -import { Pet } from '../model/pet'; +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.serviceInterface.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.serviceInterface.ts index 281ca0c65c3..d9b47a3c480 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.serviceInterface.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.serviceInterface.ts @@ -13,8 +13,8 @@ import { Headers } from '@angular/http import { Observable } from 'rxjs/Observable'; -import { ApiResponse } from '../model/apiResponse'; -import { Pet } from '../model/pet'; +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index ab60c271c7d..915597477ef 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -19,7 +19,7 @@ import { CustomQueryEncoderHelper } from '../encoder'; import { Observable } from 'rxjs/Observable'; import '../rxjs-operators'; -import { Order } from '../model/order'; +import { Order } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.serviceInterface.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.serviceInterface.ts index 39296ccb7e1..07102421434 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.serviceInterface.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.serviceInterface.ts @@ -13,7 +13,7 @@ import { Headers } from '@angular/http import { Observable } from 'rxjs/Observable'; -import { Order } from '../model/order'; +import { Order } from '../model/models'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index 20909bc6a51..21ca1cc6335 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -19,7 +19,7 @@ import { CustomQueryEncoderHelper } from '../encoder'; import { Observable } from 'rxjs/Observable'; import '../rxjs-operators'; -import { User } from '../model/user'; +import { User } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.serviceInterface.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.serviceInterface.ts index ba857806fba..4122dcaae40 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.serviceInterface.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.serviceInterface.ts @@ -13,7 +13,7 @@ import { Headers } from '@angular/http import { Observable } from 'rxjs/Observable'; -import { User } from '../model/user'; +import { User } from '../model/models'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts index 1b73575c4bd..8426b43a3af 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts @@ -17,8 +17,8 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs/Observable'; -import { ApiResponse } from '../model/apiResponse'; -import { Pet } from '../model/pet'; +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts index 5265ec4464a..633f00b1d6e 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs/Observable'; -import { Order } from '../model/order'; +import { Order } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts index 24ba9cb94cf..9eea4e0e3dc 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs/Observable'; -import { User } from '../model/user'; +import { User } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts index 6c550afa6c7..b3e2c36aff6 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts @@ -19,8 +19,8 @@ import { CustomQueryEncoderHelper } from '../encoder'; import { Observable } from 'rxjs/Observable'; import '../rxjs-operators'; -import { ApiResponse } from '../model/apiResponse'; -import { Pet } from '../model/pet'; +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts index 6168be9b6e4..8a1423204db 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts @@ -19,7 +19,7 @@ import { CustomQueryEncoderHelper } from '../encoder'; import { Observable } from 'rxjs/Observable'; import '../rxjs-operators'; -import { Order } from '../model/order'; +import { Order } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts index 526147a1361..f2645795095 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts @@ -19,7 +19,7 @@ import { CustomQueryEncoderHelper } from '../encoder'; import { Observable } from 'rxjs/Observable'; import '../rxjs-operators'; -import { User } from '../model/user'; +import { User } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts index 49865a3d370..dc1719750f1 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts @@ -17,8 +17,8 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { ApiResponse } from '../model/apiResponse'; -import { Pet } from '../model/pet'; +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts index 594b4e9df35..af2d5a127a9 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { Order } from '../model/order'; +import { Order } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts index 00cb3a60312..c4ea31b4787 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { User } from '../model/user'; +import { User } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts index 49865a3d370..dc1719750f1 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -17,8 +17,8 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { ApiResponse } from '../model/apiResponse'; -import { Pet } from '../model/pet'; +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts index 594b4e9df35..af2d5a127a9 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { Order } from '../model/order'; +import { Order } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts index 00cb3a60312..c4ea31b4787 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { User } from '../model/user'; +import { User } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts index f11d19b64df..fc90178d82f 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts @@ -17,8 +17,8 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { ApiResponse } from '../model/apiResponse'; -import { Pet } from '../model/pet'; +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts index e5cca603af8..2ce18a1079b 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { Order } from '../model/order'; +import { Order } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts index e4a83db33b1..6e5337b51d1 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { User } from '../model/user'; +import { User } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts index f11d19b64df..fc90178d82f 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts @@ -17,8 +17,8 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { ApiResponse } from '../model/apiResponse'; -import { Pet } from '../model/pet'; +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts index e5cca603af8..2ce18a1079b 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { Order } from '../model/order'; +import { Order } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts index e4a83db33b1..6e5337b51d1 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { User } from '../model/user'; +import { User } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts index 49865a3d370..dc1719750f1 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts @@ -17,8 +17,8 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { ApiResponse } from '../model/apiResponse'; -import { Pet } from '../model/pet'; +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts index 594b4e9df35..af2d5a127a9 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { Order } from '../model/order'; +import { Order } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts index 00cb3a60312..c4ea31b4787 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { User } from '../model/user'; +import { User } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts index 49865a3d370..dc1719750f1 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -17,8 +17,8 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { ApiResponse } from '../model/apiResponse'; -import { Pet } from '../model/pet'; +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts index 594b4e9df35..af2d5a127a9 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { Order } from '../model/order'; +import { Order } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts index 00cb3a60312..c4ea31b4787 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { User } from '../model/user'; +import { User } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts index f11d19b64df..fc90178d82f 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts @@ -17,8 +17,8 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { ApiResponse } from '../model/apiResponse'; -import { Pet } from '../model/pet'; +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts index e5cca603af8..2ce18a1079b 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { Order } from '../model/order'; +import { Order } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts index e4a83db33b1..6e5337b51d1 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { User } from '../model/user'; +import { User } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts index f11d19b64df..fc90178d82f 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts @@ -17,8 +17,8 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { ApiResponse } from '../model/apiResponse'; -import { Pet } from '../model/pet'; +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts index e5cca603af8..2ce18a1079b 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { Order } from '../model/order'; +import { Order } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts index e4a83db33b1..6e5337b51d1 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { User } from '../model/user'; +import { User } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts index f3722d434cc..f429414093f 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts @@ -17,8 +17,8 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { ApiResponse } from '../model/apiResponse'; -import { Pet } from '../model/pet'; +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts index 47658366d4e..1e66b9a6bb8 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { Order } from '../model/order'; +import { Order } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts index 10c54226525..b5ba06f79c3 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { User } from '../model/user'; +import { User } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts index f11d19b64df..fc90178d82f 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts @@ -17,8 +17,8 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { ApiResponse } from '../model/apiResponse'; -import { Pet } from '../model/pet'; +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts index e5cca603af8..2ce18a1079b 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { Order } from '../model/order'; +import { Order } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts index e4a83db33b1..6e5337b51d1 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { User } from '../model/user'; +import { User } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts index f11d19b64df..fc90178d82f 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts @@ -17,8 +17,8 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { ApiResponse } from '../model/apiResponse'; -import { Pet } from '../model/pet'; +import { ApiResponse } from '../model/models'; +import { Pet } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts index e5cca603af8..2ce18a1079b 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { Order } from '../model/order'; +import { Order } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts index e4a83db33b1..6e5337b51d1 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts @@ -17,7 +17,7 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { User } from '../model/user'; +import { User } from '../model/models'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; From f152a22094020e7457face6f0cf09ff030702404 Mon Sep 17 00:00:00 2001 From: Hui Yu Date: Wed, 29 Jan 2020 08:34:51 +0800 Subject: [PATCH 40/85] [C-libcurl] Add object.c to CMakeLists to compile (#5130) * [C-libcurl] Add object.c to CMakeLists to compile * [C-libcurl] Add object.h/object.c to CMakeLists of sample --- .../src/main/resources/C-libcurl/CMakeLists.txt.mustache | 2 ++ samples/client/petstore/c/CMakeLists.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache index 060f8f75eb3..76c0470f008 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache @@ -23,6 +23,7 @@ set(SRCS src/apiKey.c src/apiClient.c external/cJSON.c + model/object.c {{#models}} {{#model}} model/{{classname}}.c @@ -43,6 +44,7 @@ set(HDRS include/list.h include/keyValuePair.h external/cJSON.h + model/object.h {{#models}} {{#model}} model/{{classname}}.h diff --git a/samples/client/petstore/c/CMakeLists.txt b/samples/client/petstore/c/CMakeLists.txt index e685f785dde..98454803ef5 100644 --- a/samples/client/petstore/c/CMakeLists.txt +++ b/samples/client/petstore/c/CMakeLists.txt @@ -23,6 +23,7 @@ set(SRCS src/apiKey.c src/apiClient.c external/cJSON.c + model/object.c model/api_response.c model/category.c model/order.c @@ -40,6 +41,7 @@ set(HDRS include/list.h include/keyValuePair.h external/cJSON.h + model/object.h model/api_response.h model/category.h model/order.h From d627282e890d1b82de5285e99643ce1f3c1ff196 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Tue, 28 Jan 2020 20:29:10 -0500 Subject: [PATCH 41/85] [go] Allow user overrides for generated outputs (#5132) --- .../codegen/languages/GoGinServerCodegen.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoGinServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoGinServerCodegen.java index 632d4c3eb26..7d0d0990acc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoGinServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoGinServerCodegen.java @@ -131,16 +131,30 @@ public class GoGinServerCodegen extends AbstractGoCodegen { setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); } else { setPackageName("openapi"); + additionalProperties.put(CodegenConstants.PACKAGE_NAME, this.packageName); } /* * Additional Properties. These values can be passed to the templates and * are available in models, apis, and supporting files */ - additionalProperties.put("apiVersion", apiVersion); - additionalProperties.put("serverPort", serverPort); - additionalProperties.put("apiPath", apiPath); - additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); + if (additionalProperties.containsKey("apiVersion")) { + this.apiVersion = (String)additionalProperties.get("apiVersion"); + } else { + additionalProperties.put("apiVersion", apiVersion); + } + + if (additionalProperties.containsKey("serverPort")) { + this.serverPort = Integer.parseInt((String)additionalProperties.get("serverPort")); + } else { + additionalProperties.put("serverPort", serverPort); + } + + if (additionalProperties.containsKey("apiPath")) { + this.apiPath = (String)additionalProperties.get("apiPath"); + } else { + additionalProperties.put("apiPath", apiPath); + } modelPackage = packageName; apiPackage = packageName; From 15345e1620dcbaaff9de4a0a3482e9ffc5255c3a Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Tue, 28 Jan 2020 21:58:11 -0800 Subject: [PATCH 42/85] [python] Cleanup ThreadPool with atexit rather than __del__ (#5094) * [python] Cleanup ThreadPool with atexit rather than __del__ This removes the `__del__` function from the generated Python client, and replaces it with a `cleanup` function. When a ThreadPool is created, the cleanup function is registered with the `atexit` module. This fixes #5093, where the API client could hang indefinitely at garbage collection. * Update petstore examples * Test to ensure threadpool is cleaned up * Docs now encourage using the context manager * Regenerate docs * Update samples --- .../main/resources/python/api_client.mustache | 12 +- .../resources/python/api_doc_example.mustache | 32 +- .../resources/python/common_README.mustache | 24 +- .../README_common.mustache | 24 +- .../python-experimental/api_client.mustache | 12 +- .../api_doc_example.mustache | 86 ++-- .../client/petstore/python-asyncio/README.md | 22 +- .../python-asyncio/docs/AnotherFakeApi.md | 20 +- .../petstore/python-asyncio/docs/FakeApi.md | 248 ++++++------ .../docs/FakeClassnameTags123Api.md | 20 +- .../petstore/python-asyncio/docs/PetApi.md | 172 ++++---- .../petstore/python-asyncio/docs/StoreApi.md | 78 ++-- .../petstore/python-asyncio/docs/UserApi.md | 148 +++---- .../python-asyncio/petstore_api/api_client.py | 12 +- .../petstore/python-experimental/README.md | 22 +- .../docs/AnotherFakeApi.md | 24 +- .../python-experimental/docs/FakeApi.md | 366 ++++++++++-------- .../docs/FakeClassnameTags123Api.md | 24 +- .../python-experimental/docs/PetApi.md | 270 +++++++------ .../python-experimental/docs/StoreApi.md | 92 +++-- .../python-experimental/docs/UserApi.md | 182 +++++---- .../petstore_api/api_client.py | 12 +- .../tests/test_api_client.py | 16 + .../client/petstore/python-tornado/README.md | 22 +- .../python-tornado/docs/AnotherFakeApi.md | 20 +- .../petstore/python-tornado/docs/FakeApi.md | 248 ++++++------ .../docs/FakeClassnameTags123Api.md | 20 +- .../petstore/python-tornado/docs/PetApi.md | 172 ++++---- .../petstore/python-tornado/docs/StoreApi.md | 78 ++-- .../petstore/python-tornado/docs/UserApi.md | 148 +++---- .../python-tornado/petstore_api/api_client.py | 12 +- samples/client/petstore/python/README.md | 22 +- .../petstore/python/docs/AnotherFakeApi.md | 20 +- .../client/petstore/python/docs/FakeApi.md | 248 ++++++------ .../python/docs/FakeClassnameTags123Api.md | 20 +- samples/client/petstore/python/docs/PetApi.md | 172 ++++---- .../client/petstore/python/docs/StoreApi.md | 78 ++-- .../client/petstore/python/docs/UserApi.md | 148 +++---- .../python/petstore_api/api_client.py | 12 +- .../petstore/python/tests/test_api_client.py | 16 + .../petstore/python-experimental/README.md | 22 +- .../docs/AnotherFakeApi.md | 24 +- .../python-experimental/docs/DefaultApi.md | 20 +- .../python-experimental/docs/FakeApi.md | 354 +++++++++-------- .../docs/FakeClassnameTags123Api.md | 24 +- .../python-experimental/docs/PetApi.md | 270 +++++++------ .../python-experimental/docs/StoreApi.md | 92 +++-- .../python-experimental/docs/UserApi.md | 182 +++++---- .../petstore_api/api_client.py | 12 +- .../openapi3/client/petstore/python/README.md | 22 +- .../petstore/python/docs/AnotherFakeApi.md | 20 +- .../client/petstore/python/docs/DefaultApi.md | 18 +- .../client/petstore/python/docs/FakeApi.md | 250 ++++++------ .../python/docs/FakeClassnameTags123Api.md | 20 +- .../client/petstore/python/docs/PetApi.md | 172 ++++---- .../client/petstore/python/docs/StoreApi.md | 78 ++-- .../client/petstore/python/docs/UserApi.md | 148 +++---- .../python/petstore_api/api_client.py | 12 +- 58 files changed, 2850 insertions(+), 2264 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 8297ad57984..08de3bab85e 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -2,6 +2,7 @@ {{>partial_header}} from __future__ import absolute_import +import atexit import datetime from dateutil.parser import parse import json @@ -75,11 +76,19 @@ class ApiClient(object): self.user_agent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/httpUserAgent}}' self.client_side_validation = configuration.client_side_validation - def __del__(self): + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): if self._pool: self._pool.close() self._pool.join() self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) @property def pool(self): @@ -87,6 +96,7 @@ class ApiClient(object): avoids instantiating unused threadpool for blocking clients. """ if self._pool is None: + atexit.register(self.close) self._pool = ThreadPool(self.pool_threads) return self._pool diff --git a/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache b/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache index f2d6117a7ce..e86c5d6011c 100644 --- a/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_doc_example.mustache @@ -8,22 +8,26 @@ from pprint import pprint {{#hasAuthMethods}} # Defining host is optional and default to {{{basePath}}} configuration.host = "{{{basePath}}}" -# Create an instance of the API class -api_instance = {{{packageName}}}.{{{classname}}}({{{packageName}}}.ApiClient(configuration)) -{{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} -{{/allParams}} +# Enter a context with an instance of the API client +with {{{packageName}}}.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = {{{packageName}}}.{{{classname}}}(api_client) + {{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/allParams}} {{/hasAuthMethods}} {{^hasAuthMethods}} -# Create an instance of the API class -api_instance = {{{packageName}}}.{{{classname}}}() -{{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} -{{/allParams}} +# Enter a context with an instance of the API client +with {{{packageName}}}.ApiClient() as api_client: + # Create an instance of the API class + api_instance = {{{packageName}}}.{{{classname}}}(api_client) + {{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/allParams}} {{/hasAuthMethods}} -try: -{{#summary}} # {{{.}}} -{{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}} - pprint(api_response){{/returnType}} -except ApiException as e: - print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) + try: + {{#summary}} # {{{.}}} + {{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}} + pprint(api_response){{/returnType}} + except ApiException as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) ``` diff --git a/modules/openapi-generator/src/main/resources/python/common_README.mustache b/modules/openapi-generator/src/main/resources/python/common_README.mustache index 7de8c9ef098..991002aa17c 100644 --- a/modules/openapi-generator/src/main/resources/python/common_README.mustache +++ b/modules/openapi-generator/src/main/resources/python/common_README.mustache @@ -8,18 +8,20 @@ from pprint import pprint {{> python_doc_auth_partial}} # Defining host is optional and default to {{{basePath}}} configuration.host = "{{{basePath}}}" -# Create an instance of the API class -api_instance = {{{packageName}}}.{{{classname}}}({{{packageName}}}.ApiClient(configuration)) -{{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} -{{/allParams}} +# Enter a context with an instance of the API client +with {{{packageName}}}.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = {{{packageName}}}.{{{classname}}}(api_client) + {{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/allParams}} -try: -{{#summary}} # {{{.}}} -{{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}} - pprint(api_response){{/returnType}} -except ApiException as e: - print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) -{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} + try: + {{#summary}} # {{{.}}} + {{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}} + pprint(api_response){{/returnType}} + except ApiException as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) + {{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} ``` ## Documentation for API Endpoints diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache index 5fffdc74fc6..b474eb264ae 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache @@ -7,18 +7,20 @@ from pprint import pprint {{> python_doc_auth_partial}} # Defining host is optional and default to {{{basePath}}} configuration.host = "{{{basePath}}}" -# Create an instance of the API class -api_instance = {{{packageName}}}.{{{classname}}}({{{packageName}}}.ApiClient(configuration)) -{{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} -{{/allParams}} +# Enter a context with an instance of the API client +with {{{packageName}}}.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = {{{packageName}}}.{{{classname}}}(api_client) + {{#allParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/allParams}} -try: -{{#summary}} # {{{.}}} -{{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}} - pprint(api_response){{/returnType}} -except {{{packageName}}}.ApiException as e: - print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) -{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} + try: + {{#summary}} # {{{.}}} + {{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}} + pprint(api_response){{/returnType}} + except {{{packageName}}}.ApiException as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) + {{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} ``` ## Documentation for API Endpoints diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 95208961203..78f502b00db 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -3,6 +3,7 @@ from __future__ import absolute_import import json +import atexit import mimetypes from multiprocessing.pool import ThreadPool import os @@ -74,11 +75,19 @@ class ApiClient(object): # Set default User-Agent. self.user_agent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/httpUserAgent}}' - def __del__(self): + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): if self._pool: self._pool.close() self._pool.join() self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) @property def pool(self): @@ -86,6 +95,7 @@ class ApiClient(object): avoids instantiating unused threadpool for blocking clients. """ if self._pool is None: + atexit.register(self.close) self._pool = ThreadPool(self.pool_threads) return self._pool diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache index 8a6beabd2d7..565d00a3b9e 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache @@ -7,51 +7,55 @@ from pprint import pprint {{#hasAuthMethods}} # Defining host is optional and default to {{{basePath}}} configuration.host = "{{{basePath}}}" -# Create an instance of the API class -api_instance = {{{packageName}}}.{{{classname}}}({{{packageName}}}.ApiClient(configuration)) +# Enter a context with an instance of the API client +with {{{packageName}}}.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = {{{packageName}}}.{{{classname}}}(api_client) {{/hasAuthMethods}} {{^hasAuthMethods}} -# Create an instance of the API class -api_instance = {{{packageName}}}.{{{classname}}}() +# Enter a context with an instance of the API client +with {{{packageName}}}.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = {{{packageName}}}.{{{classname}}}(api_client) {{/hasAuthMethods}} -{{#requiredParams}}{{^defaultValue}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}} -{{/defaultValue}}{{/requiredParams}}{{#optionalParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}} -{{/optionalParams}} -{{#requiredParams}} -{{^hasMore}} + {{#requiredParams}}{{^defaultValue}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}} + {{/defaultValue}}{{/requiredParams}}{{#optionalParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}} + {{/optionalParams}} + {{#requiredParams}} + {{^hasMore}} -# example passing only required values which don't have defaults set -try: -{{#summary}} # {{{.}}} -{{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/defaultValue}}{{/requiredParams}}){{#returnType}} - pprint(api_response){{/returnType}} -except {{{packageName}}}.ApiException as e: - print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) -{{/hasMore}} -{{/requiredParams}} -{{#optionalParams}} -{{^hasMore}} + # example passing only required values which don't have defaults set + try: + {{#summary}} # {{{.}}} + {{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/defaultValue}}{{/requiredParams}}){{#returnType}} + pprint(api_response){{/returnType}} + except {{{packageName}}}.ApiException as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) + {{/hasMore}} + {{/requiredParams}} + {{#optionalParams}} + {{^hasMore}} -# example passing only required values which don't have defaults set -# and optional values -try: -{{#summary}} # {{{.}}} -{{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#optionalParams}}{{paramName}}={{paramName}}{{#hasMore}}, {{/hasMore}}{{/optionalParams}}){{#returnType}} - pprint(api_response){{/returnType}} -except {{{packageName}}}.ApiException as e: - print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) -{{/hasMore}} -{{/optionalParams}} -{{^requiredParams}} -{{^optionalParams}} + # example passing only required values which don't have defaults set + # and optional values + try: + {{#summary}} # {{{.}}} + {{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#optionalParams}}{{paramName}}={{paramName}}{{#hasMore}}, {{/hasMore}}{{/optionalParams}}){{#returnType}} + pprint(api_response){{/returnType}} + except {{{packageName}}}.ApiException as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) + {{/hasMore}} + {{/optionalParams}} + {{^requiredParams}} + {{^optionalParams}} -# example, this endpoint has no required or optional parameters -try: -{{#summary}} # {{{.}}} -{{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}(){{#returnType}} - pprint(api_response){{/returnType}} -except {{{packageName}}}.ApiException as e: - print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) -{{/optionalParams}} -{{/requiredParams}} + # example, this endpoint has no required or optional parameters + try: + {{#summary}} # {{{.}}} + {{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}(){{#returnType}} + pprint(api_response){{/returnType}} + except {{{packageName}}}.ApiException as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) + {{/optionalParams}} + {{/requiredParams}} ``` diff --git a/samples/client/petstore/python-asyncio/README.md b/samples/client/petstore/python-asyncio/README.md index 45618f2a086..36c0a082f3f 100644 --- a/samples/client/petstore/python-asyncio/README.md +++ b/samples/client/petstore/python-asyncio/README.md @@ -54,17 +54,19 @@ from pprint import pprint # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.AnotherFakeApi(petstore_api.ApiClient(configuration)) -body = petstore_api.Client() # Client | client model - -try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(body) - pprint(api_response) -except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.AnotherFakeApi(api_client) + body = petstore_api.Client() # Client | client model + try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(body) + pprint(api_response) + except ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) + ``` ## Documentation for API Endpoints diff --git a/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md b/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md index 3be4009a7d1..f777f0d43e6 100644 --- a/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md @@ -23,16 +23,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.AnotherFakeApi() -body = petstore_api.Client() # Client | client model +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.AnotherFakeApi(api_client) + body = petstore_api.Client() # Client | client model -try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(body) - pprint(api_response) -except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) + try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(body) + pprint(api_response) + except ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-asyncio/docs/FakeApi.md b/samples/client/petstore/python-asyncio/docs/FakeApi.md index c311c9eaf28..9ea1aa2a6b1 100644 --- a/samples/client/petstore/python-asyncio/docs/FakeApi.md +++ b/samples/client/petstore/python-asyncio/docs/FakeApi.md @@ -36,15 +36,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -xml_item = petstore_api.XmlItem() # XmlItem | XmlItem Body +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + xml_item = petstore_api.XmlItem() # XmlItem | XmlItem Body -try: - # creates an XmlItem - api_instance.create_xml_item(xml_item) -except ApiException as e: - print("Exception when calling FakeApi->create_xml_item: %s\n" % e) + try: + # creates an XmlItem + api_instance.create_xml_item(xml_item) + except ApiException as e: + print("Exception when calling FakeApi->create_xml_item: %s\n" % e) ``` ### Parameters @@ -89,15 +91,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = True # bool | Input boolean as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = True # bool | Input boolean as post body (optional) -try: - api_response = api_instance.fake_outer_boolean_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) + try: + api_response = api_instance.fake_outer_boolean_serialize(body=body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) ``` ### Parameters @@ -142,15 +146,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) -try: - api_response = api_instance.fake_outer_composite_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) + try: + api_response = api_instance.fake_outer_composite_serialize(body=body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) ``` ### Parameters @@ -195,15 +201,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = 3.4 # float | Input number as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = 3.4 # float | Input number as post body (optional) -try: - api_response = api_instance.fake_outer_number_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) + try: + api_response = api_instance.fake_outer_number_serialize(body=body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) ``` ### Parameters @@ -248,15 +256,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = 'body_example' # str | Input string as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = 'body_example' # str | Input string as post body (optional) -try: - api_response = api_instance.fake_outer_string_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) + try: + api_response = api_instance.fake_outer_string_serialize(body=body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) ``` ### Parameters @@ -301,14 +311,16 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | -try: - api_instance.test_body_with_file_schema(body) -except ApiException as e: - print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) + try: + api_instance.test_body_with_file_schema(body) + except ApiException as e: + print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) ``` ### Parameters @@ -351,15 +363,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -query = 'query_example' # str | +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + query = 'query_example' # str | body = petstore_api.User() # User | -try: - api_instance.test_body_with_query_params(query, body) -except ApiException as e: - print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) + try: + api_instance.test_body_with_query_params(query, body) + except ApiException as e: + print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) ``` ### Parameters @@ -405,16 +419,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = petstore_api.Client() # Client | client model +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = petstore_api.Client() # Client | client model -try: - # To test \"client\" model - api_response = api_instance.test_client_model(body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->test_client_model: %s\n" % e) + try: + # To test \"client\" model + api_response = api_instance.test_client_model(body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->test_client_model: %s\n" % e) ``` ### Parameters @@ -466,9 +482,11 @@ configuration.password = 'YOUR_PASSWORD' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) -number = 3.4 # float | None +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + number = 3.4 # float | None double = 3.4 # float | None pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None byte = 'byte_example' # str | None @@ -483,11 +501,11 @@ date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) password = 'password_example' # str | None (optional) param_callback = 'param_callback_example' # str | None (optional) -try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) -except ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) + try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) + except ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) ``` ### Parameters @@ -546,9 +564,11 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') @@ -557,11 +577,11 @@ enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$') enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') -try: - # To test enum parameters - api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) -except ApiException as e: - print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) + try: + # To test enum parameters + api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) + except ApiException as e: + print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) ``` ### Parameters @@ -614,20 +634,22 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -required_string_group = 56 # int | Required String in group parameters +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + required_string_group = 56 # int | Required String in group parameters required_boolean_group = True # bool | Required Boolean in group parameters required_int64_group = 56 # int | Required Integer in group parameters string_group = 56 # int | String in group parameters (optional) boolean_group = True # bool | Boolean in group parameters (optional) int64_group = 56 # int | Integer in group parameters (optional) -try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) -except ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) + try: + # Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) + except ApiException as e: + print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) ``` ### Parameters @@ -675,15 +697,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -param = {'key': 'param_example'} # dict(str, str) | request body +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + param = {'key': 'param_example'} # dict(str, str) | request body -try: - # test inline additionalProperties - api_instance.test_inline_additional_properties(param) -except ApiException as e: - print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) + try: + # test inline additionalProperties + api_instance.test_inline_additional_properties(param) + except ApiException as e: + print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) ``` ### Parameters @@ -726,16 +750,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -param = 'param_example' # str | field1 +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + param = 'param_example' # str | field1 param2 = 'param2_example' # str | field2 -try: - # test json serialization of form data - api_instance.test_json_form_data(param, param2) -except ApiException as e: - print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) + try: + # test json serialization of form data + api_instance.test_json_form_data(param, param2) + except ApiException as e: + print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) ``` ### Parameters @@ -781,18 +807,20 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -pipe = ['pipe_example'] # list[str] | +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + pipe = ['pipe_example'] # list[str] | ioutil = ['ioutil_example'] # list[str] | http = ['http_example'] # list[str] | url = ['url_example'] # list[str] | context = ['context_example'] # list[str] | -try: - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) -except ApiException as e: - print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) + try: + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) + except ApiException as e: + print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md index 2fae5e0c776..3ea79928f2a 100644 --- a/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md @@ -31,16 +31,18 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) -body = petstore_api.Client() # Client | client model +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeClassnameTags123Api(api_client) + body = petstore_api.Client() # Client | client model -try: - # To test class name in snake case - api_response = api_instance.test_classname(body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) + try: + # To test class name in snake case + api_response = api_instance.test_classname(body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-asyncio/docs/PetApi.md b/samples/client/petstore/python-asyncio/docs/PetApi.md index e4df08ee37a..45129d6d620 100644 --- a/samples/client/petstore/python-asyncio/docs/PetApi.md +++ b/samples/client/petstore/python-asyncio/docs/PetApi.md @@ -35,15 +35,17 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store -try: - # Add a new pet to the store - api_instance.add_pet(body) -except ApiException as e: - print("Exception when calling PetApi->add_pet: %s\n" % e) + try: + # Add a new pet to the store + api_instance.add_pet(body) + except ApiException as e: + print("Exception when calling PetApi->add_pet: %s\n" % e) ``` ### Parameters @@ -93,16 +95,18 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | Pet id to delete +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | Pet id to delete api_key = 'api_key_example' # str | (optional) -try: - # Deletes a pet - api_instance.delete_pet(pet_id, api_key=api_key) -except ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) + try: + # Deletes a pet + api_instance.delete_pet(pet_id, api_key=api_key) + except ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) ``` ### Parameters @@ -155,16 +159,18 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -status = ['status_example'] # list[str] | Status values that need to be considered for filter +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + status = ['status_example'] # list[str] | Status values that need to be considered for filter -try: - # Finds Pets by status - api_response = api_instance.find_pets_by_status(status) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) + try: + # Finds Pets by status + api_response = api_instance.find_pets_by_status(status) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) ``` ### Parameters @@ -216,16 +222,18 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -tags = ['tags_example'] # list[str] | Tags to filter by +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + tags = ['tags_example'] # list[str] | Tags to filter by -try: - # Finds Pets by tags - api_response = api_instance.find_pets_by_tags(tags) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) + try: + # Finds Pets by tags + api_response = api_instance.find_pets_by_tags(tags) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) ``` ### Parameters @@ -279,16 +287,18 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to return +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to return -try: - # Find pet by ID - api_response = api_instance.get_pet_by_id(pet_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) + try: + # Find pet by ID + api_response = api_instance.get_pet_by_id(pet_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) ``` ### Parameters @@ -339,15 +349,17 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store -try: - # Update an existing pet - api_instance.update_pet(body) -except ApiException as e: - print("Exception when calling PetApi->update_pet: %s\n" % e) + try: + # Update an existing pet + api_instance.update_pet(body) + except ApiException as e: + print("Exception when calling PetApi->update_pet: %s\n" % e) ``` ### Parameters @@ -399,17 +411,19 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet that needs to be updated +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet that needs to be updated name = 'name_example' # str | Updated name of the pet (optional) status = 'status_example' # str | Updated status of the pet (optional) -try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id, name=name, status=status) -except ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) + try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id, name=name, status=status) + except ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) ``` ### Parameters @@ -460,18 +474,20 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to update +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to update additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) file = '/path/to/file' # file | file to upload (optional) -try: - # uploads an image - api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->upload_file: %s\n" % e) + try: + # uploads an image + api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) ``` ### Parameters @@ -522,18 +538,20 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to update +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to update required_file = '/path/to/file' # file | file to upload additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) -try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) + try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-asyncio/docs/StoreApi.md b/samples/client/petstore/python-asyncio/docs/StoreApi.md index a2f4ece3e3f..285953422d2 100644 --- a/samples/client/petstore/python-asyncio/docs/StoreApi.md +++ b/samples/client/petstore/python-asyncio/docs/StoreApi.md @@ -26,15 +26,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -order_id = 'order_id_example' # str | ID of the order that needs to be deleted +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + order_id = 'order_id_example' # str | ID of the order that needs to be deleted -try: - # Delete purchase order by ID - api_instance.delete_order(order_id) -except ApiException as e: - print("Exception when calling StoreApi->delete_order: %s\n" % e) + try: + # Delete purchase order by ID + api_instance.delete_order(order_id) + except ApiException as e: + print("Exception when calling StoreApi->delete_order: %s\n" % e) ``` ### Parameters @@ -88,15 +90,17 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) - -try: - # Returns pet inventories by status - api_response = api_instance.get_inventory() - pprint(api_response) -except ApiException as e: - print("Exception when calling StoreApi->get_inventory: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + + try: + # Returns pet inventories by status + api_response = api_instance.get_inventory() + pprint(api_response) + except ApiException as e: + print("Exception when calling StoreApi->get_inventory: %s\n" % e) ``` ### Parameters @@ -138,16 +142,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -order_id = 56 # int | ID of pet that needs to be fetched +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + order_id = 56 # int | ID of pet that needs to be fetched -try: - # Find purchase order by ID - api_response = api_instance.get_order_by_id(order_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) + try: + # Find purchase order by ID + api_response = api_instance.get_order_by_id(order_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) ``` ### Parameters @@ -192,16 +198,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -body = petstore_api.Order() # Order | order placed for purchasing the pet +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + body = petstore_api.Order() # Order | order placed for purchasing the pet -try: - # Place an order for a pet - api_response = api_instance.place_order(body) - pprint(api_response) -except ApiException as e: - print("Exception when calling StoreApi->place_order: %s\n" % e) + try: + # Place an order for a pet + api_response = api_instance.place_order(body) + pprint(api_response) + except ApiException as e: + print("Exception when calling StoreApi->place_order: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-asyncio/docs/UserApi.md b/samples/client/petstore/python-asyncio/docs/UserApi.md index 3ea4a2ef605..1d69ee7aa6e 100644 --- a/samples/client/petstore/python-asyncio/docs/UserApi.md +++ b/samples/client/petstore/python-asyncio/docs/UserApi.md @@ -30,15 +30,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -body = petstore_api.User() # User | Created user object +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + body = petstore_api.User() # User | Created user object -try: - # Create user - api_instance.create_user(body) -except ApiException as e: - print("Exception when calling UserApi->create_user: %s\n" % e) + try: + # Create user + api_instance.create_user(body) + except ApiException as e: + print("Exception when calling UserApi->create_user: %s\n" % e) ``` ### Parameters @@ -81,15 +83,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -body = [petstore_api.User()] # list[User] | List of user object +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + body = [petstore_api.User()] # list[User] | List of user object -try: - # Creates list of users with given input array - api_instance.create_users_with_array_input(body) -except ApiException as e: - print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) + try: + # Creates list of users with given input array + api_instance.create_users_with_array_input(body) + except ApiException as e: + print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) ``` ### Parameters @@ -132,15 +136,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -body = [petstore_api.User()] # list[User] | List of user object +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + body = [petstore_api.User()] # list[User] | List of user object -try: - # Creates list of users with given input array - api_instance.create_users_with_list_input(body) -except ApiException as e: - print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) + try: + # Creates list of users with given input array + api_instance.create_users_with_list_input(body) + except ApiException as e: + print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) ``` ### Parameters @@ -185,15 +191,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The name that needs to be deleted +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The name that needs to be deleted -try: - # Delete user - api_instance.delete_user(username) -except ApiException as e: - print("Exception when calling UserApi->delete_user: %s\n" % e) + try: + # Delete user + api_instance.delete_user(username) + except ApiException as e: + print("Exception when calling UserApi->delete_user: %s\n" % e) ``` ### Parameters @@ -237,16 +245,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. -try: - # Get user by user name - api_response = api_instance.get_user_by_name(username) - pprint(api_response) -except ApiException as e: - print("Exception when calling UserApi->get_user_by_name: %s\n" % e) + try: + # Get user by user name + api_response = api_instance.get_user_by_name(username) + pprint(api_response) + except ApiException as e: + print("Exception when calling UserApi->get_user_by_name: %s\n" % e) ``` ### Parameters @@ -291,17 +301,19 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The user name for login +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The user name for login password = 'password_example' # str | The password for login in clear text -try: - # Logs user into the system - api_response = api_instance.login_user(username, password) - pprint(api_response) -except ApiException as e: - print("Exception when calling UserApi->login_user: %s\n" % e) + try: + # Logs user into the system + api_response = api_instance.login_user(username, password) + pprint(api_response) + except ApiException as e: + print("Exception when calling UserApi->login_user: %s\n" % e) ``` ### Parameters @@ -346,14 +358,16 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() - -try: - # Logs out current logged in user session - api_instance.logout_user() -except ApiException as e: - print("Exception when calling UserApi->logout_user: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + + try: + # Logs out current logged in user session + api_instance.logout_user() + except ApiException as e: + print("Exception when calling UserApi->logout_user: %s\n" % e) ``` ### Parameters @@ -395,16 +409,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | name that need to be deleted +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | name that need to be deleted body = petstore_api.User() # User | Updated user object -try: - # Updated user - api_instance.update_user(username, body) -except ApiException as e: - print("Exception when calling UserApi->update_user: %s\n" % e) + try: + # Updated user + api_instance.update_user(username, body) + except ApiException as e: + print("Exception when calling UserApi->update_user: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-asyncio/petstore_api/api_client.py b/samples/client/petstore/python-asyncio/petstore_api/api_client.py index c5cdf86f9a5..7b8cb7dc239 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api_client.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api_client.py @@ -10,6 +10,7 @@ from __future__ import absolute_import +import atexit import datetime from dateutil.parser import parse import json @@ -80,11 +81,19 @@ class ApiClient(object): self.user_agent = 'OpenAPI-Generator/1.0.0/python' self.client_side_validation = configuration.client_side_validation - def __del__(self): + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): if self._pool: self._pool.close() self._pool.join() self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) @property def pool(self): @@ -92,6 +101,7 @@ class ApiClient(object): avoids instantiating unused threadpool for blocking clients. """ if self._pool is None: + atexit.register(self.close) self._pool = ThreadPool(self.pool_threads) return self._pool diff --git a/samples/client/petstore/python-experimental/README.md b/samples/client/petstore/python-experimental/README.md index 03fc1cca792..f64e70f79da 100644 --- a/samples/client/petstore/python-experimental/README.md +++ b/samples/client/petstore/python-experimental/README.md @@ -53,17 +53,19 @@ from pprint import pprint # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.AnotherFakeApi(petstore_api.ApiClient(configuration)) -body = petstore_api.Client() # client.Client | client model - -try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(body) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.AnotherFakeApi(api_client) + body = petstore_api.Client() # client.Client | client model + try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) + ``` ## Documentation for API Endpoints diff --git a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md index 75406ffa107..cd0e35819a1 100644 --- a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -22,17 +22,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.AnotherFakeApi() -body = petstore_api.Client() # client.Client | client model - -# example passing only required values which don't have defaults set -try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(body) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.AnotherFakeApi(api_client) + body = petstore_api.Client() # client.Client | client model + + # example passing only required values which don't have defaults set + try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-experimental/docs/FakeApi.md b/samples/client/petstore/python-experimental/docs/FakeApi.md index 50e291f0261..bbe8aaccecd 100644 --- a/samples/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/client/petstore/python-experimental/docs/FakeApi.md @@ -36,16 +36,18 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -xml_item = petstore_api.XmlItem() # xml_item.XmlItem | XmlItem Body - -# example passing only required values which don't have defaults set -try: - # creates an XmlItem - api_instance.create_xml_item(xml_item) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->create_xml_item: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + xml_item = petstore_api.XmlItem() # xml_item.XmlItem | XmlItem Body + + # example passing only required values which don't have defaults set + try: + # creates an XmlItem + api_instance.create_xml_item(xml_item) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->create_xml_item: %s\n" % e) ``` ### Parameters @@ -89,17 +91,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = True # bool | Input boolean as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = True # bool | Input boolean as post body (optional) -# example passing only required values which don't have defaults set -# and optional values -try: - api_response = api_instance.fake_outer_boolean_serialize(body=body) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.fake_outer_boolean_serialize(body=body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) ``` ### Parameters @@ -143,17 +147,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = petstore_api.OuterComposite() # outer_composite.OuterComposite | Input composite as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = petstore_api.OuterComposite() # outer_composite.OuterComposite | Input composite as post body (optional) -# example passing only required values which don't have defaults set -# and optional values -try: - api_response = api_instance.fake_outer_composite_serialize(body=body) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.fake_outer_composite_serialize(body=body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) ``` ### Parameters @@ -197,17 +203,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = petstore_api.OuterEnum("placed") # outer_enum.OuterEnum | Input enum as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = petstore_api.OuterEnum("placed") # outer_enum.OuterEnum | Input enum as post body (optional) -# example passing only required values which don't have defaults set -# and optional values -try: - api_response = api_instance.fake_outer_enum_serialize(body=body) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_outer_enum_serialize: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.fake_outer_enum_serialize(body=body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_outer_enum_serialize: %s\n" % e) ``` ### Parameters @@ -251,17 +259,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = petstore_api.OuterNumber(3.4) # outer_number.OuterNumber | Input number as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = petstore_api.OuterNumber(3.4) # outer_number.OuterNumber | Input number as post body (optional) -# example passing only required values which don't have defaults set -# and optional values -try: - api_response = api_instance.fake_outer_number_serialize(body=body) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.fake_outer_number_serialize(body=body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) ``` ### Parameters @@ -305,17 +315,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = 'body_example' # str | Input string as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = 'body_example' # str | Input string as post body (optional) -# example passing only required values which don't have defaults set -# and optional values -try: - api_response = api_instance.fake_outer_string_serialize(body=body) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.fake_outer_string_serialize(body=body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) ``` ### Parameters @@ -359,15 +371,17 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = petstore_api.FileSchemaTestClass() # file_schema_test_class.FileSchemaTestClass | - -# example passing only required values which don't have defaults set -try: - api_instance.test_body_with_file_schema(body) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = petstore_api.FileSchemaTestClass() # file_schema_test_class.FileSchemaTestClass | + + # example passing only required values which don't have defaults set + try: + api_instance.test_body_with_file_schema(body) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) ``` ### Parameters @@ -409,16 +423,18 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -query = 'query_example' # str | -body = petstore_api.User() # user.User | - -# example passing only required values which don't have defaults set -try: - api_instance.test_body_with_query_params(query, body) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + query = 'query_example' # str | + body = petstore_api.User() # user.User | + + # example passing only required values which don't have defaults set + try: + api_instance.test_body_with_query_params(query, body) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) ``` ### Parameters @@ -463,17 +479,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = petstore_api.Client() # client.Client | client model - -# example passing only required values which don't have defaults set -try: - # To test \"client\" model - api_response = api_instance.test_client_model(body) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_client_model: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = petstore_api.Client() # client.Client | client model + + # example passing only required values which don't have defaults set + try: + # To test \"client\" model + api_response = api_instance.test_client_model(body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_client_model: %s\n" % e) ``` ### Parameters @@ -517,14 +535,16 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() - -# example passing only required values which don't have defaults set -try: - api_instance.test_endpoint_enums_length_one() -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_endpoint_enums_length_one: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + + # example passing only required values which don't have defaults set + try: + api_instance.test_endpoint_enums_length_one() + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_endpoint_enums_length_one: %s\n" % e) ``` ### Parameters @@ -579,13 +599,15 @@ configuration.password = 'YOUR_PASSWORD' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) -number = 3.4 # float | None -double = 3.4 # float | None -pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None -byte = 'byte_example' # str | None -integer = 56 # int | None (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + number = 3.4 # float | None + double = 3.4 # float | None + pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None + byte = 'byte_example' # str | None + integer = 56 # int | None (optional) int32 = 56 # int | None (optional) int64 = 56 # int | None (optional) float = 3.4 # float | None (optional) @@ -596,20 +618,20 @@ date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) password = 'password_example' # str | None (optional) param_callback = 'param_callback_example' # str | None (optional) -# example passing only required values which don't have defaults set -try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) + # example passing only required values which don't have defaults set + try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) -# example passing only required values which don't have defaults set -# and optional values -try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) ``` ### Parameters @@ -667,9 +689,11 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -enum_header_string_array = ['enum_header_string_array_example'] # [str] | Header parameter enum test (string array) (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + enum_header_string_array = ['enum_header_string_array_example'] # [str] | Header parameter enum test (string array) (optional) enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) if omitted the server will use the default value of '-efg' enum_query_string_array = ['enum_query_string_array_example'] # [str] | Query parameter enum test (string array) (optional) enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) if omitted the server will use the default value of '-efg' @@ -678,13 +702,13 @@ enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) enum_form_string_array = '$' # [str] | Form parameter enum test (string array) (optional) if omitted the server will use the default value of '$' enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) if omitted the server will use the default value of '-efg' -# example passing only required values which don't have defaults set -# and optional values -try: - # To test enum parameters - api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + # To test enum parameters + api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) ``` ### Parameters @@ -736,29 +760,31 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -required_string_group = 56 # int | Required String in group parameters -required_boolean_group = True # bool | Required Boolean in group parameters -required_int64_group = 56 # int | Required Integer in group parameters -string_group = 56 # int | String in group parameters (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + required_string_group = 56 # int | Required String in group parameters + required_boolean_group = True # bool | Required Boolean in group parameters + required_int64_group = 56 # int | Required Integer in group parameters + string_group = 56 # int | String in group parameters (optional) boolean_group = True # bool | Boolean in group parameters (optional) int64_group = 56 # int | Integer in group parameters (optional) -# example passing only required values which don't have defaults set -try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) + # example passing only required values which don't have defaults set + try: + # Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) -# example passing only required values which don't have defaults set -# and optional values -try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + # Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) ``` ### Parameters @@ -805,16 +831,18 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -param = {'key': 'param_example'} # {str: (str,)} | request body - -# example passing only required values which don't have defaults set -try: - # test inline additionalProperties - api_instance.test_inline_additional_properties(param) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + param = {'key': 'param_example'} # {str: (str,)} | request body + + # example passing only required values which don't have defaults set + try: + # test inline additionalProperties + api_instance.test_inline_additional_properties(param) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) ``` ### Parameters @@ -856,17 +884,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -param = 'param_example' # str | field1 -param2 = 'param2_example' # str | field2 - -# example passing only required values which don't have defaults set -try: - # test json serialization of form data - api_instance.test_json_form_data(param, param2) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + param = 'param_example' # str | field1 + param2 = 'param2_example' # str | field2 + + # example passing only required values which don't have defaults set + try: + # test json serialization of form data + api_instance.test_json_form_data(param, param2) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index 2335c666fd8..658e9ca6220 100644 --- a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -30,17 +30,19 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) -body = petstore_api.Client() # client.Client | client model - -# example passing only required values which don't have defaults set -try: - # To test class name in snake case - api_response = api_instance.test_classname(body) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeClassnameTags123Api(api_client) + body = petstore_api.Client() # client.Client | client model + + # example passing only required values which don't have defaults set + try: + # To test class name in snake case + api_response = api_instance.test_classname(body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-experimental/docs/PetApi.md b/samples/client/petstore/python-experimental/docs/PetApi.md index dbeb8dfe5ac..8ff3853e395 100644 --- a/samples/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/client/petstore/python-experimental/docs/PetApi.md @@ -34,16 +34,18 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -body = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store - -# example passing only required values which don't have defaults set -try: - # Add a new pet to the store - api_instance.add_pet(body) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->add_pet: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + body = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store + + # example passing only required values which don't have defaults set + try: + # Add a new pet to the store + api_instance.add_pet(body) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->add_pet: %s\n" % e) ``` ### Parameters @@ -92,25 +94,27 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | Pet id to delete -api_key = 'api_key_example' # str | (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | Pet id to delete + api_key = 'api_key_example' # str | (optional) -# example passing only required values which don't have defaults set -try: - # Deletes a pet - api_instance.delete_pet(pet_id) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) + # example passing only required values which don't have defaults set + try: + # Deletes a pet + api_instance.delete_pet(pet_id) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) -# example passing only required values which don't have defaults set -# and optional values -try: - # Deletes a pet - api_instance.delete_pet(pet_id, api_key=api_key) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + # Deletes a pet + api_instance.delete_pet(pet_id, api_key=api_key) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) ``` ### Parameters @@ -162,17 +166,19 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -status = ['status_example'] # [str] | Status values that need to be considered for filter - -# example passing only required values which don't have defaults set -try: - # Finds Pets by status - api_response = api_instance.find_pets_by_status(status) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + status = ['status_example'] # [str] | Status values that need to be considered for filter + + # example passing only required values which don't have defaults set + try: + # Finds Pets by status + api_response = api_instance.find_pets_by_status(status) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) ``` ### Parameters @@ -223,17 +229,19 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -tags = ['tags_example'] # [str] | Tags to filter by - -# example passing only required values which don't have defaults set -try: - # Finds Pets by tags - api_response = api_instance.find_pets_by_tags(tags) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + tags = ['tags_example'] # [str] | Tags to filter by + + # example passing only required values which don't have defaults set + try: + # Finds Pets by tags + api_response = api_instance.find_pets_by_tags(tags) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) ``` ### Parameters @@ -286,17 +294,19 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to return - -# example passing only required values which don't have defaults set -try: - # Find pet by ID - api_response = api_instance.get_pet_by_id(pet_id) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to return + + # example passing only required values which don't have defaults set + try: + # Find pet by ID + api_response = api_instance.get_pet_by_id(pet_id) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) ``` ### Parameters @@ -346,16 +356,18 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -body = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store - -# example passing only required values which don't have defaults set -try: - # Update an existing pet - api_instance.update_pet(body) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + body = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store + + # example passing only required values which don't have defaults set + try: + # Update an existing pet + api_instance.update_pet(body) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet: %s\n" % e) ``` ### Parameters @@ -406,26 +418,28 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet that needs to be updated -name = 'name_example' # str | Updated name of the pet (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet that needs to be updated + name = 'name_example' # str | Updated name of the pet (optional) status = 'status_example' # str | Updated status of the pet (optional) -# example passing only required values which don't have defaults set -try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) + # example passing only required values which don't have defaults set + try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) -# example passing only required values which don't have defaults set -# and optional values -try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id, name=name, status=status) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id, name=name, status=status) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) ``` ### Parameters @@ -475,29 +489,31 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to update -additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to update + additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) file = open('/path/to/file', 'rb') # file_type | file to upload (optional) files = open('/path/to/file', 'rb') # [file_type] | files to upload (optional) -# example passing only required values which don't have defaults set -try: - # uploads an image - api_response = api_instance.upload_file(pet_id) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file: %s\n" % e) + # example passing only required values which don't have defaults set + try: + # uploads an image + api_response = api_instance.upload_file(pet_id) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) -# example passing only required values which don't have defaults set -# and optional values -try: - # uploads an image - api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file, files=files) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + # uploads an image + api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file, files=files) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) ``` ### Parameters @@ -548,28 +564,30 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to update -required_file = open('/path/to/file', 'rb') # file_type | file to upload -additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to update + required_file = open('/path/to/file', 'rb') # file_type | file to upload + additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) -# example passing only required values which don't have defaults set -try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file(pet_id, required_file) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) + # example passing only required values which don't have defaults set + try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file(pet_id, required_file) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) -# example passing only required values which don't have defaults set -# and optional values -try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-experimental/docs/StoreApi.md b/samples/client/petstore/python-experimental/docs/StoreApi.md index 6dfdac72b49..ed8692abf57 100644 --- a/samples/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/client/petstore/python-experimental/docs/StoreApi.md @@ -25,16 +25,18 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -order_id = 'order_id_example' # str | ID of the order that needs to be deleted - -# example passing only required values which don't have defaults set -try: - # Delete purchase order by ID - api_instance.delete_order(order_id) -except petstore_api.ApiException as e: - print("Exception when calling StoreApi->delete_order: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + order_id = 'order_id_example' # str | ID of the order that needs to be deleted + + # example passing only required values which don't have defaults set + try: + # Delete purchase order by ID + api_instance.delete_order(order_id) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->delete_order: %s\n" % e) ``` ### Parameters @@ -87,16 +89,18 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) - -# example, this endpoint has no required or optional parameters -try: - # Returns pet inventories by status - api_response = api_instance.get_inventory() - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling StoreApi->get_inventory: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # Returns pet inventories by status + api_response = api_instance.get_inventory() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->get_inventory: %s\n" % e) ``` ### Parameters @@ -137,17 +141,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -order_id = 56 # int | ID of pet that needs to be fetched - -# example passing only required values which don't have defaults set -try: - # Find purchase order by ID - api_response = api_instance.get_order_by_id(order_id) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + order_id = 56 # int | ID of pet that needs to be fetched + + # example passing only required values which don't have defaults set + try: + # Find purchase order by ID + api_response = api_instance.get_order_by_id(order_id) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) ``` ### Parameters @@ -191,17 +197,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -body = petstore_api.Order() # order.Order | order placed for purchasing the pet - -# example passing only required values which don't have defaults set -try: - # Place an order for a pet - api_response = api_instance.place_order(body) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling StoreApi->place_order: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + body = petstore_api.Order() # order.Order | order placed for purchasing the pet + + # example passing only required values which don't have defaults set + try: + # Place an order for a pet + api_response = api_instance.place_order(body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->place_order: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-experimental/docs/UserApi.md b/samples/client/petstore/python-experimental/docs/UserApi.md index d93a4059c3b..318a1b5827d 100644 --- a/samples/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/client/petstore/python-experimental/docs/UserApi.md @@ -29,16 +29,18 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -body = petstore_api.User() # user.User | Created user object - -# example passing only required values which don't have defaults set -try: - # Create user - api_instance.create_user(body) -except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_user: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + body = petstore_api.User() # user.User | Created user object + + # example passing only required values which don't have defaults set + try: + # Create user + api_instance.create_user(body) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_user: %s\n" % e) ``` ### Parameters @@ -80,16 +82,18 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -body = [petstore_api.User()] # [user.User] | List of user object - -# example passing only required values which don't have defaults set -try: - # Creates list of users with given input array - api_instance.create_users_with_array_input(body) -except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + body = [petstore_api.User()] # [user.User] | List of user object + + # example passing only required values which don't have defaults set + try: + # Creates list of users with given input array + api_instance.create_users_with_array_input(body) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) ``` ### Parameters @@ -131,16 +135,18 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -body = [petstore_api.User()] # [user.User] | List of user object - -# example passing only required values which don't have defaults set -try: - # Creates list of users with given input array - api_instance.create_users_with_list_input(body) -except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + body = [petstore_api.User()] # [user.User] | List of user object + + # example passing only required values which don't have defaults set + try: + # Creates list of users with given input array + api_instance.create_users_with_list_input(body) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) ``` ### Parameters @@ -184,16 +190,18 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The name that needs to be deleted - -# example passing only required values which don't have defaults set -try: - # Delete user - api_instance.delete_user(username) -except petstore_api.ApiException as e: - print("Exception when calling UserApi->delete_user: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The name that needs to be deleted + + # example passing only required values which don't have defaults set + try: + # Delete user + api_instance.delete_user(username) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->delete_user: %s\n" % e) ``` ### Parameters @@ -236,17 +244,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. - -# example passing only required values which don't have defaults set -try: - # Get user by user name - api_response = api_instance.get_user_by_name(username) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling UserApi->get_user_by_name: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. + + # example passing only required values which don't have defaults set + try: + # Get user by user name + api_response = api_instance.get_user_by_name(username) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->get_user_by_name: %s\n" % e) ``` ### Parameters @@ -290,18 +300,20 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The user name for login -password = 'password_example' # str | The password for login in clear text - -# example passing only required values which don't have defaults set -try: - # Logs user into the system - api_response = api_instance.login_user(username, password) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling UserApi->login_user: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The user name for login + password = 'password_example' # str | The password for login in clear text + + # example passing only required values which don't have defaults set + try: + # Logs user into the system + api_response = api_instance.login_user(username, password) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->login_user: %s\n" % e) ``` ### Parameters @@ -345,15 +357,17 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() - -# example, this endpoint has no required or optional parameters -try: - # Logs out current logged in user session - api_instance.logout_user() -except petstore_api.ApiException as e: - print("Exception when calling UserApi->logout_user: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # Logs out current logged in user session + api_instance.logout_user() + except petstore_api.ApiException as e: + print("Exception when calling UserApi->logout_user: %s\n" % e) ``` ### Parameters @@ -394,17 +408,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | name that need to be deleted -body = petstore_api.User() # user.User | Updated user object - -# example passing only required values which don't have defaults set -try: - # Updated user - api_instance.update_user(username, body) -except petstore_api.ApiException as e: - print("Exception when calling UserApi->update_user: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | name that need to be deleted + body = petstore_api.User() # user.User | Updated user object + + # example passing only required values which don't have defaults set + try: + # Updated user + api_instance.update_user(username, body) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->update_user: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index 1ebbe896974..2030094e2c3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -11,6 +11,7 @@ from __future__ import absolute_import import json +import atexit import mimetypes from multiprocessing.pool import ThreadPool import os @@ -79,11 +80,19 @@ class ApiClient(object): # Set default User-Agent. self.user_agent = 'OpenAPI-Generator/1.0.0/python' - def __del__(self): + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): if self._pool: self._pool.close() self._pool.join() self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) @property def pool(self): @@ -91,6 +100,7 @@ class ApiClient(object): avoids instantiating unused threadpool for blocking clients. """ if self._pool is None: + atexit.register(self.close) self._pool = ThreadPool(self.pool_threads) return self._pool diff --git a/samples/client/petstore/python-experimental/tests/test_api_client.py b/samples/client/petstore/python-experimental/tests/test_api_client.py index fdf7e05d838..f36762e84e8 100644 --- a/samples/client/petstore/python-experimental/tests/test_api_client.py +++ b/samples/client/petstore/python-experimental/tests/test_api_client.py @@ -11,6 +11,8 @@ $ nosetests -v import os import time +import atexit +import weakref import unittest from dateutil.parser import parse @@ -199,3 +201,17 @@ class ApiClientTests(unittest.TestCase): model = petstore_api.StringBooleanMap(**model_dict) result = self.api_client.sanitize_for_serialization(model) self.assertEqual(result, model_dict) + + def test_context_manager_closes_threadpool(self): + with petstore_api.ApiClient() as client: + self.assertIsNotNone(client.pool) + pool_ref = weakref.ref(client._pool) + self.assertIsNotNone(pool_ref()) + self.assertIsNone(pool_ref()) + + def test_atexit_closes_threadpool(self): + client = petstore_api.ApiClient() + self.assertIsNotNone(client.pool) + self.assertIsNotNone(client._pool) + atexit._run_exitfuncs() + self.assertIsNone(client._pool) diff --git a/samples/client/petstore/python-tornado/README.md b/samples/client/petstore/python-tornado/README.md index 45618f2a086..36c0a082f3f 100644 --- a/samples/client/petstore/python-tornado/README.md +++ b/samples/client/petstore/python-tornado/README.md @@ -54,17 +54,19 @@ from pprint import pprint # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.AnotherFakeApi(petstore_api.ApiClient(configuration)) -body = petstore_api.Client() # Client | client model - -try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(body) - pprint(api_response) -except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.AnotherFakeApi(api_client) + body = petstore_api.Client() # Client | client model + try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(body) + pprint(api_response) + except ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) + ``` ## Documentation for API Endpoints diff --git a/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md b/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md index 3be4009a7d1..f777f0d43e6 100644 --- a/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md @@ -23,16 +23,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.AnotherFakeApi() -body = petstore_api.Client() # Client | client model +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.AnotherFakeApi(api_client) + body = petstore_api.Client() # Client | client model -try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(body) - pprint(api_response) -except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) + try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(body) + pprint(api_response) + except ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-tornado/docs/FakeApi.md b/samples/client/petstore/python-tornado/docs/FakeApi.md index c311c9eaf28..9ea1aa2a6b1 100644 --- a/samples/client/petstore/python-tornado/docs/FakeApi.md +++ b/samples/client/petstore/python-tornado/docs/FakeApi.md @@ -36,15 +36,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -xml_item = petstore_api.XmlItem() # XmlItem | XmlItem Body +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + xml_item = petstore_api.XmlItem() # XmlItem | XmlItem Body -try: - # creates an XmlItem - api_instance.create_xml_item(xml_item) -except ApiException as e: - print("Exception when calling FakeApi->create_xml_item: %s\n" % e) + try: + # creates an XmlItem + api_instance.create_xml_item(xml_item) + except ApiException as e: + print("Exception when calling FakeApi->create_xml_item: %s\n" % e) ``` ### Parameters @@ -89,15 +91,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = True # bool | Input boolean as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = True # bool | Input boolean as post body (optional) -try: - api_response = api_instance.fake_outer_boolean_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) + try: + api_response = api_instance.fake_outer_boolean_serialize(body=body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) ``` ### Parameters @@ -142,15 +146,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) -try: - api_response = api_instance.fake_outer_composite_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) + try: + api_response = api_instance.fake_outer_composite_serialize(body=body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) ``` ### Parameters @@ -195,15 +201,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = 3.4 # float | Input number as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = 3.4 # float | Input number as post body (optional) -try: - api_response = api_instance.fake_outer_number_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) + try: + api_response = api_instance.fake_outer_number_serialize(body=body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) ``` ### Parameters @@ -248,15 +256,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = 'body_example' # str | Input string as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = 'body_example' # str | Input string as post body (optional) -try: - api_response = api_instance.fake_outer_string_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) + try: + api_response = api_instance.fake_outer_string_serialize(body=body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) ``` ### Parameters @@ -301,14 +311,16 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | -try: - api_instance.test_body_with_file_schema(body) -except ApiException as e: - print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) + try: + api_instance.test_body_with_file_schema(body) + except ApiException as e: + print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) ``` ### Parameters @@ -351,15 +363,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -query = 'query_example' # str | +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + query = 'query_example' # str | body = petstore_api.User() # User | -try: - api_instance.test_body_with_query_params(query, body) -except ApiException as e: - print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) + try: + api_instance.test_body_with_query_params(query, body) + except ApiException as e: + print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) ``` ### Parameters @@ -405,16 +419,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = petstore_api.Client() # Client | client model +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = petstore_api.Client() # Client | client model -try: - # To test \"client\" model - api_response = api_instance.test_client_model(body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->test_client_model: %s\n" % e) + try: + # To test \"client\" model + api_response = api_instance.test_client_model(body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->test_client_model: %s\n" % e) ``` ### Parameters @@ -466,9 +482,11 @@ configuration.password = 'YOUR_PASSWORD' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) -number = 3.4 # float | None +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + number = 3.4 # float | None double = 3.4 # float | None pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None byte = 'byte_example' # str | None @@ -483,11 +501,11 @@ date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) password = 'password_example' # str | None (optional) param_callback = 'param_callback_example' # str | None (optional) -try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) -except ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) + try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) + except ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) ``` ### Parameters @@ -546,9 +564,11 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') @@ -557,11 +577,11 @@ enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$') enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') -try: - # To test enum parameters - api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) -except ApiException as e: - print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) + try: + # To test enum parameters + api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) + except ApiException as e: + print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) ``` ### Parameters @@ -614,20 +634,22 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -required_string_group = 56 # int | Required String in group parameters +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + required_string_group = 56 # int | Required String in group parameters required_boolean_group = True # bool | Required Boolean in group parameters required_int64_group = 56 # int | Required Integer in group parameters string_group = 56 # int | String in group parameters (optional) boolean_group = True # bool | Boolean in group parameters (optional) int64_group = 56 # int | Integer in group parameters (optional) -try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) -except ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) + try: + # Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) + except ApiException as e: + print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) ``` ### Parameters @@ -675,15 +697,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -param = {'key': 'param_example'} # dict(str, str) | request body +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + param = {'key': 'param_example'} # dict(str, str) | request body -try: - # test inline additionalProperties - api_instance.test_inline_additional_properties(param) -except ApiException as e: - print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) + try: + # test inline additionalProperties + api_instance.test_inline_additional_properties(param) + except ApiException as e: + print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) ``` ### Parameters @@ -726,16 +750,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -param = 'param_example' # str | field1 +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + param = 'param_example' # str | field1 param2 = 'param2_example' # str | field2 -try: - # test json serialization of form data - api_instance.test_json_form_data(param, param2) -except ApiException as e: - print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) + try: + # test json serialization of form data + api_instance.test_json_form_data(param, param2) + except ApiException as e: + print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) ``` ### Parameters @@ -781,18 +807,20 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -pipe = ['pipe_example'] # list[str] | +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + pipe = ['pipe_example'] # list[str] | ioutil = ['ioutil_example'] # list[str] | http = ['http_example'] # list[str] | url = ['url_example'] # list[str] | context = ['context_example'] # list[str] | -try: - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) -except ApiException as e: - print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) + try: + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) + except ApiException as e: + print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md index 2fae5e0c776..3ea79928f2a 100644 --- a/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md @@ -31,16 +31,18 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) -body = petstore_api.Client() # Client | client model +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeClassnameTags123Api(api_client) + body = petstore_api.Client() # Client | client model -try: - # To test class name in snake case - api_response = api_instance.test_classname(body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) + try: + # To test class name in snake case + api_response = api_instance.test_classname(body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-tornado/docs/PetApi.md b/samples/client/petstore/python-tornado/docs/PetApi.md index e4df08ee37a..45129d6d620 100644 --- a/samples/client/petstore/python-tornado/docs/PetApi.md +++ b/samples/client/petstore/python-tornado/docs/PetApi.md @@ -35,15 +35,17 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store -try: - # Add a new pet to the store - api_instance.add_pet(body) -except ApiException as e: - print("Exception when calling PetApi->add_pet: %s\n" % e) + try: + # Add a new pet to the store + api_instance.add_pet(body) + except ApiException as e: + print("Exception when calling PetApi->add_pet: %s\n" % e) ``` ### Parameters @@ -93,16 +95,18 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | Pet id to delete +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | Pet id to delete api_key = 'api_key_example' # str | (optional) -try: - # Deletes a pet - api_instance.delete_pet(pet_id, api_key=api_key) -except ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) + try: + # Deletes a pet + api_instance.delete_pet(pet_id, api_key=api_key) + except ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) ``` ### Parameters @@ -155,16 +159,18 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -status = ['status_example'] # list[str] | Status values that need to be considered for filter +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + status = ['status_example'] # list[str] | Status values that need to be considered for filter -try: - # Finds Pets by status - api_response = api_instance.find_pets_by_status(status) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) + try: + # Finds Pets by status + api_response = api_instance.find_pets_by_status(status) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) ``` ### Parameters @@ -216,16 +222,18 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -tags = ['tags_example'] # list[str] | Tags to filter by +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + tags = ['tags_example'] # list[str] | Tags to filter by -try: - # Finds Pets by tags - api_response = api_instance.find_pets_by_tags(tags) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) + try: + # Finds Pets by tags + api_response = api_instance.find_pets_by_tags(tags) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) ``` ### Parameters @@ -279,16 +287,18 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to return +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to return -try: - # Find pet by ID - api_response = api_instance.get_pet_by_id(pet_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) + try: + # Find pet by ID + api_response = api_instance.get_pet_by_id(pet_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) ``` ### Parameters @@ -339,15 +349,17 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store -try: - # Update an existing pet - api_instance.update_pet(body) -except ApiException as e: - print("Exception when calling PetApi->update_pet: %s\n" % e) + try: + # Update an existing pet + api_instance.update_pet(body) + except ApiException as e: + print("Exception when calling PetApi->update_pet: %s\n" % e) ``` ### Parameters @@ -399,17 +411,19 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet that needs to be updated +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet that needs to be updated name = 'name_example' # str | Updated name of the pet (optional) status = 'status_example' # str | Updated status of the pet (optional) -try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id, name=name, status=status) -except ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) + try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id, name=name, status=status) + except ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) ``` ### Parameters @@ -460,18 +474,20 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to update +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to update additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) file = '/path/to/file' # file | file to upload (optional) -try: - # uploads an image - api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->upload_file: %s\n" % e) + try: + # uploads an image + api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) ``` ### Parameters @@ -522,18 +538,20 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to update +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to update required_file = '/path/to/file' # file | file to upload additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) -try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) + try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-tornado/docs/StoreApi.md b/samples/client/petstore/python-tornado/docs/StoreApi.md index a2f4ece3e3f..285953422d2 100644 --- a/samples/client/petstore/python-tornado/docs/StoreApi.md +++ b/samples/client/petstore/python-tornado/docs/StoreApi.md @@ -26,15 +26,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -order_id = 'order_id_example' # str | ID of the order that needs to be deleted +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + order_id = 'order_id_example' # str | ID of the order that needs to be deleted -try: - # Delete purchase order by ID - api_instance.delete_order(order_id) -except ApiException as e: - print("Exception when calling StoreApi->delete_order: %s\n" % e) + try: + # Delete purchase order by ID + api_instance.delete_order(order_id) + except ApiException as e: + print("Exception when calling StoreApi->delete_order: %s\n" % e) ``` ### Parameters @@ -88,15 +90,17 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) - -try: - # Returns pet inventories by status - api_response = api_instance.get_inventory() - pprint(api_response) -except ApiException as e: - print("Exception when calling StoreApi->get_inventory: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + + try: + # Returns pet inventories by status + api_response = api_instance.get_inventory() + pprint(api_response) + except ApiException as e: + print("Exception when calling StoreApi->get_inventory: %s\n" % e) ``` ### Parameters @@ -138,16 +142,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -order_id = 56 # int | ID of pet that needs to be fetched +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + order_id = 56 # int | ID of pet that needs to be fetched -try: - # Find purchase order by ID - api_response = api_instance.get_order_by_id(order_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) + try: + # Find purchase order by ID + api_response = api_instance.get_order_by_id(order_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) ``` ### Parameters @@ -192,16 +198,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -body = petstore_api.Order() # Order | order placed for purchasing the pet +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + body = petstore_api.Order() # Order | order placed for purchasing the pet -try: - # Place an order for a pet - api_response = api_instance.place_order(body) - pprint(api_response) -except ApiException as e: - print("Exception when calling StoreApi->place_order: %s\n" % e) + try: + # Place an order for a pet + api_response = api_instance.place_order(body) + pprint(api_response) + except ApiException as e: + print("Exception when calling StoreApi->place_order: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-tornado/docs/UserApi.md b/samples/client/petstore/python-tornado/docs/UserApi.md index 3ea4a2ef605..1d69ee7aa6e 100644 --- a/samples/client/petstore/python-tornado/docs/UserApi.md +++ b/samples/client/petstore/python-tornado/docs/UserApi.md @@ -30,15 +30,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -body = petstore_api.User() # User | Created user object +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + body = petstore_api.User() # User | Created user object -try: - # Create user - api_instance.create_user(body) -except ApiException as e: - print("Exception when calling UserApi->create_user: %s\n" % e) + try: + # Create user + api_instance.create_user(body) + except ApiException as e: + print("Exception when calling UserApi->create_user: %s\n" % e) ``` ### Parameters @@ -81,15 +83,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -body = [petstore_api.User()] # list[User] | List of user object +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + body = [petstore_api.User()] # list[User] | List of user object -try: - # Creates list of users with given input array - api_instance.create_users_with_array_input(body) -except ApiException as e: - print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) + try: + # Creates list of users with given input array + api_instance.create_users_with_array_input(body) + except ApiException as e: + print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) ``` ### Parameters @@ -132,15 +136,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -body = [petstore_api.User()] # list[User] | List of user object +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + body = [petstore_api.User()] # list[User] | List of user object -try: - # Creates list of users with given input array - api_instance.create_users_with_list_input(body) -except ApiException as e: - print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) + try: + # Creates list of users with given input array + api_instance.create_users_with_list_input(body) + except ApiException as e: + print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) ``` ### Parameters @@ -185,15 +191,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The name that needs to be deleted +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The name that needs to be deleted -try: - # Delete user - api_instance.delete_user(username) -except ApiException as e: - print("Exception when calling UserApi->delete_user: %s\n" % e) + try: + # Delete user + api_instance.delete_user(username) + except ApiException as e: + print("Exception when calling UserApi->delete_user: %s\n" % e) ``` ### Parameters @@ -237,16 +245,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. -try: - # Get user by user name - api_response = api_instance.get_user_by_name(username) - pprint(api_response) -except ApiException as e: - print("Exception when calling UserApi->get_user_by_name: %s\n" % e) + try: + # Get user by user name + api_response = api_instance.get_user_by_name(username) + pprint(api_response) + except ApiException as e: + print("Exception when calling UserApi->get_user_by_name: %s\n" % e) ``` ### Parameters @@ -291,17 +301,19 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The user name for login +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The user name for login password = 'password_example' # str | The password for login in clear text -try: - # Logs user into the system - api_response = api_instance.login_user(username, password) - pprint(api_response) -except ApiException as e: - print("Exception when calling UserApi->login_user: %s\n" % e) + try: + # Logs user into the system + api_response = api_instance.login_user(username, password) + pprint(api_response) + except ApiException as e: + print("Exception when calling UserApi->login_user: %s\n" % e) ``` ### Parameters @@ -346,14 +358,16 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() - -try: - # Logs out current logged in user session - api_instance.logout_user() -except ApiException as e: - print("Exception when calling UserApi->logout_user: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + + try: + # Logs out current logged in user session + api_instance.logout_user() + except ApiException as e: + print("Exception when calling UserApi->logout_user: %s\n" % e) ``` ### Parameters @@ -395,16 +409,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | name that need to be deleted +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | name that need to be deleted body = petstore_api.User() # User | Updated user object -try: - # Updated user - api_instance.update_user(username, body) -except ApiException as e: - print("Exception when calling UserApi->update_user: %s\n" % e) + try: + # Updated user + api_instance.update_user(username, body) + except ApiException as e: + print("Exception when calling UserApi->update_user: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python-tornado/petstore_api/api_client.py b/samples/client/petstore/python-tornado/petstore_api/api_client.py index 0ccd640f01b..dde7bac90f4 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api_client.py +++ b/samples/client/petstore/python-tornado/petstore_api/api_client.py @@ -10,6 +10,7 @@ from __future__ import absolute_import +import atexit import datetime from dateutil.parser import parse import json @@ -81,11 +82,19 @@ class ApiClient(object): self.user_agent = 'OpenAPI-Generator/1.0.0/python' self.client_side_validation = configuration.client_side_validation - def __del__(self): + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): if self._pool: self._pool.close() self._pool.join() self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) @property def pool(self): @@ -93,6 +102,7 @@ class ApiClient(object): avoids instantiating unused threadpool for blocking clients. """ if self._pool is None: + atexit.register(self.close) self._pool = ThreadPool(self.pool_threads) return self._pool diff --git a/samples/client/petstore/python/README.md b/samples/client/petstore/python/README.md index 45618f2a086..36c0a082f3f 100644 --- a/samples/client/petstore/python/README.md +++ b/samples/client/petstore/python/README.md @@ -54,17 +54,19 @@ from pprint import pprint # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.AnotherFakeApi(petstore_api.ApiClient(configuration)) -body = petstore_api.Client() # Client | client model - -try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(body) - pprint(api_response) -except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.AnotherFakeApi(api_client) + body = petstore_api.Client() # Client | client model + try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(body) + pprint(api_response) + except ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) + ``` ## Documentation for API Endpoints diff --git a/samples/client/petstore/python/docs/AnotherFakeApi.md b/samples/client/petstore/python/docs/AnotherFakeApi.md index 3be4009a7d1..f777f0d43e6 100644 --- a/samples/client/petstore/python/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python/docs/AnotherFakeApi.md @@ -23,16 +23,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.AnotherFakeApi() -body = petstore_api.Client() # Client | client model +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.AnotherFakeApi(api_client) + body = petstore_api.Client() # Client | client model -try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(body) - pprint(api_response) -except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) + try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(body) + pprint(api_response) + except ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python/docs/FakeApi.md b/samples/client/petstore/python/docs/FakeApi.md index c311c9eaf28..9ea1aa2a6b1 100644 --- a/samples/client/petstore/python/docs/FakeApi.md +++ b/samples/client/petstore/python/docs/FakeApi.md @@ -36,15 +36,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -xml_item = petstore_api.XmlItem() # XmlItem | XmlItem Body +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + xml_item = petstore_api.XmlItem() # XmlItem | XmlItem Body -try: - # creates an XmlItem - api_instance.create_xml_item(xml_item) -except ApiException as e: - print("Exception when calling FakeApi->create_xml_item: %s\n" % e) + try: + # creates an XmlItem + api_instance.create_xml_item(xml_item) + except ApiException as e: + print("Exception when calling FakeApi->create_xml_item: %s\n" % e) ``` ### Parameters @@ -89,15 +91,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = True # bool | Input boolean as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = True # bool | Input boolean as post body (optional) -try: - api_response = api_instance.fake_outer_boolean_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) + try: + api_response = api_instance.fake_outer_boolean_serialize(body=body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) ``` ### Parameters @@ -142,15 +146,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) -try: - api_response = api_instance.fake_outer_composite_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) + try: + api_response = api_instance.fake_outer_composite_serialize(body=body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) ``` ### Parameters @@ -195,15 +201,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = 3.4 # float | Input number as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = 3.4 # float | Input number as post body (optional) -try: - api_response = api_instance.fake_outer_number_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) + try: + api_response = api_instance.fake_outer_number_serialize(body=body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) ``` ### Parameters @@ -248,15 +256,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = 'body_example' # str | Input string as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = 'body_example' # str | Input string as post body (optional) -try: - api_response = api_instance.fake_outer_string_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) + try: + api_response = api_instance.fake_outer_string_serialize(body=body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) ``` ### Parameters @@ -301,14 +311,16 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | -try: - api_instance.test_body_with_file_schema(body) -except ApiException as e: - print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) + try: + api_instance.test_body_with_file_schema(body) + except ApiException as e: + print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) ``` ### Parameters @@ -351,15 +363,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -query = 'query_example' # str | +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + query = 'query_example' # str | body = petstore_api.User() # User | -try: - api_instance.test_body_with_query_params(query, body) -except ApiException as e: - print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) + try: + api_instance.test_body_with_query_params(query, body) + except ApiException as e: + print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) ``` ### Parameters @@ -405,16 +419,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = petstore_api.Client() # Client | client model +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = petstore_api.Client() # Client | client model -try: - # To test \"client\" model - api_response = api_instance.test_client_model(body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->test_client_model: %s\n" % e) + try: + # To test \"client\" model + api_response = api_instance.test_client_model(body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->test_client_model: %s\n" % e) ``` ### Parameters @@ -466,9 +482,11 @@ configuration.password = 'YOUR_PASSWORD' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) -number = 3.4 # float | None +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + number = 3.4 # float | None double = 3.4 # float | None pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None byte = 'byte_example' # str | None @@ -483,11 +501,11 @@ date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) password = 'password_example' # str | None (optional) param_callback = 'param_callback_example' # str | None (optional) -try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) -except ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) + try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) + except ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) ``` ### Parameters @@ -546,9 +564,11 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') @@ -557,11 +577,11 @@ enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$') enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') -try: - # To test enum parameters - api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) -except ApiException as e: - print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) + try: + # To test enum parameters + api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) + except ApiException as e: + print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) ``` ### Parameters @@ -614,20 +634,22 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -required_string_group = 56 # int | Required String in group parameters +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + required_string_group = 56 # int | Required String in group parameters required_boolean_group = True # bool | Required Boolean in group parameters required_int64_group = 56 # int | Required Integer in group parameters string_group = 56 # int | String in group parameters (optional) boolean_group = True # bool | Boolean in group parameters (optional) int64_group = 56 # int | Integer in group parameters (optional) -try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) -except ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) + try: + # Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) + except ApiException as e: + print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) ``` ### Parameters @@ -675,15 +697,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -param = {'key': 'param_example'} # dict(str, str) | request body +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + param = {'key': 'param_example'} # dict(str, str) | request body -try: - # test inline additionalProperties - api_instance.test_inline_additional_properties(param) -except ApiException as e: - print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) + try: + # test inline additionalProperties + api_instance.test_inline_additional_properties(param) + except ApiException as e: + print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) ``` ### Parameters @@ -726,16 +750,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -param = 'param_example' # str | field1 +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + param = 'param_example' # str | field1 param2 = 'param2_example' # str | field2 -try: - # test json serialization of form data - api_instance.test_json_form_data(param, param2) -except ApiException as e: - print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) + try: + # test json serialization of form data + api_instance.test_json_form_data(param, param2) + except ApiException as e: + print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) ``` ### Parameters @@ -781,18 +807,20 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -pipe = ['pipe_example'] # list[str] | +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + pipe = ['pipe_example'] # list[str] | ioutil = ['ioutil_example'] # list[str] | http = ['http_example'] # list[str] | url = ['url_example'] # list[str] | context = ['context_example'] # list[str] | -try: - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) -except ApiException as e: - print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) + try: + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) + except ApiException as e: + print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python/docs/FakeClassnameTags123Api.md index 2fae5e0c776..3ea79928f2a 100644 --- a/samples/client/petstore/python/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python/docs/FakeClassnameTags123Api.md @@ -31,16 +31,18 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) -body = petstore_api.Client() # Client | client model +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeClassnameTags123Api(api_client) + body = petstore_api.Client() # Client | client model -try: - # To test class name in snake case - api_response = api_instance.test_classname(body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) + try: + # To test class name in snake case + api_response = api_instance.test_classname(body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python/docs/PetApi.md b/samples/client/petstore/python/docs/PetApi.md index e4df08ee37a..45129d6d620 100644 --- a/samples/client/petstore/python/docs/PetApi.md +++ b/samples/client/petstore/python/docs/PetApi.md @@ -35,15 +35,17 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store -try: - # Add a new pet to the store - api_instance.add_pet(body) -except ApiException as e: - print("Exception when calling PetApi->add_pet: %s\n" % e) + try: + # Add a new pet to the store + api_instance.add_pet(body) + except ApiException as e: + print("Exception when calling PetApi->add_pet: %s\n" % e) ``` ### Parameters @@ -93,16 +95,18 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | Pet id to delete +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | Pet id to delete api_key = 'api_key_example' # str | (optional) -try: - # Deletes a pet - api_instance.delete_pet(pet_id, api_key=api_key) -except ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) + try: + # Deletes a pet + api_instance.delete_pet(pet_id, api_key=api_key) + except ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) ``` ### Parameters @@ -155,16 +159,18 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -status = ['status_example'] # list[str] | Status values that need to be considered for filter +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + status = ['status_example'] # list[str] | Status values that need to be considered for filter -try: - # Finds Pets by status - api_response = api_instance.find_pets_by_status(status) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) + try: + # Finds Pets by status + api_response = api_instance.find_pets_by_status(status) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) ``` ### Parameters @@ -216,16 +222,18 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -tags = ['tags_example'] # list[str] | Tags to filter by +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + tags = ['tags_example'] # list[str] | Tags to filter by -try: - # Finds Pets by tags - api_response = api_instance.find_pets_by_tags(tags) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) + try: + # Finds Pets by tags + api_response = api_instance.find_pets_by_tags(tags) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) ``` ### Parameters @@ -279,16 +287,18 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to return +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to return -try: - # Find pet by ID - api_response = api_instance.get_pet_by_id(pet_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) + try: + # Find pet by ID + api_response = api_instance.get_pet_by_id(pet_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) ``` ### Parameters @@ -339,15 +349,17 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store -try: - # Update an existing pet - api_instance.update_pet(body) -except ApiException as e: - print("Exception when calling PetApi->update_pet: %s\n" % e) + try: + # Update an existing pet + api_instance.update_pet(body) + except ApiException as e: + print("Exception when calling PetApi->update_pet: %s\n" % e) ``` ### Parameters @@ -399,17 +411,19 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet that needs to be updated +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet that needs to be updated name = 'name_example' # str | Updated name of the pet (optional) status = 'status_example' # str | Updated status of the pet (optional) -try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id, name=name, status=status) -except ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) + try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id, name=name, status=status) + except ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) ``` ### Parameters @@ -460,18 +474,20 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to update +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to update additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) file = '/path/to/file' # file | file to upload (optional) -try: - # uploads an image - api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->upload_file: %s\n" % e) + try: + # uploads an image + api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) ``` ### Parameters @@ -522,18 +538,20 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to update +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to update required_file = '/path/to/file' # file | file to upload additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) -try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) + try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python/docs/StoreApi.md b/samples/client/petstore/python/docs/StoreApi.md index a2f4ece3e3f..285953422d2 100644 --- a/samples/client/petstore/python/docs/StoreApi.md +++ b/samples/client/petstore/python/docs/StoreApi.md @@ -26,15 +26,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -order_id = 'order_id_example' # str | ID of the order that needs to be deleted +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + order_id = 'order_id_example' # str | ID of the order that needs to be deleted -try: - # Delete purchase order by ID - api_instance.delete_order(order_id) -except ApiException as e: - print("Exception when calling StoreApi->delete_order: %s\n" % e) + try: + # Delete purchase order by ID + api_instance.delete_order(order_id) + except ApiException as e: + print("Exception when calling StoreApi->delete_order: %s\n" % e) ``` ### Parameters @@ -88,15 +90,17 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) - -try: - # Returns pet inventories by status - api_response = api_instance.get_inventory() - pprint(api_response) -except ApiException as e: - print("Exception when calling StoreApi->get_inventory: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + + try: + # Returns pet inventories by status + api_response = api_instance.get_inventory() + pprint(api_response) + except ApiException as e: + print("Exception when calling StoreApi->get_inventory: %s\n" % e) ``` ### Parameters @@ -138,16 +142,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -order_id = 56 # int | ID of pet that needs to be fetched +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + order_id = 56 # int | ID of pet that needs to be fetched -try: - # Find purchase order by ID - api_response = api_instance.get_order_by_id(order_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) + try: + # Find purchase order by ID + api_response = api_instance.get_order_by_id(order_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) ``` ### Parameters @@ -192,16 +198,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -body = petstore_api.Order() # Order | order placed for purchasing the pet +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + body = petstore_api.Order() # Order | order placed for purchasing the pet -try: - # Place an order for a pet - api_response = api_instance.place_order(body) - pprint(api_response) -except ApiException as e: - print("Exception when calling StoreApi->place_order: %s\n" % e) + try: + # Place an order for a pet + api_response = api_instance.place_order(body) + pprint(api_response) + except ApiException as e: + print("Exception when calling StoreApi->place_order: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python/docs/UserApi.md b/samples/client/petstore/python/docs/UserApi.md index 3ea4a2ef605..1d69ee7aa6e 100644 --- a/samples/client/petstore/python/docs/UserApi.md +++ b/samples/client/petstore/python/docs/UserApi.md @@ -30,15 +30,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -body = petstore_api.User() # User | Created user object +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + body = petstore_api.User() # User | Created user object -try: - # Create user - api_instance.create_user(body) -except ApiException as e: - print("Exception when calling UserApi->create_user: %s\n" % e) + try: + # Create user + api_instance.create_user(body) + except ApiException as e: + print("Exception when calling UserApi->create_user: %s\n" % e) ``` ### Parameters @@ -81,15 +83,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -body = [petstore_api.User()] # list[User] | List of user object +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + body = [petstore_api.User()] # list[User] | List of user object -try: - # Creates list of users with given input array - api_instance.create_users_with_array_input(body) -except ApiException as e: - print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) + try: + # Creates list of users with given input array + api_instance.create_users_with_array_input(body) + except ApiException as e: + print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) ``` ### Parameters @@ -132,15 +136,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -body = [petstore_api.User()] # list[User] | List of user object +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + body = [petstore_api.User()] # list[User] | List of user object -try: - # Creates list of users with given input array - api_instance.create_users_with_list_input(body) -except ApiException as e: - print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) + try: + # Creates list of users with given input array + api_instance.create_users_with_list_input(body) + except ApiException as e: + print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) ``` ### Parameters @@ -185,15 +191,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The name that needs to be deleted +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The name that needs to be deleted -try: - # Delete user - api_instance.delete_user(username) -except ApiException as e: - print("Exception when calling UserApi->delete_user: %s\n" % e) + try: + # Delete user + api_instance.delete_user(username) + except ApiException as e: + print("Exception when calling UserApi->delete_user: %s\n" % e) ``` ### Parameters @@ -237,16 +245,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. -try: - # Get user by user name - api_response = api_instance.get_user_by_name(username) - pprint(api_response) -except ApiException as e: - print("Exception when calling UserApi->get_user_by_name: %s\n" % e) + try: + # Get user by user name + api_response = api_instance.get_user_by_name(username) + pprint(api_response) + except ApiException as e: + print("Exception when calling UserApi->get_user_by_name: %s\n" % e) ``` ### Parameters @@ -291,17 +301,19 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The user name for login +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The user name for login password = 'password_example' # str | The password for login in clear text -try: - # Logs user into the system - api_response = api_instance.login_user(username, password) - pprint(api_response) -except ApiException as e: - print("Exception when calling UserApi->login_user: %s\n" % e) + try: + # Logs user into the system + api_response = api_instance.login_user(username, password) + pprint(api_response) + except ApiException as e: + print("Exception when calling UserApi->login_user: %s\n" % e) ``` ### Parameters @@ -346,14 +358,16 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() - -try: - # Logs out current logged in user session - api_instance.logout_user() -except ApiException as e: - print("Exception when calling UserApi->logout_user: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + + try: + # Logs out current logged in user session + api_instance.logout_user() + except ApiException as e: + print("Exception when calling UserApi->logout_user: %s\n" % e) ``` ### Parameters @@ -395,16 +409,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | name that need to be deleted +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | name that need to be deleted body = petstore_api.User() # User | Updated user object -try: - # Updated user - api_instance.update_user(username, body) -except ApiException as e: - print("Exception when calling UserApi->update_user: %s\n" % e) + try: + # Updated user + api_instance.update_user(username, body) + except ApiException as e: + print("Exception when calling UserApi->update_user: %s\n" % e) ``` ### Parameters diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index a18f322840f..aec97a99e06 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -10,6 +10,7 @@ from __future__ import absolute_import +import atexit import datetime from dateutil.parser import parse import json @@ -80,11 +81,19 @@ class ApiClient(object): self.user_agent = 'OpenAPI-Generator/1.0.0/python' self.client_side_validation = configuration.client_side_validation - def __del__(self): + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): if self._pool: self._pool.close() self._pool.join() self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) @property def pool(self): @@ -92,6 +101,7 @@ class ApiClient(object): avoids instantiating unused threadpool for blocking clients. """ if self._pool is None: + atexit.register(self.close) self._pool = ThreadPool(self.pool_threads) return self._pool diff --git a/samples/client/petstore/python/tests/test_api_client.py b/samples/client/petstore/python/tests/test_api_client.py index c9b9edd86c4..216e1f9ec1b 100644 --- a/samples/client/petstore/python/tests/test_api_client.py +++ b/samples/client/petstore/python/tests/test_api_client.py @@ -11,6 +11,8 @@ $ nosetests -v import os import time +import atexit +import weakref import unittest from dateutil.parser import parse @@ -169,3 +171,17 @@ class ApiClientTests(unittest.TestCase): data = [pet] result = self.api_client.sanitize_for_serialization(data) self.assertEqual(result, list_of_pet_dict) + + def test_context_manager_closes_threadpool(self): + with petstore_api.ApiClient() as client: + self.assertIsNotNone(client.pool) + pool_ref = weakref.ref(client._pool) + self.assertIsNotNone(pool_ref()) + self.assertIsNone(pool_ref()) + + def test_atexit_closes_threadpool(self): + client = petstore_api.ApiClient() + self.assertIsNotNone(client.pool) + self.assertIsNotNone(client._pool) + atexit._run_exitfuncs() + self.assertIsNone(client._pool) diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md index 1f91ec0bcf0..1fa0ed6f66e 100644 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -53,17 +53,19 @@ from pprint import pprint # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.AnotherFakeApi(petstore_api.ApiClient(configuration)) -client_client = petstore_api.Client() # client.Client | client model - -try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(client_client) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.AnotherFakeApi(api_client) + client_client = petstore_api.Client() # client.Client | client model + try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(client_client) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) + ``` ## Documentation for API Endpoints diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md index b9a70253492..4c159f9f10c 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -22,17 +22,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.AnotherFakeApi() -client_client = petstore_api.Client() # client.Client | client model - -# example passing only required values which don't have defaults set -try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(client_client) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.AnotherFakeApi(api_client) + client_client = petstore_api.Client() # client.Client | client model + + # example passing only required values which don't have defaults set + try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(client_client) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) ``` ### Parameters diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md index cf6c28c597c..17513301ccc 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md @@ -20,15 +20,17 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.DefaultApi() - -# example, this endpoint has no required or optional parameters -try: - api_response = api_instance.foo_get() - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling DefaultApi->foo_get: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.DefaultApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + api_response = api_instance.foo_get() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling DefaultApi->foo_get: %s\n" % e) ``` ### Parameters diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md index 63cbd5d1842..3fd53419eb7 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md @@ -33,16 +33,18 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() - -# example, this endpoint has no required or optional parameters -try: - # Health check endpoint - api_response = api_instance.fake_health_get() - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_health_get: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # Health check endpoint + api_response = api_instance.fake_health_get() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_health_get: %s\n" % e) ``` ### Parameters @@ -83,17 +85,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = True # bool | Input boolean as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = True # bool | Input boolean as post body (optional) -# example passing only required values which don't have defaults set -# and optional values -try: - api_response = api_instance.fake_outer_boolean_serialize(body=body) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.fake_outer_boolean_serialize(body=body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) ``` ### Parameters @@ -137,17 +141,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -outer_composite_outer_composite = petstore_api.OuterComposite() # outer_composite.OuterComposite | Input composite as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + outer_composite_outer_composite = petstore_api.OuterComposite() # outer_composite.OuterComposite | Input composite as post body (optional) -# example passing only required values which don't have defaults set -# and optional values -try: - api_response = api_instance.fake_outer_composite_serialize(outer_composite_outer_composite=outer_composite_outer_composite) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.fake_outer_composite_serialize(outer_composite_outer_composite=outer_composite_outer_composite) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) ``` ### Parameters @@ -191,17 +197,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = 3.4 # float | Input number as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = 3.4 # float | Input number as post body (optional) -# example passing only required values which don't have defaults set -# and optional values -try: - api_response = api_instance.fake_outer_number_serialize(body=body) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.fake_outer_number_serialize(body=body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) ``` ### Parameters @@ -245,17 +253,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = 'body_example' # str | Input string as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = 'body_example' # str | Input string as post body (optional) -# example passing only required values which don't have defaults set -# and optional values -try: - api_response = api_instance.fake_outer_string_serialize(body=body) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.fake_outer_string_serialize(body=body) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) ``` ### Parameters @@ -299,15 +309,17 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -file_schema_test_class_file_schema_test_class = petstore_api.FileSchemaTestClass() # file_schema_test_class.FileSchemaTestClass | - -# example passing only required values which don't have defaults set -try: - api_instance.test_body_with_file_schema(file_schema_test_class_file_schema_test_class) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + file_schema_test_class_file_schema_test_class = petstore_api.FileSchemaTestClass() # file_schema_test_class.FileSchemaTestClass | + + # example passing only required values which don't have defaults set + try: + api_instance.test_body_with_file_schema(file_schema_test_class_file_schema_test_class) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) ``` ### Parameters @@ -349,16 +361,18 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -query = 'query_example' # str | -user_user = petstore_api.User() # user.User | - -# example passing only required values which don't have defaults set -try: - api_instance.test_body_with_query_params(query, user_user) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + query = 'query_example' # str | + user_user = petstore_api.User() # user.User | + + # example passing only required values which don't have defaults set + try: + api_instance.test_body_with_query_params(query, user_user) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) ``` ### Parameters @@ -403,17 +417,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -client_client = petstore_api.Client() # client.Client | client model - -# example passing only required values which don't have defaults set -try: - # To test \"client\" model - api_response = api_instance.test_client_model(client_client) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_client_model: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + client_client = petstore_api.Client() # client.Client | client model + + # example passing only required values which don't have defaults set + try: + # To test \"client\" model + api_response = api_instance.test_client_model(client_client) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_client_model: %s\n" % e) ``` ### Parameters @@ -464,13 +480,15 @@ configuration.password = 'YOUR_PASSWORD' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) -number = 3.4 # float | None -double = 3.4 # float | None -pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None -byte = 'byte_example' # str | None -integer = 56 # int | None (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + number = 3.4 # float | None + double = 3.4 # float | None + pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None + byte = 'byte_example' # str | None + integer = 56 # int | None (optional) int32 = 56 # int | None (optional) int64 = 56 # int | None (optional) float = 3.4 # float | None (optional) @@ -481,20 +499,20 @@ date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) password = 'password_example' # str | None (optional) param_callback = 'param_callback_example' # str | None (optional) -# example passing only required values which don't have defaults set -try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) + # example passing only required values which don't have defaults set + try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) -# example passing only required values which don't have defaults set -# and optional values -try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) ``` ### Parameters @@ -552,9 +570,11 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -enum_header_string_array = ['enum_header_string_array_example'] # [str] | Header parameter enum test (string array) (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + enum_header_string_array = ['enum_header_string_array_example'] # [str] | Header parameter enum test (string array) (optional) enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) if omitted the server will use the default value of '-efg' enum_query_string_array = ['enum_query_string_array_example'] # [str] | Query parameter enum test (string array) (optional) enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) if omitted the server will use the default value of '-efg' @@ -563,13 +583,13 @@ enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) enum_form_string_array = '$' # [str] | Form parameter enum test (string array) (optional) if omitted the server will use the default value of '$' enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) if omitted the server will use the default value of '-efg' -# example passing only required values which don't have defaults set -# and optional values -try: - # To test enum parameters - api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + # To test enum parameters + api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) ``` ### Parameters @@ -627,29 +647,31 @@ configuration.access_token = 'YOUR_BEARER_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) -required_string_group = 56 # int | Required String in group parameters -required_boolean_group = True # bool | Required Boolean in group parameters -required_int64_group = 56 # int | Required Integer in group parameters -string_group = 56 # int | String in group parameters (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + required_string_group = 56 # int | Required String in group parameters + required_boolean_group = True # bool | Required Boolean in group parameters + required_int64_group = 56 # int | Required Integer in group parameters + string_group = 56 # int | String in group parameters (optional) boolean_group = True # bool | Boolean in group parameters (optional) int64_group = 56 # int | Integer in group parameters (optional) -# example passing only required values which don't have defaults set -try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) + # example passing only required values which don't have defaults set + try: + # Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) -# example passing only required values which don't have defaults set -# and optional values -try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + # Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) ``` ### Parameters @@ -696,16 +718,18 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -request_body = {'key': 'request_body_example'} # {str: (str,)} | request body - -# example passing only required values which don't have defaults set -try: - # test inline additionalProperties - api_instance.test_inline_additional_properties(request_body) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + request_body = {'key': 'request_body_example'} # {str: (str,)} | request body + + # example passing only required values which don't have defaults set + try: + # test inline additionalProperties + api_instance.test_inline_additional_properties(request_body) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) ``` ### Parameters @@ -747,17 +771,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -param = 'param_example' # str | field1 -param2 = 'param2_example' # str | field2 - -# example passing only required values which don't have defaults set -try: - # test json serialization of form data - api_instance.test_json_form_data(param, param2) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + param = 'param_example' # str | field1 + param2 = 'param2_example' # str | field2 + + # example passing only required values which don't have defaults set + try: + # test json serialization of form data + api_instance.test_json_form_data(param, param2) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) ``` ### Parameters @@ -802,19 +828,21 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -pipe = ['pipe_example'] # [str] | -ioutil = ['ioutil_example'] # [str] | -http = ['http_example'] # [str] | -url = ['url_example'] # [str] | -context = ['context_example'] # [str] | - -# example passing only required values which don't have defaults set -try: - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) -except petstore_api.ApiException as e: - print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + pipe = ['pipe_example'] # [str] | + ioutil = ['ioutil_example'] # [str] | + http = ['http_example'] # [str] | + url = ['url_example'] # [str] | + context = ['context_example'] # [str] | + + # example passing only required values which don't have defaults set + try: + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) + except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) ``` ### Parameters diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index 4f78b1bd4cb..74d3bf84f75 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -30,17 +30,19 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) -client_client = petstore_api.Client() # client.Client | client model - -# example passing only required values which don't have defaults set -try: - # To test class name in snake case - api_response = api_instance.test_classname(client_client) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeClassnameTags123Api(api_client) + client_client = petstore_api.Client() # client.Client | client model + + # example passing only required values which don't have defaults set + try: + # To test class name in snake case + api_response = api_instance.test_classname(client_client) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) ``` ### Parameters diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md index 2a09dc5f86b..1f8dddead6d 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md @@ -55,16 +55,18 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_pet = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store - -# example passing only required values which don't have defaults set -try: - # Add a new pet to the store - api_instance.add_pet(pet_pet) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->add_pet: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_pet = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store + + # example passing only required values which don't have defaults set + try: + # Add a new pet to the store + api_instance.add_pet(pet_pet) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->add_pet: %s\n" % e) ``` ### Parameters @@ -112,25 +114,27 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | Pet id to delete -api_key = 'api_key_example' # str | (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | Pet id to delete + api_key = 'api_key_example' # str | (optional) -# example passing only required values which don't have defaults set -try: - # Deletes a pet - api_instance.delete_pet(pet_id) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) + # example passing only required values which don't have defaults set + try: + # Deletes a pet + api_instance.delete_pet(pet_id) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) -# example passing only required values which don't have defaults set -# and optional values -try: - # Deletes a pet - api_instance.delete_pet(pet_id, api_key=api_key) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + # Deletes a pet + api_instance.delete_pet(pet_id, api_key=api_key) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) ``` ### Parameters @@ -202,17 +206,19 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -status = ['status_example'] # [str] | Status values that need to be considered for filter - -# example passing only required values which don't have defaults set -try: - # Finds Pets by status - api_response = api_instance.find_pets_by_status(status) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + status = ['status_example'] # [str] | Status values that need to be considered for filter + + # example passing only required values which don't have defaults set + try: + # Finds Pets by status + api_response = api_instance.find_pets_by_status(status) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) ``` ### Parameters @@ -284,17 +290,19 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -tags = ['tags_example'] # [str] | Tags to filter by - -# example passing only required values which don't have defaults set -try: - # Finds Pets by tags - api_response = api_instance.find_pets_by_tags(tags) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + tags = ['tags_example'] # [str] | Tags to filter by + + # example passing only required values which don't have defaults set + try: + # Finds Pets by tags + api_response = api_instance.find_pets_by_tags(tags) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) ``` ### Parameters @@ -347,17 +355,19 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to return - -# example passing only required values which don't have defaults set -try: - # Find pet by ID - api_response = api_instance.get_pet_by_id(pet_id) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to return + + # example passing only required values which don't have defaults set + try: + # Find pet by ID + api_response = api_instance.get_pet_by_id(pet_id) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) ``` ### Parameters @@ -428,16 +438,18 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_pet = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store - -# example passing only required values which don't have defaults set -try: - # Update an existing pet - api_instance.update_pet(pet_pet) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_pet = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store + + # example passing only required values which don't have defaults set + try: + # Update an existing pet + api_instance.update_pet(pet_pet) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet: %s\n" % e) ``` ### Parameters @@ -487,26 +499,28 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet that needs to be updated -name = 'name_example' # str | Updated name of the pet (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet that needs to be updated + name = 'name_example' # str | Updated name of the pet (optional) status = 'status_example' # str | Updated status of the pet (optional) -# example passing only required values which don't have defaults set -try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) + # example passing only required values which don't have defaults set + try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) -# example passing only required values which don't have defaults set -# and optional values -try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id, name=name, status=status) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id, name=name, status=status) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) ``` ### Parameters @@ -556,28 +570,30 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to update -additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to update + additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) file = open('/path/to/file', 'rb') # file_type | file to upload (optional) -# example passing only required values which don't have defaults set -try: - # uploads an image - api_response = api_instance.upload_file(pet_id) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file: %s\n" % e) + # example passing only required values which don't have defaults set + try: + # uploads an image + api_response = api_instance.upload_file(pet_id) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) -# example passing only required values which don't have defaults set -# and optional values -try: - # uploads an image - api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + # uploads an image + api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) ``` ### Parameters @@ -627,28 +643,30 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to update -required_file = open('/path/to/file', 'rb') # file_type | file to upload -additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to update + required_file = open('/path/to/file', 'rb') # file_type | file to upload + additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) -# example passing only required values which don't have defaults set -try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file(pet_id, required_file) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) + # example passing only required values which don't have defaults set + try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file(pet_id, required_file) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) -# example passing only required values which don't have defaults set -# and optional values -try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) + # example passing only required values which don't have defaults set + # and optional values + try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) ``` ### Parameters diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md index a54a8c61fb1..8ef71bd8fc7 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md @@ -25,16 +25,18 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -order_id = 'order_id_example' # str | ID of the order that needs to be deleted - -# example passing only required values which don't have defaults set -try: - # Delete purchase order by ID - api_instance.delete_order(order_id) -except petstore_api.ApiException as e: - print("Exception when calling StoreApi->delete_order: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + order_id = 'order_id_example' # str | ID of the order that needs to be deleted + + # example passing only required values which don't have defaults set + try: + # Delete purchase order by ID + api_instance.delete_order(order_id) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->delete_order: %s\n" % e) ``` ### Parameters @@ -87,16 +89,18 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) - -# example, this endpoint has no required or optional parameters -try: - # Returns pet inventories by status - api_response = api_instance.get_inventory() - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling StoreApi->get_inventory: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # Returns pet inventories by status + api_response = api_instance.get_inventory() + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->get_inventory: %s\n" % e) ``` ### Parameters @@ -137,17 +141,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -order_id = 56 # int | ID of pet that needs to be fetched - -# example passing only required values which don't have defaults set -try: - # Find purchase order by ID - api_response = api_instance.get_order_by_id(order_id) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + order_id = 56 # int | ID of pet that needs to be fetched + + # example passing only required values which don't have defaults set + try: + # Find purchase order by ID + api_response = api_instance.get_order_by_id(order_id) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) ``` ### Parameters @@ -191,17 +197,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -order_order = petstore_api.Order() # order.Order | order placed for purchasing the pet - -# example passing only required values which don't have defaults set -try: - # Place an order for a pet - api_response = api_instance.place_order(order_order) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling StoreApi->place_order: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + order_order = petstore_api.Order() # order.Order | order placed for purchasing the pet + + # example passing only required values which don't have defaults set + try: + # Place an order for a pet + api_response = api_instance.place_order(order_order) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling StoreApi->place_order: %s\n" % e) ``` ### Parameters diff --git a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md index 4eb75f42874..720e4a41a46 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md @@ -29,16 +29,18 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -user_user = petstore_api.User() # user.User | Created user object - -# example passing only required values which don't have defaults set -try: - # Create user - api_instance.create_user(user_user) -except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_user: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + user_user = petstore_api.User() # user.User | Created user object + + # example passing only required values which don't have defaults set + try: + # Create user + api_instance.create_user(user_user) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_user: %s\n" % e) ``` ### Parameters @@ -80,16 +82,18 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -user_user = [petstore_api.User()] # [user.User] | List of user object - -# example passing only required values which don't have defaults set -try: - # Creates list of users with given input array - api_instance.create_users_with_array_input(user_user) -except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + user_user = [petstore_api.User()] # [user.User] | List of user object + + # example passing only required values which don't have defaults set + try: + # Creates list of users with given input array + api_instance.create_users_with_array_input(user_user) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) ``` ### Parameters @@ -131,16 +135,18 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -user_user = [petstore_api.User()] # [user.User] | List of user object - -# example passing only required values which don't have defaults set -try: - # Creates list of users with given input array - api_instance.create_users_with_list_input(user_user) -except petstore_api.ApiException as e: - print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + user_user = [petstore_api.User()] # [user.User] | List of user object + + # example passing only required values which don't have defaults set + try: + # Creates list of users with given input array + api_instance.create_users_with_list_input(user_user) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) ``` ### Parameters @@ -184,16 +190,18 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The name that needs to be deleted - -# example passing only required values which don't have defaults set -try: - # Delete user - api_instance.delete_user(username) -except petstore_api.ApiException as e: - print("Exception when calling UserApi->delete_user: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The name that needs to be deleted + + # example passing only required values which don't have defaults set + try: + # Delete user + api_instance.delete_user(username) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->delete_user: %s\n" % e) ``` ### Parameters @@ -236,17 +244,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. - -# example passing only required values which don't have defaults set -try: - # Get user by user name - api_response = api_instance.get_user_by_name(username) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling UserApi->get_user_by_name: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. + + # example passing only required values which don't have defaults set + try: + # Get user by user name + api_response = api_instance.get_user_by_name(username) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->get_user_by_name: %s\n" % e) ``` ### Parameters @@ -290,18 +300,20 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The user name for login -password = 'password_example' # str | The password for login in clear text - -# example passing only required values which don't have defaults set -try: - # Logs user into the system - api_response = api_instance.login_user(username, password) - pprint(api_response) -except petstore_api.ApiException as e: - print("Exception when calling UserApi->login_user: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The user name for login + password = 'password_example' # str | The password for login in clear text + + # example passing only required values which don't have defaults set + try: + # Logs user into the system + api_response = api_instance.login_user(username, password) + pprint(api_response) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->login_user: %s\n" % e) ``` ### Parameters @@ -345,15 +357,17 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() - -# example, this endpoint has no required or optional parameters -try: - # Logs out current logged in user session - api_instance.logout_user() -except petstore_api.ApiException as e: - print("Exception when calling UserApi->logout_user: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # Logs out current logged in user session + api_instance.logout_user() + except petstore_api.ApiException as e: + print("Exception when calling UserApi->logout_user: %s\n" % e) ``` ### Parameters @@ -394,17 +408,19 @@ import time import petstore_api from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | name that need to be deleted -user_user = petstore_api.User() # user.User | Updated user object - -# example passing only required values which don't have defaults set -try: - # Updated user - api_instance.update_user(username, user_user) -except petstore_api.ApiException as e: - print("Exception when calling UserApi->update_user: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | name that need to be deleted + user_user = petstore_api.User() # user.User | Updated user object + + # example passing only required values which don't have defaults set + try: + # Updated user + api_instance.update_user(username, user_user) + except petstore_api.ApiException as e: + print("Exception when calling UserApi->update_user: %s\n" % e) ``` ### Parameters diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py index c5d90d2a060..9191f25afd9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py @@ -11,6 +11,7 @@ from __future__ import absolute_import import json +import atexit import mimetypes from multiprocessing.pool import ThreadPool import os @@ -79,11 +80,19 @@ class ApiClient(object): # Set default User-Agent. self.user_agent = 'OpenAPI-Generator/1.0.0/python' - def __del__(self): + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): if self._pool: self._pool.close() self._pool.join() self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) @property def pool(self): @@ -91,6 +100,7 @@ class ApiClient(object): avoids instantiating unused threadpool for blocking clients. """ if self._pool is None: + atexit.register(self.close) self._pool = ThreadPool(self.pool_threads) return self._pool diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 45ff3402d25..39d427e7ccc 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -54,17 +54,19 @@ from pprint import pprint # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.AnotherFakeApi(petstore_api.ApiClient(configuration)) -client = petstore_api.Client() # Client | client model - -try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(client) - pprint(api_response) -except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.AnotherFakeApi(api_client) + client = petstore_api.Client() # Client | client model + try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(client) + pprint(api_response) + except ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) + ``` ## Documentation for API Endpoints diff --git a/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md index 9f419af3441..d93ffd79f19 100644 --- a/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md @@ -23,16 +23,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.AnotherFakeApi() -client = petstore_api.Client() # Client | client model +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.AnotherFakeApi(api_client) + client = petstore_api.Client() # Client | client model -try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(client) - pprint(api_response) -except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) + try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(client) + pprint(api_response) + except ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) ``` ### Parameters diff --git a/samples/openapi3/client/petstore/python/docs/DefaultApi.md b/samples/openapi3/client/petstore/python/docs/DefaultApi.md index 92e27f40a24..dbb994da49c 100644 --- a/samples/openapi3/client/petstore/python/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/python/docs/DefaultApi.md @@ -21,14 +21,16 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.DefaultApi() - -try: - api_response = api_instance.foo_get() - pprint(api_response) -except ApiException as e: - print("Exception when calling DefaultApi->foo_get: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.DefaultApi(api_client) + + try: + api_response = api_instance.foo_get() + pprint(api_response) + except ApiException as e: + print("Exception when calling DefaultApi->foo_get: %s\n" % e) ``` ### Parameters diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python/docs/FakeApi.md index 428e61341c3..c17ac031d41 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/FakeApi.md @@ -34,15 +34,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() - -try: - # Health check endpoint - api_response = api_instance.fake_health_get() - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_health_get: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + + try: + # Health check endpoint + api_response = api_instance.fake_health_get() + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->fake_health_get: %s\n" % e) ``` ### Parameters @@ -84,15 +86,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = True # bool | Input boolean as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = True # bool | Input boolean as post body (optional) -try: - api_response = api_instance.fake_outer_boolean_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) + try: + api_response = api_instance.fake_outer_boolean_serialize(body=body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) ``` ### Parameters @@ -137,15 +141,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -outer_composite = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + outer_composite = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) -try: - api_response = api_instance.fake_outer_composite_serialize(outer_composite=outer_composite) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) + try: + api_response = api_instance.fake_outer_composite_serialize(outer_composite=outer_composite) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) ``` ### Parameters @@ -190,15 +196,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = 3.4 # float | Input number as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = 3.4 # float | Input number as post body (optional) -try: - api_response = api_instance.fake_outer_number_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) + try: + api_response = api_instance.fake_outer_number_serialize(body=body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) ``` ### Parameters @@ -243,15 +251,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = 'body_example' # str | Input string as post body (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + body = 'body_example' # str | Input string as post body (optional) -try: - api_response = api_instance.fake_outer_string_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) + try: + api_response = api_instance.fake_outer_string_serialize(body=body) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) ``` ### Parameters @@ -296,14 +306,16 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -file_schema_test_class = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + file_schema_test_class = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | -try: - api_instance.test_body_with_file_schema(file_schema_test_class) -except ApiException as e: - print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) + try: + api_instance.test_body_with_file_schema(file_schema_test_class) + except ApiException as e: + print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) ``` ### Parameters @@ -346,15 +358,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -query = 'query_example' # str | +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + query = 'query_example' # str | user = petstore_api.User() # User | -try: - api_instance.test_body_with_query_params(query, user) -except ApiException as e: - print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) + try: + api_instance.test_body_with_query_params(query, user) + except ApiException as e: + print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) ``` ### Parameters @@ -400,16 +414,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -client = petstore_api.Client() # Client | client model +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + client = petstore_api.Client() # Client | client model -try: - # To test \"client\" model - api_response = api_instance.test_client_model(client) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->test_client_model: %s\n" % e) + try: + # To test \"client\" model + api_response = api_instance.test_client_model(client) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeApi->test_client_model: %s\n" % e) ``` ### Parameters @@ -461,9 +477,11 @@ configuration.password = 'YOUR_PASSWORD' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) -number = 3.4 # float | None +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + number = 3.4 # float | None double = 3.4 # float | None pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None byte = 'byte_example' # str | None @@ -478,11 +496,11 @@ date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) password = 'password_example' # str | None (optional) param_callback = 'param_callback_example' # str | None (optional) -try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) -except ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) + try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) + except ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) ``` ### Parameters @@ -541,9 +559,11 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') @@ -552,11 +572,11 @@ enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$') enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') -try: - # To test enum parameters - api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) -except ApiException as e: - print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) + try: + # To test enum parameters + api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) + except ApiException as e: + print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) ``` ### Parameters @@ -615,20 +635,22 @@ configuration.access_token = 'YOUR_BEARER_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) -required_string_group = 56 # int | Required String in group parameters +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + required_string_group = 56 # int | Required String in group parameters required_boolean_group = True # bool | Required Boolean in group parameters required_int64_group = 56 # int | Required Integer in group parameters string_group = 56 # int | String in group parameters (optional) boolean_group = True # bool | Boolean in group parameters (optional) int64_group = 56 # int | Integer in group parameters (optional) -try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) -except ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) + try: + # Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) + except ApiException as e: + print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) ``` ### Parameters @@ -676,15 +698,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -request_body = {'key': 'request_body_example'} # dict(str, str) | request body +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + request_body = {'key': 'request_body_example'} # dict(str, str) | request body -try: - # test inline additionalProperties - api_instance.test_inline_additional_properties(request_body) -except ApiException as e: - print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) + try: + # test inline additionalProperties + api_instance.test_inline_additional_properties(request_body) + except ApiException as e: + print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) ``` ### Parameters @@ -727,16 +751,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -param = 'param_example' # str | field1 +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + param = 'param_example' # str | field1 param2 = 'param2_example' # str | field2 -try: - # test json serialization of form data - api_instance.test_json_form_data(param, param2) -except ApiException as e: - print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) + try: + # test json serialization of form data + api_instance.test_json_form_data(param, param2) + except ApiException as e: + print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) ``` ### Parameters @@ -782,18 +808,20 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -pipe = ['pipe_example'] # list[str] | +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + pipe = ['pipe_example'] # list[str] | ioutil = ['ioutil_example'] # list[str] | http = ['http_example'] # list[str] | url = ['url_example'] # list[str] | context = ['context_example'] # list[str] | -try: - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) -except ApiException as e: - print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) + try: + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) + except ApiException as e: + print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) ``` ### Parameters diff --git a/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md index 5397122203b..3606bdea3aa 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md @@ -31,16 +31,18 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) -client = petstore_api.Client() # Client | client model +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeClassnameTags123Api(api_client) + client = petstore_api.Client() # Client | client model -try: - # To test class name in snake case - api_response = api_instance.test_classname(client) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) + try: + # To test class name in snake case + api_response = api_instance.test_classname(client) + pprint(api_response) + except ApiException as e: + print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) ``` ### Parameters diff --git a/samples/openapi3/client/petstore/python/docs/PetApi.md b/samples/openapi3/client/petstore/python/docs/PetApi.md index 5bbf43d4c29..40d68d83cdb 100644 --- a/samples/openapi3/client/petstore/python/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python/docs/PetApi.md @@ -35,15 +35,17 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store -try: - # Add a new pet to the store - api_instance.add_pet(pet) -except ApiException as e: - print("Exception when calling PetApi->add_pet: %s\n" % e) + try: + # Add a new pet to the store + api_instance.add_pet(pet) + except ApiException as e: + print("Exception when calling PetApi->add_pet: %s\n" % e) ``` ### Parameters @@ -92,16 +94,18 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | Pet id to delete +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | Pet id to delete api_key = 'api_key_example' # str | (optional) -try: - # Deletes a pet - api_instance.delete_pet(pet_id, api_key=api_key) -except ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) + try: + # Deletes a pet + api_instance.delete_pet(pet_id, api_key=api_key) + except ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) ``` ### Parameters @@ -153,16 +157,18 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -status = ['status_example'] # list[str] | Status values that need to be considered for filter +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + status = ['status_example'] # list[str] | Status values that need to be considered for filter -try: - # Finds Pets by status - api_response = api_instance.find_pets_by_status(status) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) + try: + # Finds Pets by status + api_response = api_instance.find_pets_by_status(status) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) ``` ### Parameters @@ -214,16 +220,18 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -tags = ['tags_example'] # list[str] | Tags to filter by +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + tags = ['tags_example'] # list[str] | Tags to filter by -try: - # Finds Pets by tags - api_response = api_instance.find_pets_by_tags(tags) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) + try: + # Finds Pets by tags + api_response = api_instance.find_pets_by_tags(tags) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) ``` ### Parameters @@ -277,16 +285,18 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to return +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to return -try: - # Find pet by ID - api_response = api_instance.get_pet_by_id(pet_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) + try: + # Find pet by ID + api_response = api_instance.get_pet_by_id(pet_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) ``` ### Parameters @@ -337,15 +347,17 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store -try: - # Update an existing pet - api_instance.update_pet(pet) -except ApiException as e: - print("Exception when calling PetApi->update_pet: %s\n" % e) + try: + # Update an existing pet + api_instance.update_pet(pet) + except ApiException as e: + print("Exception when calling PetApi->update_pet: %s\n" % e) ``` ### Parameters @@ -396,17 +408,19 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet that needs to be updated +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet that needs to be updated name = 'name_example' # str | Updated name of the pet (optional) status = 'status_example' # str | Updated status of the pet (optional) -try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id, name=name, status=status) -except ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) + try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id, name=name, status=status) + except ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) ``` ### Parameters @@ -457,18 +471,20 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to update +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to update additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) file = '/path/to/file' # file | file to upload (optional) -try: - # uploads an image - api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->upload_file: %s\n" % e) + try: + # uploads an image + api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) ``` ### Parameters @@ -519,18 +535,20 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to update +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.PetApi(api_client) + pet_id = 56 # int | ID of pet to update required_file = '/path/to/file' # file | file to upload additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) -try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) + try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) + pprint(api_response) + except ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) ``` ### Parameters diff --git a/samples/openapi3/client/petstore/python/docs/StoreApi.md b/samples/openapi3/client/petstore/python/docs/StoreApi.md index aa2aafec805..5f5d3ef3411 100644 --- a/samples/openapi3/client/petstore/python/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/python/docs/StoreApi.md @@ -26,15 +26,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -order_id = 'order_id_example' # str | ID of the order that needs to be deleted +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + order_id = 'order_id_example' # str | ID of the order that needs to be deleted -try: - # Delete purchase order by ID - api_instance.delete_order(order_id) -except ApiException as e: - print("Exception when calling StoreApi->delete_order: %s\n" % e) + try: + # Delete purchase order by ID + api_instance.delete_order(order_id) + except ApiException as e: + print("Exception when calling StoreApi->delete_order: %s\n" % e) ``` ### Parameters @@ -88,15 +90,17 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' # Defining host is optional and default to http://petstore.swagger.io:80/v2 configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) - -try: - # Returns pet inventories by status - api_response = api_instance.get_inventory() - pprint(api_response) -except ApiException as e: - print("Exception when calling StoreApi->get_inventory: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + + try: + # Returns pet inventories by status + api_response = api_instance.get_inventory() + pprint(api_response) + except ApiException as e: + print("Exception when calling StoreApi->get_inventory: %s\n" % e) ``` ### Parameters @@ -138,16 +142,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -order_id = 56 # int | ID of pet that needs to be fetched +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + order_id = 56 # int | ID of pet that needs to be fetched -try: - # Find purchase order by ID - api_response = api_instance.get_order_by_id(order_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) + try: + # Find purchase order by ID + api_response = api_instance.get_order_by_id(order_id) + pprint(api_response) + except ApiException as e: + print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) ``` ### Parameters @@ -192,16 +198,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -order = petstore_api.Order() # Order | order placed for purchasing the pet +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.StoreApi(api_client) + order = petstore_api.Order() # Order | order placed for purchasing the pet -try: - # Place an order for a pet - api_response = api_instance.place_order(order) - pprint(api_response) -except ApiException as e: - print("Exception when calling StoreApi->place_order: %s\n" % e) + try: + # Place an order for a pet + api_response = api_instance.place_order(order) + pprint(api_response) + except ApiException as e: + print("Exception when calling StoreApi->place_order: %s\n" % e) ``` ### Parameters diff --git a/samples/openapi3/client/petstore/python/docs/UserApi.md b/samples/openapi3/client/petstore/python/docs/UserApi.md index cd3eee51150..6de550edd98 100644 --- a/samples/openapi3/client/petstore/python/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python/docs/UserApi.md @@ -30,15 +30,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -user = petstore_api.User() # User | Created user object +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + user = petstore_api.User() # User | Created user object -try: - # Create user - api_instance.create_user(user) -except ApiException as e: - print("Exception when calling UserApi->create_user: %s\n" % e) + try: + # Create user + api_instance.create_user(user) + except ApiException as e: + print("Exception when calling UserApi->create_user: %s\n" % e) ``` ### Parameters @@ -81,15 +83,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -user = [petstore_api.User()] # list[User] | List of user object +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + user = [petstore_api.User()] # list[User] | List of user object -try: - # Creates list of users with given input array - api_instance.create_users_with_array_input(user) -except ApiException as e: - print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) + try: + # Creates list of users with given input array + api_instance.create_users_with_array_input(user) + except ApiException as e: + print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) ``` ### Parameters @@ -132,15 +136,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -user = [petstore_api.User()] # list[User] | List of user object +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + user = [petstore_api.User()] # list[User] | List of user object -try: - # Creates list of users with given input array - api_instance.create_users_with_list_input(user) -except ApiException as e: - print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) + try: + # Creates list of users with given input array + api_instance.create_users_with_list_input(user) + except ApiException as e: + print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) ``` ### Parameters @@ -185,15 +191,17 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The name that needs to be deleted +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The name that needs to be deleted -try: - # Delete user - api_instance.delete_user(username) -except ApiException as e: - print("Exception when calling UserApi->delete_user: %s\n" % e) + try: + # Delete user + api_instance.delete_user(username) + except ApiException as e: + print("Exception when calling UserApi->delete_user: %s\n" % e) ``` ### Parameters @@ -237,16 +245,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. -try: - # Get user by user name - api_response = api_instance.get_user_by_name(username) - pprint(api_response) -except ApiException as e: - print("Exception when calling UserApi->get_user_by_name: %s\n" % e) + try: + # Get user by user name + api_response = api_instance.get_user_by_name(username) + pprint(api_response) + except ApiException as e: + print("Exception when calling UserApi->get_user_by_name: %s\n" % e) ``` ### Parameters @@ -291,17 +301,19 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The user name for login +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | The user name for login password = 'password_example' # str | The password for login in clear text -try: - # Logs user into the system - api_response = api_instance.login_user(username, password) - pprint(api_response) -except ApiException as e: - print("Exception when calling UserApi->login_user: %s\n" % e) + try: + # Logs user into the system + api_response = api_instance.login_user(username, password) + pprint(api_response) + except ApiException as e: + print("Exception when calling UserApi->login_user: %s\n" % e) ``` ### Parameters @@ -346,14 +358,16 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() - -try: - # Logs out current logged in user session - api_instance.logout_user() -except ApiException as e: - print("Exception when calling UserApi->logout_user: %s\n" % e) +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + + try: + # Logs out current logged in user session + api_instance.logout_user() + except ApiException as e: + print("Exception when calling UserApi->logout_user: %s\n" % e) ``` ### Parameters @@ -395,16 +409,18 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | name that need to be deleted +# Enter a context with an instance of the API client +with petstore_api.ApiClient() as api_client: + # Create an instance of the API class + api_instance = petstore_api.UserApi(api_client) + username = 'username_example' # str | name that need to be deleted user = petstore_api.User() # User | Updated user object -try: - # Updated user - api_instance.update_user(username, user) -except ApiException as e: - print("Exception when calling UserApi->update_user: %s\n" % e) + try: + # Updated user + api_instance.update_user(username, user) + except ApiException as e: + print("Exception when calling UserApi->update_user: %s\n" % e) ``` ### Parameters diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index a18f322840f..aec97a99e06 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -10,6 +10,7 @@ from __future__ import absolute_import +import atexit import datetime from dateutil.parser import parse import json @@ -80,11 +81,19 @@ class ApiClient(object): self.user_agent = 'OpenAPI-Generator/1.0.0/python' self.client_side_validation = configuration.client_side_validation - def __del__(self): + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): if self._pool: self._pool.close() self._pool.join() self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) @property def pool(self): @@ -92,6 +101,7 @@ class ApiClient(object): avoids instantiating unused threadpool for blocking clients. """ if self._pool is None: + atexit.register(self.close) self._pool = ThreadPool(self.pool_threads) return self._pool From 0f48ab8b15d94860e39e4f31260f02a8808c2371 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 29 Jan 2020 16:09:08 +0800 Subject: [PATCH 43/85] Add bkabrda to Java technical committee (#5141) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index da24519d45a..a5b5451764c 100644 --- a/README.md +++ b/README.md @@ -924,7 +924,7 @@ If you want to join the committee, please kindly apply by sending an email to te | GraphQL | @renepardon (2018/12) | | Groovy | | | Haskell | | -| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) | +| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @bkabrda (2020/01) | | Kotlin | @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) | | Lua | @daurnimator (2017/08) | | Nim | | From f37951a0bae6b2eb1996427a6e31f8d77951bcb6 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 29 Jan 2020 16:20:50 +0800 Subject: [PATCH 44/85] Add a link to dev.to article (#5142) --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a5b5451764c..86a0f282887 100644 --- a/README.md +++ b/README.md @@ -727,8 +727,10 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2019-12-04 - [Angular+NestJS+OpenAPI(Swagger)でマイクロサービスを視野に入れた環境を考える](https://qiita.com/teracy55/items/0327c7a170ec772970c6) by [てらしー](https://twitter.com/teracy55) - 2019-12-17 - [OpenAPI Generator で OAuth2 アクセストークン発行のコードまで生成してみる](https://www.techscore.com/blog/2019/12/17/openapi-generator-oauth2-accesstoken/) by [TECHSCORE](https://www.techscore.com/blog/) - 2019-12-23 - [Use Ada for Your Web Development](https://www.electronicdesign.com/technologies/embedded-revolution/article/21119177/use-ada-for-your-web-development) by [Stephane Carrez](https://github.com/stcarrez) -- 2019-01-17 - [OpenAPI demo for Pulp 3.0 GA](https://www.youtube.com/watch?v=mFBP-M0ZPfw&t=178s) by [Pulp](https://www.youtube.com/channel/UCI43Ffs4VPDv7awXvvBJfRQ) at [Youtube](https://www.youtube.com/) -- 2019-01-19 - [Why document a REST API as code?](https://dev.to/rolfstreefkerk/why-document-a-rest-api-as-code-5e7p) by [Rolf Streefkerk](https://github.com/rpstreef) at [DEV Community](https://dev.to) +- 2020-01-17 - [OpenAPI demo for Pulp 3.0 GA](https://www.youtube.com/watch?v=mFBP-M0ZPfw&t=178s) by [Pulp](https://www.youtube.com/channel/UCI43Ffs4VPDv7awXvvBJfRQ) at [Youtube](https://www.youtube.com/) +- 2020-01-19 - [Why document a REST API as code?](https://dev.to/rolfstreefkerk/why-document-a-rest-api-as-code-5e7p) by [Rolf Streefkerk](https://github.com/rpstreef) at [DEV Community](https://dev.to) +- 2020-01-28 - [Get Your Serverless Swagger Back with OpenAPI](https://dev.to/matttyler/get-your-serverless-swagger-back-with-openapi-48gc) by [Matt Tyler](https://dev.to/matttyler) +- ## [6 - About Us](#table-of-contents) From 1ac0f141a6a14d1563eb248258d688e2cca29bf8 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Wed, 29 Jan 2020 03:28:42 -0500 Subject: [PATCH 45/85] [feature] Default CI log level for slf4j-simple to error to prevent noise (#5118) * [feature] Log "debounce" filter to remove spam. * [log] slf4j-simple should be optional This also sets the default log level to ERROR during CI builds for many mvn invocations. This should reduce noise in the logs. * [log] Rely only on mvn loglevel=error for now * [cli] Clean up unused dependency * [log] Change level to error/warn in more CI --- .travis.yml | 12 ++++++------ CI/.drone.yml | 4 ++-- CI/bitrise.yml | 2 +- CI/circle_parallel.sh | 8 ++++---- appveyor.yml | 2 +- bin/openapi3/run-all-petstore | 1 + bin/utils/ensure-up-to-date | 3 +-- circle.yml | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8c3abe8a927..f439e764404 100644 --- a/.travis.yml +++ b/.travis.yml @@ -133,13 +133,13 @@ script: - /bin/bash ./bin/utils/detect_tab_in_java_class.sh # run integration tests defined in maven pom.xml # WARN: Travis will timeout after 10 minutes of no stdout/stderr activity, which is problematic with mvn --quiet. - - mvn --quiet --batch-mode --show-version clean install - - mvn --quiet --batch-mode --show-version verify -Psamples + - mvn --quiet --batch-mode --show-version clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error + - mvn --quiet --batch-mode --show-version verify -Psamples -Dorg.slf4j.simpleLogger.defaultLogLevel=error # test maven plugin - - mvn --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml - - mvn --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml - - mvn --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml - - mvn --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml + - mvn --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error + - mvn --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error + - mvn --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error + - mvn --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error # test gradle plugin - (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildGoSdk) - (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew openApiGenerate) diff --git a/CI/.drone.yml b/CI/.drone.yml index 8594d0b486d..04523009a08 100644 --- a/CI/.drone.yml +++ b/CI/.drone.yml @@ -29,8 +29,8 @@ steps: - name: java11-test image: openjdk:11.0 commands: - - ./mvnw clean install - - ./mvnw --quiet verify -Psamples.droneio + - ./mvnw -quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error + - ./mvnw --quiet verify -Psamples.droneio -Dorg.slf4j.simpleLogger.defaultLogLevel=error # test all generators with fake petstore spec (2.0, 3.0) - /bin/bash bin/utils/test-fake-petstore-for-all.sh # generate test scripts diff --git a/CI/bitrise.yml b/CI/bitrise.yml index cfdb8601ecf..4b07417c80b 100644 --- a/CI/bitrise.yml +++ b/CI/bitrise.yml @@ -28,7 +28,7 @@ workflows: set -e - mvn package + mvn package -Dorg.slf4j.simpleLogger.defaultLogLevel=error title: Build openapi-generator - script@1.1.5: title: Update Swift4 samples diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index b7142b28a9d..913ef4754c4 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -11,8 +11,8 @@ if [ "$NODE_INDEX" = "1" ]; then echo "Running node $NODE_INDEX to test 'samples.circleci' defined in pom.xml ..." #cp CI/pom.xml.circleci pom.xml java -version - mvn --quiet verify -Psamples.circleci - mvn --quiet javadoc:javadoc -Psamples.circleci + mvn --quiet verify -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error + mvn --quiet javadoc:javadoc -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error elif [ "$NODE_INDEX" = "2" ]; then # run ensure-up-to-date sample script on SNAPSHOT version only @@ -47,13 +47,13 @@ elif [ "$NODE_INDEX" = "2" ]; then sudo apt-get -y build-dep libcurl4-gnutls-dev sudo apt-get -y install libcurl4-gnutls-dev # run integration tests - mvn --quiet verify -Psamples.misc + mvn --quiet verify -Psamples.misc -Dorg.slf4j.simpleLogger.defaultLogLevel=error else echo "Running node $NODE_INDEX to test 'samples.circleci.jdk7' defined in pom.xml ..." sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 java -version #cp CI/pom.xml.circleci.java7 pom.xml - mvn --quiet verify -Psamples.circleci.jdk7 + mvn --quiet verify -Psamples.circleci.jdk7 -Dorg.slf4j.simpleLogger.defaultLogLevel=error fi diff --git a/appveyor.yml b/appveyor.yml index b029aa6944d..febaf777b63 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -48,7 +48,7 @@ build_script: - nuget restore samples\client\petstore\csharp\OpenAPIClientNetStandard\Org.OpenAPITools.sln - msbuild samples\client\petstore\csharp\OpenAPIClientNetStandard\Org.OpenAPITools.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" # install openapi-generator locally - - mvn clean install --quiet + - mvn clean install --quiet -Dorg.slf4j.simpleLogger.defaultLogLevel=error # run the locally installed openapi-generator-gradle-plugin - gradle -b modules\openapi-generator-gradle-plugin\samples\local-spec\build.gradle buildGoSdk --info test_script: diff --git a/bin/openapi3/run-all-petstore b/bin/openapi3/run-all-petstore index ece3a1a14be..4ee75b99f62 100755 --- a/bin/openapi3/run-all-petstore +++ b/bin/openapi3/run-all-petstore @@ -10,6 +10,7 @@ sleep 10 successes=0 failures=0 +export JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" for SCRIPT in $(ls -l ./bin/openapi3/*.sh | grep -v all) do if [ -f ${SCRIPT} -a -x ${SCRIPT} ]; then diff --git a/bin/utils/ensure-up-to-date b/bin/utils/ensure-up-to-date index b2a8c19ab4a..9d03f59123b 100755 --- a/bin/utils/ensure-up-to-date +++ b/bin/utils/ensure-up-to-date @@ -93,8 +93,7 @@ declare -a always_iterate=( "${root}/bin/utils/export_generators_readme.sh" ) -export JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true" - +export JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true -Dorg.slf4j.simpleLogger.defaultLogLevel=warn" if [ "true" = "$batch_mode" ]; then if [ ! -f "$executable" ]; then (cd "${root}" && mvn -B clean package -DskipTests=true -Dmaven.javadoc.skip=true) diff --git a/circle.yml b/circle.yml index 7534998122d..7f42b347114 100644 --- a/circle.yml +++ b/circle.yml @@ -66,7 +66,7 @@ jobs: - run: sleep 30 - run: cat /etc/hosts # Test - - run: mvn --quiet clean install + - run: mvn --quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error - run: ./CI/circle_parallel.sh # Save dependency cache - save_cache: From 8214460ec5339bed03ed5e9d01a5ef99d16f38ea Mon Sep 17 00:00:00 2001 From: "Yutaka.Miyamae" <48900426+yutaka0m@users.noreply.github.com> Date: Wed, 29 Jan 2020 17:30:33 +0900 Subject: [PATCH 46/85] Add deprecated annotation in kotlin-spring (#5090) * add Deprecated in kotlin dataClass * add deprecated in CodegenProperty * format (Column limit: 100) * set property.deprecated * add test * run ./bin/kotlin-springboot-petstore-all.sh * trim space --- .../openapitools/codegen/CodegenProperty.java | 27 ++++++----- .../openapitools/codegen/DefaultCodegen.java | 6 ++- .../kotlin-spring/dataClassOptVar.mustache | 3 +- .../codegen/DefaultCodegenTest.java | 16 +++++++ .../resources/3_0/property-deplicated.yaml | 46 +++++++++++++++++++ .../.openapi-generator/VERSION | 2 +- .../main/kotlin/org/openapitools/model/Pet.kt | 4 +- 7 files changed, 88 insertions(+), 16 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/property-deplicated.yaml 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 d2f0a5ee3b1..c3257231e28 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 @@ -54,6 +54,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti public boolean exclusiveMaximum; public boolean hasMore; public boolean required; + public boolean deprecated; public boolean secondaryParam; public boolean hasMoreNonReadOnly; // for model constructor, true if next property is not readonly public boolean isPrimitiveType; @@ -554,6 +555,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti sb.append(", exclusiveMaximum=").append(exclusiveMaximum); sb.append(", hasMore=").append(hasMore); sb.append(", required=").append(required); + sb.append(", deprecated=").append(deprecated); sb.append(", secondaryParam=").append(secondaryParam); sb.append(", hasMoreNonReadOnly=").append(hasMoreNonReadOnly); sb.append(", isPrimitiveType=").append(isPrimitiveType); @@ -619,6 +621,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti exclusiveMaximum == that.exclusiveMaximum && hasMore == that.hasMore && required == that.required && + deprecated == this.deprecated && secondaryParam == that.secondaryParam && hasMoreNonReadOnly == that.hasMoreNonReadOnly && isPrimitiveType == that.isPrimitiveType && @@ -698,16 +701,18 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti @Override public int hashCode() { - return Objects.hash(openApiType, baseName, complexType, getter, setter, description, dataType, - datatypeWithEnum, dataFormat, name, min, max, defaultValue, defaultValueWithParam, baseType, - containerType, title, unescapedDescription, maxLength, minLength, pattern, example, jsonSchema, - minimum, maximum, exclusiveMinimum, exclusiveMaximum, hasMore, required, secondaryParam, - hasMoreNonReadOnly, isPrimitiveType, isModel, isContainer, isString, isNumeric, isInteger, - isLong, isNumber, isFloat, isDouble, isByteArray, isBinary, isFile, isBoolean, isDate, isDateTime, - isUuid, isUri, isEmail, isFreeFormObject, isListContainer, isMapContainer, isEnum, isReadOnly, - isWriteOnly, isNullable, isSelfReference, isCircularReference, _enum, allowableValues, items, - mostInnerItems, vendorExtensions, hasValidation, isInherited, discriminatorValue, nameInCamelCase, - nameInSnakeCase, enumName, maxItems, minItems, isXmlAttribute, xmlPrefix, xmlName, xmlNamespace, - isXmlWrapped, multipleOf); + return Objects.hash(openApiType, baseName, complexType, getter, setter, description, + dataType, datatypeWithEnum, dataFormat, name, min, max, defaultValue, + defaultValueWithParam, baseType, containerType, title, unescapedDescription, + maxLength, minLength, pattern, example, jsonSchema, minimum, maximum, + exclusiveMinimum, exclusiveMaximum, hasMore, required, deprecated, secondaryParam, + hasMoreNonReadOnly, isPrimitiveType, isModel, isContainer, isString, isNumeric, + isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBinary, isFile, + isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, + isListContainer, isMapContainer, isEnum, isReadOnly, isWriteOnly, isNullable, + isSelfReference, isCircularReference, _enum, allowableValues, items, mostInnerItems, + vendorExtensions, hasValidation, isInherited, discriminatorValue, nameInCamelCase, + nameInSnakeCase, enumName, maxItems, minItems, isXmlAttribute, xmlPrefix, xmlName, + xmlNamespace, isXmlWrapped); } } 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 6fd90ee2302..ac72e581154 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 @@ -2255,6 +2255,10 @@ public class DefaultCodegen implements CodegenConfig { property.defaultValue = toDefaultValue(p); property.defaultValueWithParam = toDefaultValueWithParam(name, p); property.jsonSchema = Json.pretty(p); + + if (p.getDeprecated() != null) { + property.deprecated = p.getDeprecated(); + } if (p.getReadOnly() != null) { property.isReadOnly = p.getReadOnly(); } @@ -5477,4 +5481,4 @@ public class DefaultCodegen implements CodegenConfig { public void setFeatureSet(final FeatureSet featureSet) { this.featureSet = featureSet == null ? DefaultFeatureSet : featureSet; } -} +} \ No newline at end of file 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 5e801f73576..0f5001411af 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,5 @@ {{#useBeanValidation}}{{#required}} {{^isReadOnly}}@get:NotNull{{/isReadOnly}} {{/required}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swaggerAnnotations}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swaggerAnnotations}} + @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swaggerAnnotations}}{{#deprecated}} + @Deprecated(message=""){{/deprecated}} @JsonProperty("{{{baseName}}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{baseType}}<{{/isListContainer}}{{classname}}.{{nameInCamelCase}}{{#isListContainer}}>{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}} \ No newline at end of file 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 1c134dcb2d0..83dfc91ebd2 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 @@ -678,6 +678,22 @@ public class DefaultCodegenTest { Assert.assertTrue(property.isNullable); } + @Test + public void testDeprecatedProperty() { + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/property-deplicated.yaml"); + new InlineModelResolver().flatten(openAPI); + final DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + final Map responseProperties = Collections.unmodifiableMap(openAPI.getComponents().getSchemas().get("Response").getProperties()); + final Map requestProperties = Collections.unmodifiableMap(openAPI.getComponents().getSchemas().get("Response").getProperties()); + + Assert.assertTrue(codegen.fromProperty("firstName",(Schema) responseProperties.get("firstName")).deprecated); + Assert.assertFalse(codegen.fromProperty("customerCode",(Schema) responseProperties.get("customerCode")).deprecated); + Assert.assertTrue(codegen.fromProperty("firstName",(Schema) requestProperties.get("firstName")).deprecated); + Assert.assertFalse(codegen.fromProperty("customerCode",(Schema) requestProperties.get("customerCode")).deprecated); + } + @Test public void integerSchemaPropertyAndModelTest() { OpenAPI openAPI = TestUtils.createOpenAPI(); diff --git a/modules/openapi-generator/src/test/resources/3_0/property-deplicated.yaml b/modules/openapi-generator/src/test/resources/3_0/property-deplicated.yaml new file mode 100644 index 00000000000..d4d8220c33a --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/property-deplicated.yaml @@ -0,0 +1,46 @@ +openapi: 3.0.1 +info: + version: 1.0.0 + title: Example + license: + name: MIT +servers: + - url: http://api.example.xyz/v1 +paths: + /deprecated-test: + x-swagger-router-controller: /deprecated-test + post: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Request' + responses: + '200': + description: responses + content: + application/json: + schema: + $ref: '#/components/schemas/Response' +components: + schemas: + Request: + type: object + properties: + customerCode: + type: string + example: '0001' + firstName: + type: string + deprecated: true + example: 'first' + Response: + type: object + properties: + customerCode: + type: string + example: '0001' + firstName: + type: string + deprecated: true + example: 'first' diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION index d168f1d8bda..58592f031f6 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.1-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt index f0ff8c00c1d..5868cb23e3f 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt @@ -16,10 +16,10 @@ import io.swagger.annotations.ApiModelProperty /** * A pet for sale in the pet store - * @param id - * @param category * @param name * @param photoUrls + * @param id + * @param category * @param tags * @param status pet status in the store */ From e27700cfee07be5413221413b1b668d3de259296 Mon Sep 17 00:00:00 2001 From: Tatsuro Shibamura Date: Wed, 29 Jan 2020 17:50:06 +0900 Subject: [PATCH 47/85] [csharp-netcore] Support .NET Core 3.0/3.1 and .NET Standard 2.1 (#5111) * Add .NET Core 3.x / .NET Standard 2.1 * Fixed test project target framework * Fixed missing sync property * Update generator docs --- docs/generators/csharp-netcore.md | 2 +- .../languages/CSharpNetCoreClientCodegen.java | 44 +++++++++++++------ .../csharp-netcore/TestProject.mustache | 3 +- .../netcore_testproject.mustache | 2 +- 4 files changed, 34 insertions(+), 17 deletions(-) diff --git a/docs/generators/csharp-netcore.md b/docs/generators/csharp-netcore.md index 7b67601f3d3..8cf2d0ee54a 100644 --- a/docs/generators/csharp-netcore.md +++ b/docs/generators/csharp-netcore.md @@ -25,7 +25,7 @@ sidebar_label: csharp-netcore |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
    **netcoreapp2.0**
    .NET Core 2.0 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
    |netstandard2.0| |useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| |useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| |validatable|Generates self-validatable models.| |true| 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 f17168d19d7..95ced94f2f8 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 @@ -56,7 +56,11 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { FrameworkStrategy.NETSTANDARD_1_5, FrameworkStrategy.NETSTANDARD_1_6, FrameworkStrategy.NETSTANDARD_2_0, - FrameworkStrategy.NETCOREAPP_2_0 + FrameworkStrategy.NETSTANDARD_2_1, + FrameworkStrategy.NETCOREAPP_2_0, + FrameworkStrategy.NETCOREAPP_2_1, + FrameworkStrategy.NETCOREAPP_3_0, + FrameworkStrategy.NETCOREAPP_3_1 ); private static FrameworkStrategy defaultFramework = FrameworkStrategy.NETSTANDARD_2_0; protected final Map frameworks; @@ -67,6 +71,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { // Defines TargetFrameworkVersion in csproj files protected String targetFramework = defaultFramework.name; + protected String testTargetFramework = defaultFramework.testTargetFramework; // Defines nuget identifiers for target framework protected String targetFrameworkNuget = targetFramework; @@ -548,6 +553,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { setTargetFrameworkNuget(strategy.getNugetFrameworkIdentifier()); setTargetFramework(strategy.name); + setTestTargetFramework(strategy.testTargetFramework); if (strategy != FrameworkStrategy.NETSTANDARD_2_0) { LOGGER.warn("If using built-in templates-RestSharp only supports netstandard 2.0 or later."); @@ -571,6 +577,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { syncStringProperty(additionalProperties, CodegenConstants.MODEL_PACKAGE, this::setModelPackage, modelPackage); syncStringProperty(additionalProperties, CodegenConstants.OPTIONAL_PROJECT_GUID, this::setPackageGuid, packageGuid); syncStringProperty(additionalProperties, "targetFrameworkNuget", this::setTargetFrameworkNuget, this.targetFrameworkNuget); + syncStringProperty(additionalProperties, "testTargetFramework", this::setTestTargetFramework, this.testTargetFramework); syncBooleanProperty(additionalProperties, "netStandard", this::setNetStandard, this.netStandard); @@ -702,6 +709,10 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { LOGGER.info("Generating code for .NET Framework " + this.targetFramework); } + public void setTestTargetFramework(String testTargetFramework) { + this.testTargetFramework = testTargetFramework; + } + public void setTargetFrameworkNuget(String targetFrameworkNuget) { this.targetFrameworkNuget = targetFrameworkNuget; } @@ -854,34 +865,41 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { // https://docs.microsoft.com/en-us/dotnet/standard/net-standard @SuppressWarnings("Duplicates") private static abstract class FrameworkStrategy { - static FrameworkStrategy NETSTANDARD_1_3 = new FrameworkStrategy("netstandard1.3", ".NET Standard 1.3 compatible", "v4.6.1") { + static FrameworkStrategy NETSTANDARD_1_3 = new FrameworkStrategy("netstandard1.3", ".NET Standard 1.3 compatible", "netcoreapp2.0") { }; - static FrameworkStrategy NETSTANDARD_1_4 = new FrameworkStrategy("netstandard1.4", ".NET Standard 1.4 compatible", "v4.6.1") { + static FrameworkStrategy NETSTANDARD_1_4 = new FrameworkStrategy("netstandard1.4", ".NET Standard 1.4 compatible", "netcoreapp2.0") { }; - static FrameworkStrategy NETSTANDARD_1_5 = new FrameworkStrategy("netstandard1.5", ".NET Standard 1.5 compatible", "v4.6.1") { + static FrameworkStrategy NETSTANDARD_1_5 = new FrameworkStrategy("netstandard1.5", ".NET Standard 1.5 compatible", "netcoreapp2.0") { }; - static FrameworkStrategy NETSTANDARD_1_6 = new FrameworkStrategy("netstandard1.6", ".NET Standard 1.6 compatible", "v4.6.1") { + static FrameworkStrategy NETSTANDARD_1_6 = new FrameworkStrategy("netstandard1.6", ".NET Standard 1.6 compatible", "netcoreapp2.0") { }; - static FrameworkStrategy NETSTANDARD_2_0 = new FrameworkStrategy("netstandard2.0", ".NET Standard 2.0 compatible", "v4.6.1") { + static FrameworkStrategy NETSTANDARD_2_0 = new FrameworkStrategy("netstandard2.0", ".NET Standard 2.0 compatible", "netcoreapp2.0") { }; - static FrameworkStrategy NETCOREAPP_2_0 = new FrameworkStrategy("netcoreapp2.0", ".NET Core 2.0 compatible", "v4.6.1", Boolean.FALSE) { - + static FrameworkStrategy NETSTANDARD_2_1 = new FrameworkStrategy("netstandard2.1", ".NET Standard 2.1 compatible", "netcoreapp3.0") { + }; + static FrameworkStrategy NETCOREAPP_2_0 = new FrameworkStrategy("netcoreapp2.0", ".NET Core 2.0 compatible", "netcoreapp2.0", Boolean.FALSE) { + }; + static FrameworkStrategy NETCOREAPP_2_1 = new FrameworkStrategy("netcoreapp2.1", ".NET Core 2.1 compatible", "netcoreapp2.1", Boolean.FALSE) { + }; + static FrameworkStrategy NETCOREAPP_3_0 = new FrameworkStrategy("netcoreapp3.0", ".NET Core 3.0 compatible", "netcoreapp3.0", Boolean.FALSE) { + }; + static FrameworkStrategy NETCOREAPP_3_1 = new FrameworkStrategy("netcoreapp3.1", ".NET Core 3.1 compatible", "netcoreapp3.1", Boolean.FALSE) { }; protected String name; protected String description; - protected String dotNetFrameworkVersion; + protected String testTargetFramework; private Boolean isNetStandard = Boolean.TRUE; - FrameworkStrategy(String name, String description, String dotNetFrameworkVersion) { + FrameworkStrategy(String name, String description, String testTargetFramework) { this.name = name; this.description = description; - this.dotNetFrameworkVersion = dotNetFrameworkVersion; + this.testTargetFramework = testTargetFramework; } - FrameworkStrategy(String name, String description, String dotNetFrameworkVersion, Boolean isNetStandard) { + FrameworkStrategy(String name, String description, String testTargetFramework, Boolean isNetStandard) { this.name = name; this.description = description; - this.dotNetFrameworkVersion = dotNetFrameworkVersion; + this.testTargetFramework = testTargetFramework; this.isNetStandard = isNetStandard; } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache index 9ef7ae726ae..a5d12469807 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache @@ -17,8 +17,7 @@ Properties {{testPackageName}} {{testPackageName}} - - netcoreapp2.0 + {{testTargetFramework}} false 512 diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache index aa4f8beb8b0..d6faf0b43f9 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache @@ -13,7 +13,7 @@ true true {{testPackageName}} - netcoreapp2.0 + {{testTargetFramework}} false From f4185b8d9e30612fa33f579ff5396aa3b5c748ed Mon Sep 17 00:00:00 2001 From: Hui Yu Date: Wed, 29 Jan 2020 16:57:31 +0800 Subject: [PATCH 48/85] [C-libcurl] Support HTTPS/SSL for the C client (#5140) --- .../resources/C-libcurl/apiClient.c.mustache | 23 +++++++++++++++++++ .../resources/C-libcurl/apiClient.h.mustache | 2 ++ 2 files changed, 25 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache index 0c3df633df3..69b2e74c331 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache @@ -13,6 +13,7 @@ apiClient_t *apiClient_create() { curl_global_init(CURL_GLOBAL_ALL); apiClient_t *apiClient = malloc(sizeof(apiClient_t)); apiClient->basePath = strdup("{{{basePath}}}"); + apiClient->caPath = NULL; apiClient->dataReceived = NULL; apiClient->response_code = 0; {{#hasAuthMethods}} @@ -34,6 +35,7 @@ apiClient_t *apiClient_create() { } apiClient_t *apiClient_create_with_base_path(const char *basePath +, const char *caPath {{#hasAuthMethods}} {{#authMethods}} {{#isApiKey}} @@ -49,6 +51,13 @@ apiClient_t *apiClient_create_with_base_path(const char *basePath }else{ apiClient->basePath = strdup("{{{basePath}}}"); } + + if(caPath){ + apiClient->caPath = strdup(caPath); + }else{ + apiClient->caPath = NULL; + } + apiClient->dataReceived = NULL; apiClient->response_code = 0; {{#hasAuthMethods}} @@ -83,6 +92,9 @@ void apiClient_free(apiClient_t *apiClient) { if(apiClient->basePath) { free(apiClient->basePath); } + if(apiClient->caPath) { + free(apiClient->caPath); + } {{#hasAuthMethods}} {{#authMethods}} {{#isBasic}} @@ -375,6 +387,17 @@ void apiClient_invoke(apiClient_t *apiClient, free(headerValueToWrite); } } + + if( strstr(apiClient->basePath, "https") != NULL ){ + if (apiClient->caPath) { + curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, true); + curl_easy_setopt(handle, CURLOPT_CAINFO, apiClient->caPath); + } else { + curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, false); + curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, false); + } + } + {{#hasAuthMethods}} {{#authMethods}} {{#isApiKey}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.h.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.h.mustache index 5abae164e68..08458228e9d 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.h.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.h.mustache @@ -11,6 +11,7 @@ typedef struct apiClient_t { char *basePath; + char *caPath; void *dataReceived; long response_code; {{#hasAuthMethods}} @@ -38,6 +39,7 @@ typedef struct binary_t apiClient_t* apiClient_create(); apiClient_t* apiClient_create_with_base_path(const char *basePath +, const char *caPath {{#hasAuthMethods}} {{#authMethods}} {{#isApiKey}} From 6cf58afdc5592198db28d1342be399e7130f31f7 Mon Sep 17 00:00:00 2001 From: LoveIsGrief Date: Wed, 29 Jan 2020 10:18:57 +0100 Subject: [PATCH 49/85] Switch to predominant use of appDescriptionWithNewLines in README.mustache (#5109) Descriptions tend to get lengthy and can include multiple lines. New lines are important to markdown formatting/syntax and can't just be ignored. Resolves https://github.com/OpenAPITools/openapi-generator/issues/3704 --- .../src/main/resources/Eiffel/README.mustache | 6 +++--- .../src/main/resources/Groovy/README.mustache | 6 +++--- .../src/main/resources/Java/README.mustache | 2 +- .../resources/Java/libraries/microprofile/README.mustache | 6 +++--- .../main/resources/Java/libraries/native/README.mustache | 2 +- .../resources/Java/libraries/okhttp-gson/README.mustache | 2 +- .../src/main/resources/Javascript/README.mustache | 6 +++--- .../src/main/resources/Javascript/es6/README.mustache | 6 +++--- .../src/main/resources/aspnetcore/2.0/README.mustache | 6 +++--- .../src/main/resources/aspnetcore/2.1/README.mustache | 8 ++++---- .../main/resources/cpp-rest-sdk-client/README.mustache | 6 +++--- .../src/main/resources/csharp-dotnet2/README.mustache | 6 +++--- .../src/main/resources/csharp-netcore/README.mustache | 6 +++--- .../src/main/resources/csharp/README.mustache | 6 +++--- .../src/main/resources/dart-dio/README.mustache | 6 +++--- .../src/main/resources/dart-jaguar/README.mustache | 6 +++--- .../src/main/resources/dart/README.mustache | 6 +++--- .../src/main/resources/dart2/README.mustache | 6 +++--- .../src/main/resources/elm/README.mustache | 6 +++--- .../src/main/resources/go-experimental/README.mustache | 6 +++--- .../src/main/resources/go-gin-server/README.mustache | 6 +++--- .../src/main/resources/go-server/README.mustache | 6 +++--- .../src/main/resources/go/README.mustache | 6 +++--- .../graphql-nodejs-express-server/README.mustache | 6 +++--- .../src/main/resources/graphql-schema/README.mustache | 6 +++--- .../src/main/resources/lua/README.mustache | 6 +++--- .../src/main/resources/nim-client/README.mustache | 6 +++--- .../src/main/resources/objc/README.mustache | 6 +++--- .../src/main/resources/ocaml/readme.mustache | 6 +++--- .../src/main/resources/perl/README.mustache | 2 +- .../src/main/resources/php-symfony/README.mustache | 6 +++--- .../src/main/resources/php/README.mustache | 6 +++--- .../src/main/resources/powershell/README.mustache | 6 +++--- .../src/main/resources/protobuf-schema/README.mustache | 6 +++--- .../src/main/resources/python/README.mustache | 6 +++--- .../resources/python/python-experimental/README.mustache | 6 +++--- .../src/main/resources/r/README.mustache | 6 +++--- .../src/main/resources/rust-server/README.mustache | 6 +++--- .../src/main/resources/rust/README.mustache | 6 +++--- .../src/main/resources/scala-akka-client/README.mustache | 4 ++-- .../src/main/resources/scala-httpclient/README.mustache | 8 ++++---- .../src/main/resources/swift4/README.mustache | 6 +++--- .../src/main/resources/swift5/README.mustache | 6 +++--- 43 files changed, 122 insertions(+), 122 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Eiffel/README.mustache b/modules/openapi-generator/src/main/resources/Eiffel/README.mustache index f8ba1b5e2eb..bc44aa484a5 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/README.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/README.mustache @@ -1,8 +1,8 @@ # Eiffel API client for {{packageName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. diff --git a/modules/openapi-generator/src/main/resources/Groovy/README.mustache b/modules/openapi-generator/src/main/resources/Groovy/README.mustache index 424dfb43575..be054fb041c 100644 --- a/modules/openapi-generator/src/main/resources/Groovy/README.mustache +++ b/modules/openapi-generator/src/main/resources/Groovy/README.mustache @@ -1,8 +1,8 @@ # {{packageName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} This Groovy package, using the [http-builder-ng library](https://http-builder-ng.github.io/http-builder-ng/), is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: diff --git a/modules/openapi-generator/src/main/resources/Java/README.mustache b/modules/openapi-generator/src/main/resources/Java/README.mustache index f1bb9f234cd..917f873d5dc 100644 --- a/modules/openapi-generator/src/main/resources/Java/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/README.mustache @@ -8,7 +8,7 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} -{{#appDescription}}{{{appDescription}}}{{/appDescription}} +{{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache index 576e70fe8ba..8d126ada313 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache @@ -1,9 +1,9 @@ # {{appName}} - MicroProfile Rest Client -{{#appDescription}} -{{{appDescription}}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} -{{/appDescription}} +{{/appDescriptionWithNewLines}} ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. [MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache index 44356cca82c..f574b47b485 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache @@ -8,7 +8,7 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} -{{#appDescription}}{{{appDescription}}}{{/appDescription}} +{{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) 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 e459ad31713..e9be868f52c 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 @@ -6,7 +6,7 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} -{{#appDescription}}{{{appDescription}}}{{/appDescription}} +{{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) diff --git a/modules/openapi-generator/src/main/resources/Javascript/README.mustache b/modules/openapi-generator/src/main/resources/Javascript/README.mustache index 2e3ea8723ab..fccb79dce5b 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/README.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/README.mustache @@ -1,9 +1,9 @@ # {{projectName}} {{moduleName}} - JavaScript client for {{projectName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: {{appVersion}} diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/README.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/README.mustache index 944e6029d52..dd4a6721a2d 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/README.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/README.mustache @@ -1,9 +1,9 @@ # {{projectName}} {{moduleName}} - JavaScript client for {{projectName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: {{appVersion}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/README.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/README.mustache index 71c4cfebb8b..37794bd48e0 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/README.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/README.mustache @@ -1,8 +1,8 @@ # {{packageName}} - ASP.NET Core 2.0 Server -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Run diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/README.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/README.mustache index 3dda0f304b5..d7582331bc0 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/README.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/README.mustache @@ -1,8 +1,8 @@ # {{packageName}} - ASP.NET Core 2.0 Server -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Run @@ -25,4 +25,4 @@ cd {{sourceFolder}}/{{packageName}} docker build -t {{dockerTag}} . docker run -p 5000:8080 {{dockerTag}} ``` -{{/isLibrary}} \ No newline at end of file +{{/isLibrary}} diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/README.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/README.mustache index b17cd6375a4..950193f45c8 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/README.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/README.mustache @@ -1,8 +1,8 @@ # C++ API client -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI spec](https://openapis.org) from a remote server, you can easily generate an API client. diff --git a/modules/openapi-generator/src/main/resources/csharp-dotnet2/README.mustache b/modules/openapi-generator/src/main/resources/csharp-dotnet2/README.mustache index 38a2937a476..041dec963b0 100644 --- a/modules/openapi-generator/src/main/resources/csharp-dotnet2/README.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-dotnet2/README.mustache @@ -1,8 +1,8 @@ # {{packageName}} - the C# library for the {{appName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache index 0521eb9369e..8ef566b7f35 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache @@ -1,8 +1,8 @@ # {{packageName}} - the C# library for the {{appName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: diff --git a/modules/openapi-generator/src/main/resources/csharp/README.mustache b/modules/openapi-generator/src/main/resources/csharp/README.mustache index fbf5001b1d2..474bfe829b4 100644 --- a/modules/openapi-generator/src/main/resources/csharp/README.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/README.mustache @@ -1,8 +1,8 @@ # {{packageName}} - the C# library for the {{appName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: diff --git a/modules/openapi-generator/src/main/resources/dart-dio/README.mustache b/modules/openapi-generator/src/main/resources/dart-dio/README.mustache index 1367a32a5da..b304aca4228 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/README.mustache @@ -1,7 +1,7 @@ # {{pubName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache index 4b1c1420e03..10a11d931e5 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache @@ -1,7 +1,7 @@ # {{pubName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project: diff --git a/modules/openapi-generator/src/main/resources/dart/README.mustache b/modules/openapi-generator/src/main/resources/dart/README.mustache index 02c6cd2116a..c2052443896 100644 --- a/modules/openapi-generator/src/main/resources/dart/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart/README.mustache @@ -1,7 +1,7 @@ # {{pubName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: diff --git a/modules/openapi-generator/src/main/resources/dart2/README.mustache b/modules/openapi-generator/src/main/resources/dart2/README.mustache index 76261fa0467..54e7a4efd5f 100644 --- a/modules/openapi-generator/src/main/resources/dart2/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/README.mustache @@ -1,7 +1,7 @@ # {{pubName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: diff --git a/modules/openapi-generator/src/main/resources/elm/README.mustache b/modules/openapi-generator/src/main/resources/elm/README.mustache index e7190da57b1..932f287c0fa 100644 --- a/modules/openapi-generator/src/main/resources/elm/README.mustache +++ b/modules/openapi-generator/src/main/resources/elm/README.mustache @@ -1,9 +1,9 @@ # Elm API client -{{#appDescription}} -{{{appDescription}}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} -{{/appDescription}} +{{/appDescriptionWithNewLines}} ## 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. diff --git a/modules/openapi-generator/src/main/resources/go-experimental/README.mustache b/modules/openapi-generator/src/main/resources/go-experimental/README.mustache index 777abc5d06e..ca2082dc8dc 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/README.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/README.mustache @@ -1,8 +1,8 @@ # Go API client for {{packageName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. diff --git a/modules/openapi-generator/src/main/resources/go-gin-server/README.mustache b/modules/openapi-generator/src/main/resources/go-gin-server/README.mustache index 669209a9a84..3ad44c6fa7a 100644 --- a/modules/openapi-generator/src/main/resources/go-gin-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/go-gin-server/README.mustache @@ -1,8 +1,8 @@ # Go API Server for {{packageName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Overview This server was generated by the [openapi-generator] diff --git a/modules/openapi-generator/src/main/resources/go-server/README.mustache b/modules/openapi-generator/src/main/resources/go-server/README.mustache index 14083f75847..5a59be67382 100644 --- a/modules/openapi-generator/src/main/resources/go-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/README.mustache @@ -1,8 +1,8 @@ # Go API Server for {{packageName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Overview This server was generated by the [openapi-generator] diff --git a/modules/openapi-generator/src/main/resources/go/README.mustache b/modules/openapi-generator/src/main/resources/go/README.mustache index b96f612f8a5..8f4afa293ef 100644 --- a/modules/openapi-generator/src/main/resources/go/README.mustache +++ b/modules/openapi-generator/src/main/resources/go/README.mustache @@ -1,8 +1,8 @@ # Go API client for {{packageName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. diff --git a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/README.mustache b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/README.mustache index 4746e0c95a3..2e556cc0666 100644 --- a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/README.mustache @@ -1,8 +1,8 @@ # GraphQL express API server -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Requirements diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/README.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/README.mustache index 2b8a89c7a18..0ff611e889f 100644 --- a/modules/openapi-generator/src/main/resources/graphql-schema/README.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-schema/README.mustache @@ -1,8 +1,8 @@ # Lua API client for {{packageName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. diff --git a/modules/openapi-generator/src/main/resources/lua/README.mustache b/modules/openapi-generator/src/main/resources/lua/README.mustache index 2b8a89c7a18..0ff611e889f 100644 --- a/modules/openapi-generator/src/main/resources/lua/README.mustache +++ b/modules/openapi-generator/src/main/resources/lua/README.mustache @@ -1,8 +1,8 @@ # Lua API client for {{packageName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. diff --git a/modules/openapi-generator/src/main/resources/nim-client/README.mustache b/modules/openapi-generator/src/main/resources/nim-client/README.mustache index f879aee9e0a..7f664c25e25 100644 --- a/modules/openapi-generator/src/main/resources/nim-client/README.mustache +++ b/modules/openapi-generator/src/main/resources/nim-client/README.mustache @@ -1,8 +1,8 @@ # Nim API client for {{{appName}}} (Package: {{{packageName}}}) -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Overview diff --git a/modules/openapi-generator/src/main/resources/objc/README.mustache b/modules/openapi-generator/src/main/resources/objc/README.mustache index e353062783e..a5af6dfd37a 100644 --- a/modules/openapi-generator/src/main/resources/objc/README.mustache +++ b/modules/openapi-generator/src/main/resources/objc/README.mustache @@ -1,8 +1,8 @@ # {{podName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} This ObjC package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: diff --git a/modules/openapi-generator/src/main/resources/ocaml/readme.mustache b/modules/openapi-generator/src/main/resources/ocaml/readme.mustache index 9cd39793a8a..906db4d647a 100644 --- a/modules/openapi-generator/src/main/resources/ocaml/readme.mustache +++ b/modules/openapi-generator/src/main/resources/ocaml/readme.mustache @@ -1,7 +1,7 @@ # {{{projectName}}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} This OCaml package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: diff --git a/modules/openapi-generator/src/main/resources/perl/README.mustache b/modules/openapi-generator/src/main/resources/perl/README.mustache index b088e34b852..93707bd1b6e 100644 --- a/modules/openapi-generator/src/main/resources/perl/README.mustache +++ b/modules/openapi-generator/src/main/resources/perl/README.mustache @@ -2,7 +2,7 @@ {{moduleName}}::Role - a Moose role for the {{appName}} -{{#appDescription}}{{{appDescription}}}{{/appDescription}} +{{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}} # VERSION diff --git a/modules/openapi-generator/src/main/resources/php-symfony/README.mustache b/modules/openapi-generator/src/main/resources/php-symfony/README.mustache index f107aa4b30c..af53b91e07a 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/README.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/README.mustache @@ -1,7 +1,7 @@ # {{bundleName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} This [Symfony](https://symfony.com/) bundle is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: diff --git a/modules/openapi-generator/src/main/resources/php/README.mustache b/modules/openapi-generator/src/main/resources/php/README.mustache index 5d6e8c93ef9..636a2a98519 100644 --- a/modules/openapi-generator/src/main/resources/php/README.mustache +++ b/modules/openapi-generator/src/main/resources/php/README.mustache @@ -1,8 +1,8 @@ # {{packageName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: diff --git a/modules/openapi-generator/src/main/resources/powershell/README.mustache b/modules/openapi-generator/src/main/resources/powershell/README.mustache index 0ff7e5d25f3..fae062b7d2b 100644 --- a/modules/openapi-generator/src/main/resources/powershell/README.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/README.mustache @@ -1,8 +1,8 @@ # {{packageName}} - the PowerShell module for the {{appName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} This PowerShell module is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/README.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/README.mustache index a516dff1de9..7f8bbe320eb 100644 --- a/modules/openapi-generator/src/main/resources/protobuf-schema/README.mustache +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/README.mustache @@ -1,8 +1,8 @@ # gPRC for {{packageName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Overview These files were generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/modules/openapi-generator/src/main/resources/python/README.mustache b/modules/openapi-generator/src/main/resources/python/README.mustache index 94d72af33dc..9d854a4f1b9 100644 --- a/modules/openapi-generator/src/main/resources/python/README.mustache +++ b/modules/openapi-generator/src/main/resources/python/README.mustache @@ -1,7 +1,7 @@ # {{{projectName}}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache index f26408cf661..72c7f3de3f0 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README.mustache @@ -1,7 +1,7 @@ # {{{projectName}}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: diff --git a/modules/openapi-generator/src/main/resources/r/README.mustache b/modules/openapi-generator/src/main/resources/r/README.mustache index c9dd12a935f..5ea73921859 100644 --- a/modules/openapi-generator/src/main/resources/r/README.mustache +++ b/modules/openapi-generator/src/main/resources/r/README.mustache @@ -1,8 +1,8 @@ # R API client for {{packageName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI spec](https://openapis.org) from a remote server, you can easily generate an API client. diff --git a/modules/openapi-generator/src/main/resources/rust-server/README.mustache b/modules/openapi-generator/src/main/resources/rust-server/README.mustache index 57146ddc4ca..9ab26d83024 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/README.mustache @@ -1,8 +1,8 @@ # Rust API for {{{packageName}}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Overview diff --git a/modules/openapi-generator/src/main/resources/rust/README.mustache b/modules/openapi-generator/src/main/resources/rust/README.mustache index 62aa006644d..89648191073 100644 --- a/modules/openapi-generator/src/main/resources/rust/README.mustache +++ b/modules/openapi-generator/src/main/resources/rust/README.mustache @@ -1,8 +1,8 @@ # Rust API client for {{{packageName}}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Overview diff --git a/modules/openapi-generator/src/main/resources/scala-akka-client/README.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/README.mustache index c684af83ab2..0a61209568d 100644 --- a/modules/openapi-generator/src/main/resources/scala-akka-client/README.mustache +++ b/modules/openapi-generator/src/main/resources/scala-akka-client/README.mustache @@ -6,7 +6,7 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} -{{#appDescription}}{{{appDescription}}}{{/appDescription}} +{{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) @@ -104,4 +104,4 @@ Class | Method | HTTP request | Description ## Author {{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} -{{/hasMore}}{{/apis}}{{/apiInfo}} \ No newline at end of file +{{/hasMore}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/scala-httpclient/README.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/README.mustache index 045b77f4e86..57673b768db 100644 --- a/modules/openapi-generator/src/main/resources/scala-httpclient/README.mustache +++ b/modules/openapi-generator/src/main/resources/scala-httpclient/README.mustache @@ -2,10 +2,10 @@ {{appName}} -{{#appDescription}} -{{{appDescription}}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} -{{/appDescription}} +{{/appDescriptionWithNewLines}} # VERSION Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -128,4 +128,4 @@ you just built. ## Author {{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} -{{/hasMore}}{{/apis}}{{/apiInfo}} \ No newline at end of file +{{/hasMore}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/swift4/README.mustache b/modules/openapi-generator/src/main/resources/swift4/README.mustache index 8fe60510aa8..da90d5e1b44 100644 --- a/modules/openapi-generator/src/main/resources/swift4/README.mustache +++ b/modules/openapi-generator/src/main/resources/swift4/README.mustache @@ -1,8 +1,8 @@ # Swift4 API client for {{{projectName}}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. diff --git a/modules/openapi-generator/src/main/resources/swift5/README.mustache b/modules/openapi-generator/src/main/resources/swift5/README.mustache index c9a27d38b65..6ee7cf37afe 100644 --- a/modules/openapi-generator/src/main/resources/swift5/README.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/README.mustache @@ -1,8 +1,8 @@ # Swift5 API client for {{{projectName}}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} +{{#appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} +{{/appDescriptionWithNewLines}} ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. From 76e8e81668c0b762cfccf431d9902cfe9bd466e2 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Wed, 29 Jan 2020 08:30:20 -0500 Subject: [PATCH 50/85] [core] Add back functionality to debug openapi spec, accidentally removed in 4.1.2 (#5147) --- .../main/java/org/openapitools/codegen/DefaultGenerator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 71416272fa5..2debd1ba7fa 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 @@ -186,12 +186,12 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { } if (GlobalSettings.getProperty("debugOpenAPI") != null) { - SerializerUtils.toJsonString(openAPI); + System.out.println(SerializerUtils.toJsonString(openAPI)); } else if (GlobalSettings.getProperty("debugSwagger") != null) { // This exists for backward compatibility // We fall to this block only if debugOpenAPI is null. No need to dump this twice. LOGGER.info("Please use system property 'debugOpenAPI' instead of 'debugSwagger'."); - SerializerUtils.toJsonString(openAPI); + System.out.println(SerializerUtils.toJsonString(openAPI)); } config.processOpts(); From 3922607858cee81dc2d24110c7a215b4e748442d Mon Sep 17 00:00:00 2001 From: Tatsuro Shibamura Date: Thu, 30 Jan 2020 01:52:48 +0900 Subject: [PATCH 51/85] [csharp-netcore] Fixed compiler null-check warning (#5119) * Fixed compiler null-check warning * Rename vendor extensions as `x-csharp-value-type` --- .../languages/CSharpNetCoreClientCodegen.java | 12 ++- .../resources/csharp-netcore/api.mustache | 70 +++++++++++- .../csharp-netcore/modelGeneric.mustache | 37 ++----- .../src/Org.OpenAPITools/Api/FakeApi.cs | 102 ++++-------------- .../src/Org.OpenAPITools/Api/PetApi.cs | 70 ++---------- .../src/Org.OpenAPITools/Api/StoreApi.cs | 14 +-- .../src/Org.OpenAPITools/Model/Animal.cs | 19 +--- .../src/Org.OpenAPITools/Model/Category.cs | 10 +- .../src/Org.OpenAPITools/Model/FormatTest.cs | 42 +------- .../src/Org.OpenAPITools/Model/Name.cs | 11 +- .../src/Org.OpenAPITools/Model/Order.cs | 10 +- .../src/Org.OpenAPITools/Model/Pet.cs | 20 +--- .../Model/TypeHolderDefault.cs | 53 +-------- .../Model/TypeHolderExample.cs | 64 ++--------- .../src/Org.OpenAPITools/Api/FakeApi.cs | 102 ++++-------------- .../src/Org.OpenAPITools/Api/PetApi.cs | 70 ++---------- .../src/Org.OpenAPITools/Api/StoreApi.cs | 14 +-- .../src/Org.OpenAPITools/Model/Animal.cs | 19 +--- .../src/Org.OpenAPITools/Model/Category.cs | 10 +- .../src/Org.OpenAPITools/Model/FormatTest.cs | 42 +------- .../src/Org.OpenAPITools/Model/Name.cs | 11 +- .../src/Org.OpenAPITools/Model/Order.cs | 10 +- .../src/Org.OpenAPITools/Model/Pet.cs | 20 +--- .../Model/TypeHolderDefault.cs | 53 +-------- .../Model/TypeHolderExample.cs | 64 ++--------- 25 files changed, 191 insertions(+), 758 deletions(-) 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 95ced94f2f8..f21f156e200 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 @@ -423,6 +423,10 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { postProcessEmitDefaultValue(property.vendorExtensions); super.postProcessModelProperty(model, property); + + if (!property.isContainer && (nullableType.contains(property.dataType) || property.isEnum)) { + property.vendorExtensions.put("x-csharp-value-type", true); + } } @Override @@ -458,8 +462,12 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { postProcessEmitDefaultValue(parameter.vendorExtensions); super.postProcessParameter(parameter); - if (!parameter.required && nullableType.contains(parameter.dataType)) { //optional - parameter.dataType = parameter.dataType + "?"; + if (nullableType.contains(parameter.dataType)) { + if (!parameter.required) { //optional + parameter.dataType = parameter.dataType + "?"; + } else { + parameter.vendorExtensions.put("x-csharp-value-type", true); + } } } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache index 7aa39cc22e6..e8a32d382a8 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache @@ -225,14 +225,14 @@ namespace {{packageName}}.{{apiPackage}} public {{packageName}}.Client.ApiResponse<{{#returnType}} {{{returnType}}} {{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { {{#allParams}} - {{^isNullable}} {{#required}} + {{^vendorExtensions.x-csharp-value-type}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + {{/vendorExtensions.x-csharp-value-type}} {{/required}} - {{/isNullable}} {{/allParams}} {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); @@ -256,10 +256,16 @@ namespace {{packageName}}.{{apiPackage}} if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); {{#pathParams}} + {{^vendorExtensions.x-csharp-value-type}} if ({{paramName}} != null) localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/vendorExtensions.x-csharp-value-type}} {{/pathParams}} {{#queryParams}} + {{^vendorExtensions.x-csharp-value-type}} if ({{paramName}} != null) { foreach (var _kvp in {{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})) @@ -270,12 +276,28 @@ namespace {{packageName}}.{{apiPackage}} } } } + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + foreach (var _kvp in {{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})) + { + foreach (var _kvpValue in _kvp.Value) + { + localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); + } + } + {{/vendorExtensions.x-csharp-value-type}} {{/queryParams}} {{#headerParams}} + {{^vendorExtensions.x-csharp-value-type}} if ({{paramName}} != null) localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/vendorExtensions.x-csharp-value-type}} {{/headerParams}} {{#formParams}} + {{^vendorExtensions.x-csharp-value-type}} if ({{paramName}} != null) { {{#isFile}} @@ -285,6 +307,15 @@ namespace {{packageName}}.{{apiPackage}} localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter {{/isFile}} } + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/vendorExtensions.x-csharp-value-type}} {{/formParams}} {{#bodyParam}} localVarRequestOptions.Data = {{paramName}}; @@ -363,14 +394,14 @@ namespace {{packageName}}.{{apiPackage}} public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { {{#allParams}} - {{^isNullable}} {{#required}} + {{^vendorExtensions.x-csharp-value-type}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) throw new {{packageName}}.Client.ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); + {{/vendorExtensions.x-csharp-value-type}} {{/required}} - {{/isNullable}} {{/allParams}} {{packageName}}.Client.RequestOptions localVarRequestOptions = new {{packageName}}.Client.RequestOptions(); @@ -395,10 +426,16 @@ namespace {{packageName}}.{{apiPackage}} localVarRequestOptions.HeaderParameters.Add("Accept", _accept); {{#pathParams}} + {{^vendorExtensions.x-csharp-value-type}} if ({{paramName}} != null) localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + localVarRequestOptions.PathParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // path parameter + {{/vendorExtensions.x-csharp-value-type}} {{/pathParams}} {{#queryParams}} + {{^vendorExtensions.x-csharp-value-type}} if ({{paramName}} != null) { foreach (var _kvp in {{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})) @@ -409,12 +446,28 @@ namespace {{packageName}}.{{apiPackage}} } } } + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + foreach (var _kvp in {{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})) + { + foreach (var _kvpValue in _kvp.Value) + { + localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); + } + } + {{/vendorExtensions.x-csharp-value-type}} {{/queryParams}} {{#headerParams}} + {{^vendorExtensions.x-csharp-value-type}} if ({{paramName}} != null) localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + {{/vendorExtensions.x-csharp-value-type}} {{/headerParams}} {{#formParams}} + {{^vendorExtensions.x-csharp-value-type}} if ({{paramName}} != null) { {{#isFile}} @@ -424,6 +477,15 @@ namespace {{packageName}}.{{apiPackage}} localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter {{/isFile}} } + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + {{#isFile}} + localVarRequestOptions.FileParameters.Add("{{baseName}}", {{paramName}}); + {{/isFile}} + {{^isFile}} + localVarRequestOptions.FormParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // form parameter + {{/isFile}} + {{/vendorExtensions.x-csharp-value-type}} {{/formParams}} {{#bodyParam}} localVarRequestOptions.Data = {{paramName}}; diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache index 78738eeb1f3..690873e1654 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache @@ -60,28 +60,15 @@ {{#vars}} {{^isInherited}} {{^isReadOnly}} - {{^isNullable}} {{#required}} - {{^isEnum}} + {{^vendorExtensions.x-csharp-value-type}} // to ensure "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" is required (not null) - if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) - { - throw new InvalidDataException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null"); - } - else - { - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; - } - - {{/isEnum}} - {{#isEnum}} + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} ?? throw new ArgumentNullException("{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} is a required property for {{classname}} and cannot be null");; + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; - {{/isEnum}} + {{/vendorExtensions.x-csharp-value-type}} {{/required}} - {{/isNullable}} - {{#isNullable}} - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; - {{/isNullable}} {{/isReadOnly}} {{/isInherited}} {{/vars}} @@ -90,15 +77,13 @@ {{^isReadOnly}} {{^required}} {{#defaultValue}} + {{^vendorExtensions.x-csharp-value-type}} // use default value if no "{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}" provided - if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) - { - this.{{name}} = {{{defaultValue}}}; - } - else - { - this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; - } + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} ?? {{{defaultValue}}}; + {{/vendorExtensions.x-csharp-value-type}} + {{#vendorExtensions.x-csharp-value-type}} + this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; + {{/vendorExtensions.x-csharp-value-type}} {{/defaultValue}} {{^defaultValue}} this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index a3052b97a29..6c0797b7ffe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1823,14 +1823,6 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Object(void) public Org.OpenAPITools.Client.ApiResponse TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) { - // verify the required parameter 'number' is set - if (number == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters"); - - // verify the required parameter '_double' is set - if (_double == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters"); - // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); @@ -1867,18 +1859,12 @@ namespace Org.OpenAPITools.Api { localVarRequestOptions.FormParameters.Add("int64", Org.OpenAPITools.Client.ClientUtils.ParameterToString(int64)); // form parameter } - if (number != null) - { - localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter - } + localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter if (_float != null) { localVarRequestOptions.FormParameters.Add("float", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_float)); // form parameter } - if (_double != null) - { - localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter - } + localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter if (_string != null) { localVarRequestOptions.FormParameters.Add("string", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_string)); // form parameter @@ -1977,14 +1963,6 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) { - // verify the required parameter 'number' is set - if (number == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters"); - - // verify the required parameter '_double' is set - if (_double == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters"); - // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); @@ -2022,18 +2000,12 @@ namespace Org.OpenAPITools.Api { localVarRequestOptions.FormParameters.Add("int64", Org.OpenAPITools.Client.ClientUtils.ParameterToString(int64)); // form parameter } - if (number != null) - { - localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter - } + localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter if (_float != null) { localVarRequestOptions.FormParameters.Add("float", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_float)); // form parameter } - if (_double != null) - { - localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter - } + localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter if (_string != null) { localVarRequestOptions.FormParameters.Add("string", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_string)); // form parameter @@ -2349,18 +2321,6 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Object(void) public Org.OpenAPITools.Client.ApiResponse TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) { - // verify the required parameter 'requiredStringGroup' is set - if (requiredStringGroup == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredStringGroup' when calling FakeApi->TestGroupParameters"); - - // verify the required parameter 'requiredBooleanGroup' is set - if (requiredBooleanGroup == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredBooleanGroup' when calling FakeApi->TestGroupParameters"); - - // verify the required parameter 'requiredInt64Group' is set - if (requiredInt64Group == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredInt64Group' when calling FakeApi->TestGroupParameters"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); String[] _contentTypes = new String[] { @@ -2376,24 +2336,18 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - if (requiredStringGroup != null) + foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)) + foreach (var _kvpValue in _kvp.Value) { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } + localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); } } - if (requiredInt64Group != null) + foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)) + foreach (var _kvpValue in _kvp.Value) { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } + localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); } } if (stringGroup != null) @@ -2416,8 +2370,7 @@ namespace Org.OpenAPITools.Api } } } - if (requiredBooleanGroup != null) - localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter + localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter if (booleanGroup != null) localVarRequestOptions.HeaderParameters.Add("boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(booleanGroup)); // header parameter @@ -2464,18 +2417,6 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) { - // verify the required parameter 'requiredStringGroup' is set - if (requiredStringGroup == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredStringGroup' when calling FakeApi->TestGroupParameters"); - - // verify the required parameter 'requiredBooleanGroup' is set - if (requiredBooleanGroup == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredBooleanGroup' when calling FakeApi->TestGroupParameters"); - - // verify the required parameter 'requiredInt64Group' is set - if (requiredInt64Group == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredInt64Group' when calling FakeApi->TestGroupParameters"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2492,24 +2433,18 @@ namespace Org.OpenAPITools.Api foreach (var _accept in _accepts) localVarRequestOptions.HeaderParameters.Add("Accept", _accept); - if (requiredStringGroup != null) + foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)) + foreach (var _kvpValue in _kvp.Value) { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } + localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); } } - if (requiredInt64Group != null) + foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)) + foreach (var _kvpValue in _kvp.Value) { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } + localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); } } if (stringGroup != null) @@ -2532,8 +2467,7 @@ namespace Org.OpenAPITools.Api } } } - if (requiredBooleanGroup != null) - localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter + localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter if (booleanGroup != null) localVarRequestOptions.HeaderParameters.Add("boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(booleanGroup)); // header parameter diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs index 5cc53451ed7..5c4a624d26a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs @@ -708,10 +708,6 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Object(void) public Org.OpenAPITools.Client.ApiResponse DeletePetWithHttpInfo (long petId, string apiKey = default(string)) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); String[] _contentTypes = new String[] { @@ -727,8 +723,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) localVarRequestOptions.HeaderParameters.Add("api_key", Org.OpenAPITools.Client.ClientUtils.ParameterToString(apiKey)); // header parameter @@ -773,10 +768,6 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -793,8 +784,7 @@ namespace Org.OpenAPITools.Api foreach (var _accept in _accepts) localVarRequestOptions.HeaderParameters.Add("Accept", _accept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) localVarRequestOptions.HeaderParameters.Add("api_key", Org.OpenAPITools.Client.ClientUtils.ParameterToString(apiKey)); // header parameter @@ -1128,10 +1118,6 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Pet public Org.OpenAPITools.Client.ApiResponse< Pet > GetPetByIdWithHttpInfo (long petId) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); String[] _contentTypes = new String[] { @@ -1149,8 +1135,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter // authentication (api_key) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) @@ -1191,10 +1176,6 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse (Pet) public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1213,8 +1194,7 @@ namespace Org.OpenAPITools.Api foreach (var _accept in _accepts) localVarRequestOptions.HeaderParameters.Add("Accept", _accept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter // authentication (api_key) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) @@ -1383,10 +1363,6 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Object(void) public Org.OpenAPITools.Client.ApiResponse UpdatePetWithFormWithHttpInfo (long petId, string name = default(string), string status = default(string)) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); String[] _contentTypes = new String[] { @@ -1403,8 +1379,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) { localVarRequestOptions.FormParameters.Add("name", Org.OpenAPITools.Client.ClientUtils.ParameterToString(name)); // form parameter @@ -1457,10 +1432,6 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1478,8 +1449,7 @@ namespace Org.OpenAPITools.Api foreach (var _accept in _accepts) localVarRequestOptions.HeaderParameters.Add("Accept", _accept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) { localVarRequestOptions.FormParameters.Add("name", Org.OpenAPITools.Client.ClientUtils.ParameterToString(name)); // form parameter @@ -1533,10 +1503,6 @@ namespace Org.OpenAPITools.Api /// ApiResponse of ApiResponse public Org.OpenAPITools.Client.ApiResponse< ApiResponse > UploadFileWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); String[] _contentTypes = new String[] { @@ -1554,8 +1520,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) { localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter @@ -1609,10 +1574,6 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse (ApiResponse) public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1631,8 +1592,7 @@ namespace Org.OpenAPITools.Api foreach (var _accept in _accepts) localVarRequestOptions.HeaderParameters.Add("Accept", _accept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) { localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter @@ -1686,10 +1646,6 @@ namespace Org.OpenAPITools.Api /// ApiResponse of ApiResponse public Org.OpenAPITools.Client.ApiResponse< ApiResponse > UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFileWithRequiredFile"); - // verify the required parameter 'requiredFile' is set if (requiredFile == null) throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); @@ -1711,8 +1667,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) { localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter @@ -1766,10 +1721,6 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse (ApiResponse) public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFileWithRequiredFile"); - // verify the required parameter 'requiredFile' is set if (requiredFile == null) throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); @@ -1792,8 +1743,7 @@ namespace Org.OpenAPITools.Api foreach (var _accept in _accepts) localVarRequestOptions.HeaderParameters.Add("Accept", _accept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) { localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs index 72d56c685af..bba65088117 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs @@ -560,10 +560,6 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Order public Org.OpenAPITools.Client.ApiResponse< Order > GetOrderByIdWithHttpInfo (long orderId) { - // verify the required parameter 'orderId' is set - if (orderId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); String[] _contentTypes = new String[] { @@ -581,8 +577,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - if (orderId != null) - localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter + localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -618,10 +613,6 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse (Order) public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId) { - // verify the required parameter 'orderId' is set - if (orderId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -640,8 +631,7 @@ namespace Org.OpenAPITools.Api foreach (var _accept in _accepts) localVarRequestOptions.HeaderParameters.Add("Accept", _accept); - if (orderId != null) - localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter + localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs index 43b638c4a8d..6327320a4d7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs @@ -53,24 +53,9 @@ namespace Org.OpenAPITools.Model public Animal(string className = default(string), string color = "red") { // to ensure "className" is required (not null) - if (className == null) - { - throw new InvalidDataException("className is a required property for Animal and cannot be null"); - } - else - { - this.ClassName = className; - } - + this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Animal and cannot be null");; // use default value if no "color" provided - if (color == null) - { - this.Color = "red"; - } - else - { - this.Color = color; - } + this.Color = color ?? "red"; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs index 2d2d85c07bb..474391b16ed 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs @@ -45,15 +45,7 @@ namespace Org.OpenAPITools.Model public Category(long id = default(long), string name = "default-name") { // to ensure "name" is required (not null) - if (name == null) - { - throw new InvalidDataException("name is a required property for Category and cannot be null"); - } - else - { - this.Name = name; - } - + this.Name = name ?? throw new ArgumentNullException("name is a required property for Category and cannot be null");; this.Id = id; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs index b68958ed690..152076d6537 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs @@ -56,46 +56,12 @@ namespace Org.OpenAPITools.Model /// bigDecimal. public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), decimal bigDecimal = default(decimal)) { - // to ensure "number" is required (not null) - if (number == null) - { - throw new InvalidDataException("number is a required property for FormatTest and cannot be null"); - } - else - { - this.Number = number; - } - + this.Number = number; // to ensure "_byte" is required (not null) - if (_byte == null) - { - throw new InvalidDataException("_byte is a required property for FormatTest and cannot be null"); - } - else - { - this.Byte = _byte; - } - - // to ensure "date" is required (not null) - if (date == null) - { - throw new InvalidDataException("date is a required property for FormatTest and cannot be null"); - } - else - { - this.Date = date; - } - + this.Byte = _byte ?? throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null");; + this.Date = date; // to ensure "password" is required (not null) - if (password == null) - { - throw new InvalidDataException("password is a required property for FormatTest and cannot be null"); - } - else - { - this.Password = password; - } - + this.Password = password ?? throw new ArgumentNullException("password is a required property for FormatTest and cannot be null");; this.Integer = integer; this.Int32 = int32; this.Int64 = int64; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs index 60adfe8af77..ca102b37b1e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs @@ -44,16 +44,7 @@ namespace Org.OpenAPITools.Model /// property. public Name(int name = default(int), string property = default(string)) { - // to ensure "name" is required (not null) - if (name == null) - { - throw new InvalidDataException("name is a required property for Name and cannot be null"); - } - else - { - this._Name = name; - } - + this._Name = name; this.Property = property; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs index 0c4a6a5b60f..7a10e4a0f98 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs @@ -81,15 +81,7 @@ namespace Org.OpenAPITools.Model this.Quantity = quantity; this.ShipDate = shipDate; this.Status = status; - // use default value if no "complete" provided - if (complete == null) - { - this.Complete = false; - } - else - { - this.Complete = complete; - } + this.Complete = complete; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs index b7be3ee84f9..4341ff4452a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs @@ -82,25 +82,9 @@ namespace Org.OpenAPITools.Model public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) { // to ensure "name" is required (not null) - if (name == null) - { - throw new InvalidDataException("name is a required property for Pet and cannot be null"); - } - else - { - this.Name = name; - } - + this.Name = name ?? throw new ArgumentNullException("name is a required property for Pet and cannot be null");; // to ensure "photoUrls" is required (not null) - if (photoUrls == null) - { - throw new InvalidDataException("photoUrls is a required property for Pet and cannot be null"); - } - else - { - this.PhotoUrls = photoUrls; - } - + this.PhotoUrls = photoUrls ?? throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null");; this.Id = id; this.Category = category; this.Tags = tags; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderDefault.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderDefault.cs index 62151f1edfe..c3933da46a6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderDefault.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderDefault.cs @@ -48,55 +48,12 @@ namespace Org.OpenAPITools.Model public TypeHolderDefault(string stringItem = "what", decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = true, List arrayItem = default(List)) { // to ensure "stringItem" is required (not null) - if (stringItem == null) - { - throw new InvalidDataException("stringItem is a required property for TypeHolderDefault and cannot be null"); - } - else - { - this.StringItem = stringItem; - } - - // to ensure "numberItem" is required (not null) - if (numberItem == null) - { - throw new InvalidDataException("numberItem is a required property for TypeHolderDefault and cannot be null"); - } - else - { - this.NumberItem = numberItem; - } - - // to ensure "integerItem" is required (not null) - if (integerItem == null) - { - throw new InvalidDataException("integerItem is a required property for TypeHolderDefault and cannot be null"); - } - else - { - this.IntegerItem = integerItem; - } - - // to ensure "boolItem" is required (not null) - if (boolItem == null) - { - throw new InvalidDataException("boolItem is a required property for TypeHolderDefault and cannot be null"); - } - else - { - this.BoolItem = boolItem; - } - + this.StringItem = stringItem ?? throw new ArgumentNullException("stringItem is a required property for TypeHolderDefault and cannot be null");; + this.NumberItem = numberItem; + this.IntegerItem = integerItem; + this.BoolItem = boolItem; // to ensure "arrayItem" is required (not null) - if (arrayItem == null) - { - throw new InvalidDataException("arrayItem is a required property for TypeHolderDefault and cannot be null"); - } - else - { - this.ArrayItem = arrayItem; - } - + this.ArrayItem = arrayItem ?? throw new ArgumentNullException("arrayItem is a required property for TypeHolderDefault and cannot be null");; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderExample.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderExample.cs index 42043170e6a..ee949e45bc8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderExample.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderExample.cs @@ -49,65 +49,13 @@ namespace Org.OpenAPITools.Model public TypeHolderExample(string stringItem = default(string), decimal numberItem = default(decimal), float floatItem = default(float), int integerItem = default(int), bool boolItem = default(bool), List arrayItem = default(List)) { // to ensure "stringItem" is required (not null) - if (stringItem == null) - { - throw new InvalidDataException("stringItem is a required property for TypeHolderExample and cannot be null"); - } - else - { - this.StringItem = stringItem; - } - - // to ensure "numberItem" is required (not null) - if (numberItem == null) - { - throw new InvalidDataException("numberItem is a required property for TypeHolderExample and cannot be null"); - } - else - { - this.NumberItem = numberItem; - } - - // to ensure "floatItem" is required (not null) - if (floatItem == null) - { - throw new InvalidDataException("floatItem is a required property for TypeHolderExample and cannot be null"); - } - else - { - this.FloatItem = floatItem; - } - - // to ensure "integerItem" is required (not null) - if (integerItem == null) - { - throw new InvalidDataException("integerItem is a required property for TypeHolderExample and cannot be null"); - } - else - { - this.IntegerItem = integerItem; - } - - // to ensure "boolItem" is required (not null) - if (boolItem == null) - { - throw new InvalidDataException("boolItem is a required property for TypeHolderExample and cannot be null"); - } - else - { - this.BoolItem = boolItem; - } - + this.StringItem = stringItem ?? throw new ArgumentNullException("stringItem is a required property for TypeHolderExample and cannot be null");; + this.NumberItem = numberItem; + this.FloatItem = floatItem; + this.IntegerItem = integerItem; + this.BoolItem = boolItem; // to ensure "arrayItem" is required (not null) - if (arrayItem == null) - { - throw new InvalidDataException("arrayItem is a required property for TypeHolderExample and cannot be null"); - } - else - { - this.ArrayItem = arrayItem; - } - + this.ArrayItem = arrayItem ?? throw new ArgumentNullException("arrayItem is a required property for TypeHolderExample and cannot be null");; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs index a3052b97a29..6c0797b7ffe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1823,14 +1823,6 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Object(void) public Org.OpenAPITools.Client.ApiResponse TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) { - // verify the required parameter 'number' is set - if (number == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters"); - - // verify the required parameter '_double' is set - if (_double == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters"); - // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); @@ -1867,18 +1859,12 @@ namespace Org.OpenAPITools.Api { localVarRequestOptions.FormParameters.Add("int64", Org.OpenAPITools.Client.ClientUtils.ParameterToString(int64)); // form parameter } - if (number != null) - { - localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter - } + localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter if (_float != null) { localVarRequestOptions.FormParameters.Add("float", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_float)); // form parameter } - if (_double != null) - { - localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter - } + localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter if (_string != null) { localVarRequestOptions.FormParameters.Add("string", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_string)); // form parameter @@ -1977,14 +1963,6 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string)) { - // verify the required parameter 'number' is set - if (number == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters"); - - // verify the required parameter '_double' is set - if (_double == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters"); - // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters"); @@ -2022,18 +2000,12 @@ namespace Org.OpenAPITools.Api { localVarRequestOptions.FormParameters.Add("int64", Org.OpenAPITools.Client.ClientUtils.ParameterToString(int64)); // form parameter } - if (number != null) - { - localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter - } + localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter if (_float != null) { localVarRequestOptions.FormParameters.Add("float", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_float)); // form parameter } - if (_double != null) - { - localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter - } + localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter if (_string != null) { localVarRequestOptions.FormParameters.Add("string", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_string)); // form parameter @@ -2349,18 +2321,6 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Object(void) public Org.OpenAPITools.Client.ApiResponse TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) { - // verify the required parameter 'requiredStringGroup' is set - if (requiredStringGroup == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredStringGroup' when calling FakeApi->TestGroupParameters"); - - // verify the required parameter 'requiredBooleanGroup' is set - if (requiredBooleanGroup == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredBooleanGroup' when calling FakeApi->TestGroupParameters"); - - // verify the required parameter 'requiredInt64Group' is set - if (requiredInt64Group == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredInt64Group' when calling FakeApi->TestGroupParameters"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); String[] _contentTypes = new String[] { @@ -2376,24 +2336,18 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - if (requiredStringGroup != null) + foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)) + foreach (var _kvpValue in _kvp.Value) { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } + localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); } } - if (requiredInt64Group != null) + foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)) + foreach (var _kvpValue in _kvp.Value) { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } + localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); } } if (stringGroup != null) @@ -2416,8 +2370,7 @@ namespace Org.OpenAPITools.Api } } } - if (requiredBooleanGroup != null) - localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter + localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter if (booleanGroup != null) localVarRequestOptions.HeaderParameters.Add("boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(booleanGroup)); // header parameter @@ -2464,18 +2417,6 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?)) { - // verify the required parameter 'requiredStringGroup' is set - if (requiredStringGroup == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredStringGroup' when calling FakeApi->TestGroupParameters"); - - // verify the required parameter 'requiredBooleanGroup' is set - if (requiredBooleanGroup == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredBooleanGroup' when calling FakeApi->TestGroupParameters"); - - // verify the required parameter 'requiredInt64Group' is set - if (requiredInt64Group == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredInt64Group' when calling FakeApi->TestGroupParameters"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2492,24 +2433,18 @@ namespace Org.OpenAPITools.Api foreach (var _accept in _accepts) localVarRequestOptions.HeaderParameters.Add("Accept", _accept); - if (requiredStringGroup != null) + foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)) + foreach (var _kvpValue in _kvp.Value) { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } + localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); } } - if (requiredInt64Group != null) + foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)) + foreach (var _kvpValue in _kvp.Value) { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } + localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); } } if (stringGroup != null) @@ -2532,8 +2467,7 @@ namespace Org.OpenAPITools.Api } } } - if (requiredBooleanGroup != null) - localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter + localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter if (booleanGroup != null) localVarRequestOptions.HeaderParameters.Add("boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(booleanGroup)); // header parameter diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs index 5cc53451ed7..5c4a624d26a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs @@ -708,10 +708,6 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Object(void) public Org.OpenAPITools.Client.ApiResponse DeletePetWithHttpInfo (long petId, string apiKey = default(string)) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); String[] _contentTypes = new String[] { @@ -727,8 +723,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) localVarRequestOptions.HeaderParameters.Add("api_key", Org.OpenAPITools.Client.ClientUtils.ParameterToString(apiKey)); // header parameter @@ -773,10 +768,6 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -793,8 +784,7 @@ namespace Org.OpenAPITools.Api foreach (var _accept in _accepts) localVarRequestOptions.HeaderParameters.Add("Accept", _accept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (apiKey != null) localVarRequestOptions.HeaderParameters.Add("api_key", Org.OpenAPITools.Client.ClientUtils.ParameterToString(apiKey)); // header parameter @@ -1128,10 +1118,6 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Pet public Org.OpenAPITools.Client.ApiResponse< Pet > GetPetByIdWithHttpInfo (long petId) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); String[] _contentTypes = new String[] { @@ -1149,8 +1135,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter // authentication (api_key) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) @@ -1191,10 +1176,6 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse (Pet) public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1213,8 +1194,7 @@ namespace Org.OpenAPITools.Api foreach (var _accept in _accepts) localVarRequestOptions.HeaderParameters.Add("Accept", _accept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter // authentication (api_key) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key"))) @@ -1383,10 +1363,6 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Object(void) public Org.OpenAPITools.Client.ApiResponse UpdatePetWithFormWithHttpInfo (long petId, string name = default(string), string status = default(string)) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); String[] _contentTypes = new String[] { @@ -1403,8 +1379,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) { localVarRequestOptions.FormParameters.Add("name", Org.OpenAPITools.Client.ClientUtils.ParameterToString(name)); // form parameter @@ -1457,10 +1432,6 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1478,8 +1449,7 @@ namespace Org.OpenAPITools.Api foreach (var _accept in _accepts) localVarRequestOptions.HeaderParameters.Add("Accept", _accept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (name != null) { localVarRequestOptions.FormParameters.Add("name", Org.OpenAPITools.Client.ClientUtils.ParameterToString(name)); // form parameter @@ -1533,10 +1503,6 @@ namespace Org.OpenAPITools.Api /// ApiResponse of ApiResponse public Org.OpenAPITools.Client.ApiResponse< ApiResponse > UploadFileWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); String[] _contentTypes = new String[] { @@ -1554,8 +1520,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) { localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter @@ -1609,10 +1574,6 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse (ApiResponse) public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1631,8 +1592,7 @@ namespace Org.OpenAPITools.Api foreach (var _accept in _accepts) localVarRequestOptions.HeaderParameters.Add("Accept", _accept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) { localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter @@ -1686,10 +1646,6 @@ namespace Org.OpenAPITools.Api /// ApiResponse of ApiResponse public Org.OpenAPITools.Client.ApiResponse< ApiResponse > UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFileWithRequiredFile"); - // verify the required parameter 'requiredFile' is set if (requiredFile == null) throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); @@ -1711,8 +1667,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) { localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter @@ -1766,10 +1721,6 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse (ApiResponse) public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { - // verify the required parameter 'petId' is set - if (petId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFileWithRequiredFile"); - // verify the required parameter 'requiredFile' is set if (requiredFile == null) throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); @@ -1792,8 +1743,7 @@ namespace Org.OpenAPITools.Api foreach (var _accept in _accepts) localVarRequestOptions.HeaderParameters.Add("Accept", _accept); - if (petId != null) - localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter + localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter if (additionalMetadata != null) { localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs index 72d56c685af..bba65088117 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/StoreApi.cs @@ -560,10 +560,6 @@ namespace Org.OpenAPITools.Api /// ApiResponse of Order public Org.OpenAPITools.Client.ApiResponse< Order > GetOrderByIdWithHttpInfo (long orderId) { - // verify the required parameter 'orderId' is set - if (orderId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); String[] _contentTypes = new String[] { @@ -581,8 +577,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - if (orderId != null) - localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter + localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request @@ -618,10 +613,6 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse (Order) public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId) { - // verify the required parameter 'orderId' is set - if (orderId == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); - Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -640,8 +631,7 @@ namespace Org.OpenAPITools.Api foreach (var _accept in _accepts) localVarRequestOptions.HeaderParameters.Add("Accept", _accept); - if (orderId != null) - localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter + localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter // make the HTTP request diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs index 43b638c4a8d..6327320a4d7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Animal.cs @@ -53,24 +53,9 @@ namespace Org.OpenAPITools.Model public Animal(string className = default(string), string color = "red") { // to ensure "className" is required (not null) - if (className == null) - { - throw new InvalidDataException("className is a required property for Animal and cannot be null"); - } - else - { - this.ClassName = className; - } - + this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Animal and cannot be null");; // use default value if no "color" provided - if (color == null) - { - this.Color = "red"; - } - else - { - this.Color = color; - } + this.Color = color ?? "red"; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Category.cs index 2d2d85c07bb..474391b16ed 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Category.cs @@ -45,15 +45,7 @@ namespace Org.OpenAPITools.Model public Category(long id = default(long), string name = "default-name") { // to ensure "name" is required (not null) - if (name == null) - { - throw new InvalidDataException("name is a required property for Category and cannot be null"); - } - else - { - this.Name = name; - } - + this.Name = name ?? throw new ArgumentNullException("name is a required property for Category and cannot be null");; this.Id = id; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs index b68958ed690..152076d6537 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -56,46 +56,12 @@ namespace Org.OpenAPITools.Model /// bigDecimal. public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), decimal bigDecimal = default(decimal)) { - // to ensure "number" is required (not null) - if (number == null) - { - throw new InvalidDataException("number is a required property for FormatTest and cannot be null"); - } - else - { - this.Number = number; - } - + this.Number = number; // to ensure "_byte" is required (not null) - if (_byte == null) - { - throw new InvalidDataException("_byte is a required property for FormatTest and cannot be null"); - } - else - { - this.Byte = _byte; - } - - // to ensure "date" is required (not null) - if (date == null) - { - throw new InvalidDataException("date is a required property for FormatTest and cannot be null"); - } - else - { - this.Date = date; - } - + this.Byte = _byte ?? throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null");; + this.Date = date; // to ensure "password" is required (not null) - if (password == null) - { - throw new InvalidDataException("password is a required property for FormatTest and cannot be null"); - } - else - { - this.Password = password; - } - + this.Password = password ?? throw new ArgumentNullException("password is a required property for FormatTest and cannot be null");; this.Integer = integer; this.Int32 = int32; this.Int64 = int64; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Name.cs index 60adfe8af77..ca102b37b1e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Name.cs @@ -44,16 +44,7 @@ namespace Org.OpenAPITools.Model /// property. public Name(int name = default(int), string property = default(string)) { - // to ensure "name" is required (not null) - if (name == null) - { - throw new InvalidDataException("name is a required property for Name and cannot be null"); - } - else - { - this._Name = name; - } - + this._Name = name; this.Property = property; } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Order.cs index 0c4a6a5b60f..7a10e4a0f98 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Order.cs @@ -81,15 +81,7 @@ namespace Org.OpenAPITools.Model this.Quantity = quantity; this.ShipDate = shipDate; this.Status = status; - // use default value if no "complete" provided - if (complete == null) - { - this.Complete = false; - } - else - { - this.Complete = complete; - } + this.Complete = complete; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pet.cs index b7be3ee84f9..4341ff4452a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pet.cs @@ -82,25 +82,9 @@ namespace Org.OpenAPITools.Model public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) { // to ensure "name" is required (not null) - if (name == null) - { - throw new InvalidDataException("name is a required property for Pet and cannot be null"); - } - else - { - this.Name = name; - } - + this.Name = name ?? throw new ArgumentNullException("name is a required property for Pet and cannot be null");; // to ensure "photoUrls" is required (not null) - if (photoUrls == null) - { - throw new InvalidDataException("photoUrls is a required property for Pet and cannot be null"); - } - else - { - this.PhotoUrls = photoUrls; - } - + this.PhotoUrls = photoUrls ?? throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null");; this.Id = id; this.Category = category; this.Tags = tags; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TypeHolderDefault.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TypeHolderDefault.cs index 62151f1edfe..c3933da46a6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TypeHolderDefault.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TypeHolderDefault.cs @@ -48,55 +48,12 @@ namespace Org.OpenAPITools.Model public TypeHolderDefault(string stringItem = "what", decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = true, List arrayItem = default(List)) { // to ensure "stringItem" is required (not null) - if (stringItem == null) - { - throw new InvalidDataException("stringItem is a required property for TypeHolderDefault and cannot be null"); - } - else - { - this.StringItem = stringItem; - } - - // to ensure "numberItem" is required (not null) - if (numberItem == null) - { - throw new InvalidDataException("numberItem is a required property for TypeHolderDefault and cannot be null"); - } - else - { - this.NumberItem = numberItem; - } - - // to ensure "integerItem" is required (not null) - if (integerItem == null) - { - throw new InvalidDataException("integerItem is a required property for TypeHolderDefault and cannot be null"); - } - else - { - this.IntegerItem = integerItem; - } - - // to ensure "boolItem" is required (not null) - if (boolItem == null) - { - throw new InvalidDataException("boolItem is a required property for TypeHolderDefault and cannot be null"); - } - else - { - this.BoolItem = boolItem; - } - + this.StringItem = stringItem ?? throw new ArgumentNullException("stringItem is a required property for TypeHolderDefault and cannot be null");; + this.NumberItem = numberItem; + this.IntegerItem = integerItem; + this.BoolItem = boolItem; // to ensure "arrayItem" is required (not null) - if (arrayItem == null) - { - throw new InvalidDataException("arrayItem is a required property for TypeHolderDefault and cannot be null"); - } - else - { - this.ArrayItem = arrayItem; - } - + this.ArrayItem = arrayItem ?? throw new ArgumentNullException("arrayItem is a required property for TypeHolderDefault and cannot be null");; } /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TypeHolderExample.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TypeHolderExample.cs index 42043170e6a..ee949e45bc8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TypeHolderExample.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/TypeHolderExample.cs @@ -49,65 +49,13 @@ namespace Org.OpenAPITools.Model public TypeHolderExample(string stringItem = default(string), decimal numberItem = default(decimal), float floatItem = default(float), int integerItem = default(int), bool boolItem = default(bool), List arrayItem = default(List)) { // to ensure "stringItem" is required (not null) - if (stringItem == null) - { - throw new InvalidDataException("stringItem is a required property for TypeHolderExample and cannot be null"); - } - else - { - this.StringItem = stringItem; - } - - // to ensure "numberItem" is required (not null) - if (numberItem == null) - { - throw new InvalidDataException("numberItem is a required property for TypeHolderExample and cannot be null"); - } - else - { - this.NumberItem = numberItem; - } - - // to ensure "floatItem" is required (not null) - if (floatItem == null) - { - throw new InvalidDataException("floatItem is a required property for TypeHolderExample and cannot be null"); - } - else - { - this.FloatItem = floatItem; - } - - // to ensure "integerItem" is required (not null) - if (integerItem == null) - { - throw new InvalidDataException("integerItem is a required property for TypeHolderExample and cannot be null"); - } - else - { - this.IntegerItem = integerItem; - } - - // to ensure "boolItem" is required (not null) - if (boolItem == null) - { - throw new InvalidDataException("boolItem is a required property for TypeHolderExample and cannot be null"); - } - else - { - this.BoolItem = boolItem; - } - + this.StringItem = stringItem ?? throw new ArgumentNullException("stringItem is a required property for TypeHolderExample and cannot be null");; + this.NumberItem = numberItem; + this.FloatItem = floatItem; + this.IntegerItem = integerItem; + this.BoolItem = boolItem; // to ensure "arrayItem" is required (not null) - if (arrayItem == null) - { - throw new InvalidDataException("arrayItem is a required property for TypeHolderExample and cannot be null"); - } - else - { - this.ArrayItem = arrayItem; - } - + this.ArrayItem = arrayItem ?? throw new ArgumentNullException("arrayItem is a required property for TypeHolderExample and cannot be null");; } /// From a51d02ac615b535e0b49a7e33888f653577ddb03 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 29 Jan 2020 10:10:41 -0800 Subject: [PATCH 52/85] [Python] Fix #5126 operations with req enums of length one (#5129) * Updates ap.mustache for python-experimental, adds test test_test_endpoint_enums_length_one * Removes sortParamsByRequiredFlag from python-experimental * Removes duplicate params from docstring --- docs/generators/python-experimental.md | 1 - .../PythonClientExperimentalCodegen.java | 7 + .../python/python-experimental/api.mustache | 90 +- .../petstore_api/api/another_fake_api.py | 58 +- .../petstore_api/api/fake_api.py | 933 ++++++++++-------- .../api/fake_classname_tags_123_api.py | 58 +- .../petstore_api/api/pet_api.py | 539 +++++----- .../petstore_api/api/store_api.py | 228 +++-- .../petstore_api/api/user_api.py | 466 +++++---- .../python-experimental/test/test_fake_api.py | 50 +- .../petstore_api/api/another_fake_api.py | 58 +- .../petstore_api/api/default_api.py | 54 +- .../petstore_api/api/fake_api.py | 871 +++++++++------- .../api/fake_classname_tags_123_api.py | 58 +- .../petstore_api/api/pet_api.py | 537 +++++----- .../petstore_api/api/store_api.py | 228 +++-- .../petstore_api/api/user_api.py | 466 +++++---- 17 files changed, 2691 insertions(+), 2011 deletions(-) diff --git a/docs/generators/python-experimental.md b/docs/generators/python-experimental.md index 1c42e769197..483060b622f 100644 --- a/docs/generators/python-experimental.md +++ b/docs/generators/python-experimental.md @@ -12,7 +12,6 @@ sidebar_label: python-experimental |packageUrl|python package URL.| |null| |packageVersion|python package version.| |1.0.0| |projectName|python project name in setup.py (e.g. petstore-api).| |null| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |useNose|use the nose test framework| |false| ## IMPORT MAPPING diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index 94aa9c2f076..33472480b13 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -97,6 +97,13 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { modelTestTemplateFiles.remove("model_test.mustache", ".py"); modelTestTemplateFiles.put("python-experimental/model_test.mustache", ".py"); + // this generator does not use SORT_PARAMS_BY_REQUIRED_FLAG + // this generator uses the following order for endpoint paramters and model properties + // required params/props with no enum of length one + // required params/props with enum of length one (which is used to set a default value as a python named arg value) + // optional params/props with **kwargs in python + cliOptions.remove(4); + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) .stability(Stability.EXPERIMENTAL) .build(); diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache index 8390a848d26..4cf1d423e83 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache @@ -45,7 +45,20 @@ class {{classname}}(object): self.api_client = api_client {{#operation}} - def __{{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501 + def __{{operationId}}( + self, +{{#requiredParams}} +{{^defaultValue}} + {{paramName}}, +{{/defaultValue}} +{{/requiredParams}} +{{#requiredParams}} +{{#defaultValue}} + {{paramName}}={{{defaultValue}}}, +{{/defaultValue}} +{{/requiredParams}} + **kwargs + ): """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 {{#notes}} @@ -53,40 +66,51 @@ class {{classname}}(object): {{/notes}} This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True -{{#sortParamsByRequiredFlag}} - >>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}async_req=True) -{{/sortParamsByRequiredFlag}} -{{^sortParamsByRequiredFlag}} - >>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}async_req=True) -{{/sortParamsByRequiredFlag}} + >>> thread = api.{{operationId}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{{defaultValue}}}, {{/defaultValue}}{{/requiredParams}}async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. -{{#allParams}} - :param {{dataType}} {{paramName}}:{{#description}} {{{description}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}} -{{/allParams}} - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}} - If the method is called asynchronously, returns the request - thread. +{{#requiredParams}} +{{^hasMore}} + Args: +{{/hasMore}} +{{/requiredParams}} +{{#requiredParams}} +{{^defaultValue}} + {{paramName}} ({{dataType}}):{{#description}} {{description}}{{/description}} +{{/defaultValue}} +{{/requiredParams}} +{{#requiredParams}} +{{#defaultValue}} + {{paramName}} ({{dataType}}):{{#description}} {{description}}.{{/description}} defaults to {{{defaultValue}}}, must be one of [{{{defaultValue}}}] +{{/defaultValue}} +{{/requiredParams}} + + Keyword Args:{{#optionalParams}} + {{paramName}} ({{dataType}}):{{#description}} {{description}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}}{{/optionalParams}} + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}} + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False diff --git a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py index 7a8e081050d..2db9b6de925 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -49,7 +49,11 @@ class AnotherFakeApi(object): api_client = ApiClient() self.api_client = api_client - def __call_123_test_special_tags(self, body, **kwargs): # noqa: E501 + def __call_123_test_special_tags( + self, + body, + **kwargs + ): """To test special tags # noqa: E501 To test special tags and operation ID starting with number # noqa: E501 @@ -58,30 +62,34 @@ class AnotherFakeApi(object): >>> thread = api.call_123_test_special_tags(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param client.Client body: client model (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: client.Client - If the method is called asynchronously, returns the request - thread. + Args: + body (client.Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + client.Client + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py index 13b39417a25..8c50f5e15d5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -55,7 +55,11 @@ class FakeApi(object): api_client = ApiClient() self.api_client = api_client - def __create_xml_item(self, xml_item, **kwargs): # noqa: E501 + def __create_xml_item( + self, + xml_item, + **kwargs + ): """creates an XmlItem # noqa: E501 this route creates an XmlItem # noqa: E501 @@ -64,30 +68,34 @@ class FakeApi(object): >>> thread = api.create_xml_item(xml_item, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param xml_item.XmlItem xml_item: XmlItem Body (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + xml_item (xml_item.XmlItem): XmlItem Body + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -167,7 +175,10 @@ class FakeApi(object): callable=__create_xml_item ) - def __fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 + def __fake_outer_boolean_serialize( + self, + **kwargs + ): """fake_outer_boolean_serialize # noqa: E501 Test serialization of outer boolean types # noqa: E501 @@ -176,30 +187,33 @@ class FakeApi(object): >>> thread = api.fake_outer_boolean_serialize(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param bool body: Input boolean as post body - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: bool - If the method is called asynchronously, returns the request - thread. + + Keyword Args: + body (bool): Input boolean as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + bool + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -270,7 +284,10 @@ class FakeApi(object): callable=__fake_outer_boolean_serialize ) - def __fake_outer_composite_serialize(self, **kwargs): # noqa: E501 + def __fake_outer_composite_serialize( + self, + **kwargs + ): """fake_outer_composite_serialize # noqa: E501 Test serialization of object with outer number type # noqa: E501 @@ -279,30 +296,33 @@ class FakeApi(object): >>> thread = api.fake_outer_composite_serialize(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param outer_composite.OuterComposite body: Input composite as post body - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: outer_composite.OuterComposite - If the method is called asynchronously, returns the request - thread. + + Keyword Args: + body (outer_composite.OuterComposite): Input composite as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + outer_composite.OuterComposite + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -373,7 +393,10 @@ class FakeApi(object): callable=__fake_outer_composite_serialize ) - def __fake_outer_enum_serialize(self, **kwargs): # noqa: E501 + def __fake_outer_enum_serialize( + self, + **kwargs + ): """fake_outer_enum_serialize # noqa: E501 Test serialization of outer enum # noqa: E501 @@ -382,30 +405,33 @@ class FakeApi(object): >>> thread = api.fake_outer_enum_serialize(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param outer_enum.OuterEnum body: Input enum as post body - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: outer_enum.OuterEnum - If the method is called asynchronously, returns the request - thread. + + Keyword Args: + body (outer_enum.OuterEnum): Input enum as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + outer_enum.OuterEnum + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -476,7 +502,10 @@ class FakeApi(object): callable=__fake_outer_enum_serialize ) - def __fake_outer_number_serialize(self, **kwargs): # noqa: E501 + def __fake_outer_number_serialize( + self, + **kwargs + ): """fake_outer_number_serialize # noqa: E501 Test serialization of outer number types # noqa: E501 @@ -485,30 +514,33 @@ class FakeApi(object): >>> thread = api.fake_outer_number_serialize(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param outer_number.OuterNumber body: Input number as post body - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: outer_number.OuterNumber - If the method is called asynchronously, returns the request - thread. + + Keyword Args: + body (outer_number.OuterNumber): Input number as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + outer_number.OuterNumber + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -579,7 +611,10 @@ class FakeApi(object): callable=__fake_outer_number_serialize ) - def __fake_outer_string_serialize(self, **kwargs): # noqa: E501 + def __fake_outer_string_serialize( + self, + **kwargs + ): """fake_outer_string_serialize # noqa: E501 Test serialization of outer string types # noqa: E501 @@ -588,30 +623,33 @@ class FakeApi(object): >>> thread = api.fake_outer_string_serialize(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param str body: Input string as post body - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: str - If the method is called asynchronously, returns the request - thread. + + Keyword Args: + body (str): Input string as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -682,7 +720,11 @@ class FakeApi(object): callable=__fake_outer_string_serialize ) - def __test_body_with_file_schema(self, body, **kwargs): # noqa: E501 + def __test_body_with_file_schema( + self, + body, + **kwargs + ): """test_body_with_file_schema # noqa: E501 For this test, the body for this request much reference a schema named `File`. # noqa: E501 @@ -691,30 +733,34 @@ class FakeApi(object): >>> thread = api.test_body_with_file_schema(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param file_schema_test_class.FileSchemaTestClass body: (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + body (file_schema_test_class.FileSchemaTestClass): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -789,7 +835,12 @@ class FakeApi(object): callable=__test_body_with_file_schema ) - def __test_body_with_query_params(self, query, body, **kwargs): # noqa: E501 + def __test_body_with_query_params( + self, + query, + body, + **kwargs + ): """test_body_with_query_params # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -797,31 +848,35 @@ class FakeApi(object): >>> thread = api.test_body_with_query_params(query, body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param str query: (required) - :param user.User body: (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + query (str): + body (user.User): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -904,7 +959,11 @@ class FakeApi(object): callable=__test_body_with_query_params ) - def __test_client_model(self, body, **kwargs): # noqa: E501 + def __test_client_model( + self, + body, + **kwargs + ): """To test \"client\" model # noqa: E501 To test \"client\" model # noqa: E501 @@ -913,30 +972,34 @@ class FakeApi(object): >>> thread = api.test_client_model(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param client.Client body: client model (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: client.Client - If the method is called asynchronously, returns the request - thread. + Args: + body (client.Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + client.Client + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -1013,43 +1076,55 @@ class FakeApi(object): callable=__test_client_model ) - def __test_endpoint_enums_length_one(self, query_integer, query_string, path_string, path_integer, header_number, **kwargs): # noqa: E501 + def __test_endpoint_enums_length_one( + self, + query_integer=3, + query_string='brillig', + path_string='hello', + path_integer=34, + header_number=1.234, + **kwargs + ): """test_endpoint_enums_length_one # noqa: E501 This route has required values with enums of 1 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_endpoint_enums_length_one(query_integer, query_string, path_string, path_integer, header_number, async_req=True) + >>> thread = api.test_endpoint_enums_length_one(query_integer=3, query_string='brillig', path_string='hello', path_integer=34, header_number=1.234, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param int query_integer: (required) - :param str query_string: (required) - :param str path_string: (required) - :param int path_integer: (required) - :param float header_number: (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + query_integer (int): defaults to 3, must be one of [3] + query_string (str): defaults to 'brillig', must be one of ['brillig'] + path_string (str): defaults to 'hello', must be one of ['hello'] + path_integer (int): defaults to 34, must be one of [34] + header_number (float): defaults to 1.234, must be one of [1.234] + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -1180,7 +1255,14 @@ class FakeApi(object): callable=__test_endpoint_enums_length_one ) - def __test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 + def __test_endpoint_parameters( + self, + number, + double, + pattern_without_delimiter, + byte, + **kwargs + ): """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 @@ -1189,43 +1271,47 @@ class FakeApi(object): >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param float number: None (required) - :param float double: None (required) - :param str pattern_without_delimiter: None (required) - :param str byte: None (required) - :param int integer: None - :param int int32: None - :param int int64: None - :param float float: None - :param str string: None - :param file_type binary: None - :param date date: None - :param datetime date_time: None - :param str password: None - :param str param_callback: None - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + number (float): None + double (float): None + pattern_without_delimiter (str): None + byte (str): None + + Keyword Args: + integer (int): None. [optional] + int32 (int): None. [optional] + int64 (int): None. [optional] + float (float): None. [optional] + string (str): None. [optional] + binary (file_type): None. [optional] + date (date): None. [optional] + date_time (datetime): None. [optional] + password (str): None. [optional] + param_callback (str): None. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -1426,7 +1512,10 @@ class FakeApi(object): callable=__test_endpoint_parameters ) - def __test_enum_parameters(self, **kwargs): # noqa: E501 + def __test_enum_parameters( + self, + **kwargs + ): """To test enum parameters # noqa: E501 To test enum parameters # noqa: E501 @@ -1435,37 +1524,40 @@ class FakeApi(object): >>> thread = api.test_enum_parameters(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param [str] enum_header_string_array: Header parameter enum test (string array) - :param str enum_header_string: Header parameter enum test (string) - :param [str] enum_query_string_array: Query parameter enum test (string array) - :param str enum_query_string: Query parameter enum test (string) - :param int enum_query_integer: Query parameter enum test (double) - :param float enum_query_double: Query parameter enum test (double) - :param [str] enum_form_string_array: Form parameter enum test (string array) - :param str enum_form_string: Form parameter enum test (string) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + + Keyword Args: + enum_header_string_array ([str]): Header parameter enum test (string array). [optional] + enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' + enum_query_string_array ([str]): Query parameter enum test (string array). [optional] + enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' + enum_query_integer (int): Query parameter enum test (double). [optional] + enum_query_double (float): Query parameter enum test (double). [optional] + enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of '$' + enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -1626,7 +1718,13 @@ class FakeApi(object): callable=__test_enum_parameters ) - def __test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 + def __test_group_parameters( + self, + required_string_group, + required_boolean_group, + required_int64_group, + **kwargs + ): """Fake endpoint to test group parameters (optional) # noqa: E501 Fake endpoint to test group parameters (optional) # noqa: E501 @@ -1635,35 +1733,39 @@ class FakeApi(object): >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param int required_string_group: Required String in group parameters (required) - :param bool required_boolean_group: Required Boolean in group parameters (required) - :param int required_int64_group: Required Integer in group parameters (required) - :param int string_group: String in group parameters - :param bool boolean_group: Boolean in group parameters - :param int int64_group: Integer in group parameters - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + required_string_group (int): Required String in group parameters + required_boolean_group (bool): Required Boolean in group parameters + required_int64_group (int): Required Integer in group parameters + + Keyword Args: + string_group (int): String in group parameters. [optional] + boolean_group (bool): Boolean in group parameters. [optional] + int64_group (int): Integer in group parameters. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -1768,7 +1870,11 @@ class FakeApi(object): callable=__test_group_parameters ) - def __test_inline_additional_properties(self, param, **kwargs): # noqa: E501 + def __test_inline_additional_properties( + self, + param, + **kwargs + ): """test inline additionalProperties # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1776,30 +1882,34 @@ class FakeApi(object): >>> thread = api.test_inline_additional_properties(param, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param {str: (str,)} param: request body (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + param ({str: (str,)}): request body + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -1874,7 +1984,12 @@ class FakeApi(object): callable=__test_inline_additional_properties ) - def __test_json_form_data(self, param, param2, **kwargs): # noqa: E501 + def __test_json_form_data( + self, + param, + param2, + **kwargs + ): """test json serialization of form data # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1882,31 +1997,35 @@ class FakeApi(object): >>> thread = api.test_json_form_data(param, param2, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param str param: field1 (required) - :param str param2: field2 (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + param (str): field1 + param2 (str): field2 + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py index ba0386f633a..ab817996b0e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -49,7 +49,11 @@ class FakeClassnameTags123Api(object): api_client = ApiClient() self.api_client = api_client - def __test_classname(self, body, **kwargs): # noqa: E501 + def __test_classname( + self, + body, + **kwargs + ): """To test class name in snake case # noqa: E501 To test class name in snake case # noqa: E501 @@ -58,30 +62,34 @@ class FakeClassnameTags123Api(object): >>> thread = api.test_classname(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param client.Client body: client model (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: client.Client - If the method is called asynchronously, returns the request - thread. + Args: + body (client.Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + client.Client + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False diff --git a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py index 3eeae195e0a..829534ed790 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -50,7 +50,11 @@ class PetApi(object): api_client = ApiClient() self.api_client = api_client - def __add_pet(self, body, **kwargs): # noqa: E501 + def __add_pet( + self, + body, + **kwargs + ): """Add a new pet to the store # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -58,30 +62,34 @@ class PetApi(object): >>> thread = api.add_pet(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param pet.Pet body: Pet object that needs to be added to the store (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + body (pet.Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -159,7 +167,11 @@ class PetApi(object): callable=__add_pet ) - def __delete_pet(self, pet_id, **kwargs): # noqa: E501 + def __delete_pet( + self, + pet_id, + **kwargs + ): """Deletes a pet # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -167,31 +179,35 @@ class PetApi(object): >>> thread = api.delete_pet(pet_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param int pet_id: Pet id to delete (required) - :param str api_key: - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + pet_id (int): Pet id to delete + + Keyword Args: + api_key (str): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -272,7 +288,11 @@ class PetApi(object): callable=__delete_pet ) - def __find_pets_by_status(self, status, **kwargs): # noqa: E501 + def __find_pets_by_status( + self, + status, + **kwargs + ): """Finds Pets by status # noqa: E501 Multiple status values can be provided with comma separated strings # noqa: E501 @@ -281,30 +301,34 @@ class PetApi(object): >>> thread = api.find_pets_by_status(status, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param [str] status: Status values that need to be considered for filter (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: [pet.Pet] - If the method is called asynchronously, returns the request - thread. + Args: + status ([str]): Status values that need to be considered for filter + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + [pet.Pet] + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -391,7 +415,11 @@ class PetApi(object): callable=__find_pets_by_status ) - def __find_pets_by_tags(self, tags, **kwargs): # noqa: E501 + def __find_pets_by_tags( + self, + tags, + **kwargs + ): """Finds Pets by tags # noqa: E501 Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 @@ -400,30 +428,34 @@ class PetApi(object): >>> thread = api.find_pets_by_tags(tags, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param [str] tags: Tags to filter by (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: [pet.Pet] - If the method is called asynchronously, returns the request - thread. + Args: + tags ([str]): Tags to filter by + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + [pet.Pet] + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -503,7 +535,11 @@ class PetApi(object): callable=__find_pets_by_tags ) - def __get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 + def __get_pet_by_id( + self, + pet_id, + **kwargs + ): """Find pet by ID # noqa: E501 Returns a single pet # noqa: E501 @@ -512,30 +548,34 @@ class PetApi(object): >>> thread = api.get_pet_by_id(pet_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param int pet_id: ID of pet to return (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: pet.Pet - If the method is called asynchronously, returns the request - thread. + Args: + pet_id (int): ID of pet to return + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + pet.Pet + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -614,7 +654,11 @@ class PetApi(object): callable=__get_pet_by_id ) - def __update_pet(self, body, **kwargs): # noqa: E501 + def __update_pet( + self, + body, + **kwargs + ): """Update an existing pet # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -622,30 +666,34 @@ class PetApi(object): >>> thread = api.update_pet(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param pet.Pet body: Pet object that needs to be added to the store (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + body (pet.Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -723,7 +771,11 @@ class PetApi(object): callable=__update_pet ) - def __update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 + def __update_pet_with_form( + self, + pet_id, + **kwargs + ): """Updates a pet in the store with form data # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -731,32 +783,36 @@ class PetApi(object): >>> thread = api.update_pet_with_form(pet_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param int pet_id: ID of pet that needs to be updated (required) - :param str name: Updated name of the pet - :param str status: Updated status of the pet - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + pet_id (int): ID of pet that needs to be updated + + Keyword Args: + name (str): Updated name of the pet. [optional] + status (str): Updated status of the pet. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -844,7 +900,11 @@ class PetApi(object): callable=__update_pet_with_form ) - def __upload_file(self, pet_id, **kwargs): # noqa: E501 + def __upload_file( + self, + pet_id, + **kwargs + ): """uploads an image # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -852,33 +912,37 @@ class PetApi(object): >>> thread = api.upload_file(pet_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param int pet_id: ID of pet to update (required) - :param str additional_metadata: Additional data to pass to server - :param file_type file: file to upload - :param [file_type] files: files to upload - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: api_response.ApiResponse - If the method is called asynchronously, returns the request - thread. + Args: + pet_id (int): ID of pet to update + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + file (file_type): file to upload. [optional] + files ([file_type]): files to upload. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + api_response.ApiResponse + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -974,7 +1038,12 @@ class PetApi(object): callable=__upload_file ) - def __upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501 + def __upload_file_with_required_file( + self, + pet_id, + required_file, + **kwargs + ): """uploads an image (required) # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -982,32 +1051,36 @@ class PetApi(object): >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param int pet_id: ID of pet to update (required) - :param file_type required_file: file to upload (required) - :param str additional_metadata: Additional data to pass to server - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: api_response.ApiResponse - If the method is called asynchronously, returns the request - thread. + Args: + pet_id (int): ID of pet to update + required_file (file_type): file to upload + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + api_response.ApiResponse + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False diff --git a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py index e429d348e67..890474acc03 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -49,7 +49,11 @@ class StoreApi(object): api_client = ApiClient() self.api_client = api_client - def __delete_order(self, order_id, **kwargs): # noqa: E501 + def __delete_order( + self, + order_id, + **kwargs + ): """Delete purchase order by ID # noqa: E501 For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 @@ -58,30 +62,34 @@ class StoreApi(object): >>> thread = api.delete_order(order_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param str order_id: ID of the order that needs to be deleted (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + order_id (str): ID of the order that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -155,7 +163,10 @@ class StoreApi(object): callable=__delete_order ) - def __get_inventory(self, **kwargs): # noqa: E501 + def __get_inventory( + self, + **kwargs + ): """Returns pet inventories by status # noqa: E501 Returns a map of status codes to quantities # noqa: E501 @@ -164,29 +175,32 @@ class StoreApi(object): >>> thread = api.get_inventory(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: {str: (int,)} - If the method is called asynchronously, returns the request - thread. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + {str: (int,)} + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -255,7 +269,11 @@ class StoreApi(object): callable=__get_inventory ) - def __get_order_by_id(self, order_id, **kwargs): # noqa: E501 + def __get_order_by_id( + self, + order_id, + **kwargs + ): """Find purchase order by ID # noqa: E501 For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 @@ -264,30 +282,34 @@ class StoreApi(object): >>> thread = api.get_order_by_id(order_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param int order_id: ID of pet that needs to be fetched (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: order.Order - If the method is called asynchronously, returns the request - thread. + Args: + order_id (int): ID of pet that needs to be fetched + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + order.Order + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -370,7 +392,11 @@ class StoreApi(object): callable=__get_order_by_id ) - def __place_order(self, body, **kwargs): # noqa: E501 + def __place_order( + self, + body, + **kwargs + ): """Place an order for a pet # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -378,30 +404,34 @@ class StoreApi(object): >>> thread = api.place_order(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param order.Order body: order placed for purchasing the pet (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: order.Order - If the method is called asynchronously, returns the request - thread. + Args: + body (order.Order): order placed for purchasing the pet + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + order.Order + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False diff --git a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py index 9f754bb50a6..74389cbf242 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -49,7 +49,11 @@ class UserApi(object): api_client = ApiClient() self.api_client = api_client - def __create_user(self, body, **kwargs): # noqa: E501 + def __create_user( + self, + body, + **kwargs + ): """Create user # noqa: E501 This can only be done by the logged in user. # noqa: E501 @@ -58,30 +62,34 @@ class UserApi(object): >>> thread = api.create_user(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param user.User body: Created user object (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + body (user.User): Created user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -154,7 +162,11 @@ class UserApi(object): callable=__create_user ) - def __create_users_with_array_input(self, body, **kwargs): # noqa: E501 + def __create_users_with_array_input( + self, + body, + **kwargs + ): """Creates list of users with given input array # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -162,30 +174,34 @@ class UserApi(object): >>> thread = api.create_users_with_array_input(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param [user.User] body: List of user object (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + body ([user.User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -258,7 +274,11 @@ class UserApi(object): callable=__create_users_with_array_input ) - def __create_users_with_list_input(self, body, **kwargs): # noqa: E501 + def __create_users_with_list_input( + self, + body, + **kwargs + ): """Creates list of users with given input array # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -266,30 +286,34 @@ class UserApi(object): >>> thread = api.create_users_with_list_input(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param [user.User] body: List of user object (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + body ([user.User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -362,7 +386,11 @@ class UserApi(object): callable=__create_users_with_list_input ) - def __delete_user(self, username, **kwargs): # noqa: E501 + def __delete_user( + self, + username, + **kwargs + ): """Delete user # noqa: E501 This can only be done by the logged in user. # noqa: E501 @@ -371,30 +399,34 @@ class UserApi(object): >>> thread = api.delete_user(username, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param str username: The name that needs to be deleted (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + username (str): The name that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -468,7 +500,11 @@ class UserApi(object): callable=__delete_user ) - def __get_user_by_name(self, username, **kwargs): # noqa: E501 + def __get_user_by_name( + self, + username, + **kwargs + ): """Get user by user name # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -476,30 +512,34 @@ class UserApi(object): >>> thread = api.get_user_by_name(username, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param str username: The name that needs to be fetched. Use user1 for testing. (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: user.User - If the method is called asynchronously, returns the request - thread. + Args: + username (str): The name that needs to be fetched. Use user1 for testing. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + user.User + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -576,7 +616,12 @@ class UserApi(object): callable=__get_user_by_name ) - def __login_user(self, username, password, **kwargs): # noqa: E501 + def __login_user( + self, + username, + password, + **kwargs + ): """Logs user into the system # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -584,31 +629,35 @@ class UserApi(object): >>> thread = api.login_user(username, password, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param str username: The user name for login (required) - :param str password: The password for login in clear text (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: str - If the method is called asynchronously, returns the request - thread. + Args: + username (str): The user name for login + password (str): The password for login in clear text + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -693,7 +742,10 @@ class UserApi(object): callable=__login_user ) - def __logout_user(self, **kwargs): # noqa: E501 + def __logout_user( + self, + **kwargs + ): """Logs out current logged in user session # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -701,29 +753,32 @@ class UserApi(object): >>> thread = api.logout_user(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -788,7 +843,12 @@ class UserApi(object): callable=__logout_user ) - def __update_user(self, username, body, **kwargs): # noqa: E501 + def __update_user( + self, + username, + body, + **kwargs + ): """Updated user # noqa: E501 This can only be done by the logged in user. # noqa: E501 @@ -797,31 +857,35 @@ class UserApi(object): >>> thread = api.update_user(username, body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param str username: name that need to be deleted (required) - :param user.User body: Updated user object (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + username (str): name that need to be deleted + body (user.User): Updated user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False diff --git a/samples/client/petstore/python-experimental/test/test_fake_api.py b/samples/client/petstore/python-experimental/test/test_fake_api.py index 0f4e875d197..7a6f1d6810a 100644 --- a/samples/client/petstore/python-experimental/test/test_fake_api.py +++ b/samples/client/petstore/python-experimental/test/test_fake_api.py @@ -5,14 +5,19 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - OpenAPI spec version: 1.0.0 + The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import +import six import unittest +if six.PY3: + from unittest.mock import patch +else: + from mock import patch import petstore_api from petstore_api.api.fake_api import FakeApi # noqa: E501 @@ -28,6 +33,13 @@ class TestFakeApi(unittest.TestCase): def tearDown(self): pass + def test_create_xml_item(self): + """Test case for create_xml_item + + creates an XmlItem # noqa: E501 + """ + pass + def test_fake_outer_boolean_serialize(self): """Test case for fake_outer_boolean_serialize @@ -64,6 +76,12 @@ class TestFakeApi(unittest.TestCase): """ pass + def test_test_body_with_file_schema(self): + """Test case for test_body_with_file_schema + + """ + pass + def test_test_body_with_query_params(self): """Test case for test_body_with_query_params @@ -77,6 +95,29 @@ class TestFakeApi(unittest.TestCase): """ pass + def test_test_endpoint_enums_length_one(self): + """Test case for test_endpoint_enums_length_one + + """ + # when we omit the required enums of length one, they are still set + endpoint = self.api.test_endpoint_enums_length_one + with patch.object(endpoint, 'call_with_http_info') as call_with_http_info: + endpoint() + call_with_http_info.assert_called_with( + _check_input_type=True, + _check_return_type=True, + _host_index=0, + _preload_content=True, + _request_timeout=None, + _return_http_data_only=True, + async_req=False, + header_number=1.234, + path_integer=34, + path_string='hello', + query_integer=3, + query_string='brillig' + ) + def test_test_endpoint_parameters(self): """Test case for test_endpoint_parameters @@ -115,6 +156,13 @@ class TestFakeApi(unittest.TestCase): with self.assertRaises(petstore_api.ApiValueError): self.api.test_enum_parameters(**keyword_args) + def test_test_group_parameters(self): + """Test case for test_group_parameters + + Fake endpoint to test group parameters (optional) # noqa: E501 + """ + pass + def test_test_inline_additional_properties(self): """Test case for test_inline_additional_properties diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py index 487b15dd082..fbf98194fcd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -49,7 +49,11 @@ class AnotherFakeApi(object): api_client = ApiClient() self.api_client = api_client - def __call_123_test_special_tags(self, client_client, **kwargs): # noqa: E501 + def __call_123_test_special_tags( + self, + client_client, + **kwargs + ): """To test special tags # noqa: E501 To test special tags and operation ID starting with number # noqa: E501 @@ -58,30 +62,34 @@ class AnotherFakeApi(object): >>> thread = api.call_123_test_special_tags(client_client, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param client.Client client_client: client model (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: client.Client - If the method is called asynchronously, returns the request - thread. + Args: + client_client (client.Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + client.Client + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py index 58b7c22e5e9..3369688cb88 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py @@ -49,7 +49,10 @@ class DefaultApi(object): api_client = ApiClient() self.api_client = api_client - def __foo_get(self, **kwargs): # noqa: E501 + def __foo_get( + self, + **kwargs + ): """foo_get # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -57,29 +60,32 @@ class DefaultApi(object): >>> thread = api.foo_get(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: inline_response_default.InlineResponseDefault - If the method is called asynchronously, returns the request - thread. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + inline_response_default.InlineResponseDefault + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py index c967e92c76e..ad882a19c66 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -53,7 +53,10 @@ class FakeApi(object): api_client = ApiClient() self.api_client = api_client - def __fake_health_get(self, **kwargs): # noqa: E501 + def __fake_health_get( + self, + **kwargs + ): """Health check endpoint # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -61,29 +64,32 @@ class FakeApi(object): >>> thread = api.fake_health_get(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: health_check_result.HealthCheckResult - If the method is called asynchronously, returns the request - thread. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + health_check_result.HealthCheckResult + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -150,7 +156,10 @@ class FakeApi(object): callable=__fake_health_get ) - def __fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 + def __fake_outer_boolean_serialize( + self, + **kwargs + ): """fake_outer_boolean_serialize # noqa: E501 Test serialization of outer boolean types # noqa: E501 @@ -159,30 +168,33 @@ class FakeApi(object): >>> thread = api.fake_outer_boolean_serialize(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param bool body: Input boolean as post body - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: bool - If the method is called asynchronously, returns the request - thread. + + Keyword Args: + body (bool): Input boolean as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + bool + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -255,7 +267,10 @@ class FakeApi(object): callable=__fake_outer_boolean_serialize ) - def __fake_outer_composite_serialize(self, **kwargs): # noqa: E501 + def __fake_outer_composite_serialize( + self, + **kwargs + ): """fake_outer_composite_serialize # noqa: E501 Test serialization of object with outer number type # noqa: E501 @@ -264,30 +279,33 @@ class FakeApi(object): >>> thread = api.fake_outer_composite_serialize(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param outer_composite.OuterComposite outer_composite_outer_composite: Input composite as post body - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: outer_composite.OuterComposite - If the method is called asynchronously, returns the request - thread. + + Keyword Args: + outer_composite_outer_composite (outer_composite.OuterComposite): Input composite as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + outer_composite.OuterComposite + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -360,7 +378,10 @@ class FakeApi(object): callable=__fake_outer_composite_serialize ) - def __fake_outer_number_serialize(self, **kwargs): # noqa: E501 + def __fake_outer_number_serialize( + self, + **kwargs + ): """fake_outer_number_serialize # noqa: E501 Test serialization of outer number types # noqa: E501 @@ -369,30 +390,33 @@ class FakeApi(object): >>> thread = api.fake_outer_number_serialize(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param float body: Input number as post body - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: float - If the method is called asynchronously, returns the request - thread. + + Keyword Args: + body (float): Input number as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + float + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -465,7 +489,10 @@ class FakeApi(object): callable=__fake_outer_number_serialize ) - def __fake_outer_string_serialize(self, **kwargs): # noqa: E501 + def __fake_outer_string_serialize( + self, + **kwargs + ): """fake_outer_string_serialize # noqa: E501 Test serialization of outer string types # noqa: E501 @@ -474,30 +501,33 @@ class FakeApi(object): >>> thread = api.fake_outer_string_serialize(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param str body: Input string as post body - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: str - If the method is called asynchronously, returns the request - thread. + + Keyword Args: + body (str): Input string as post body. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -570,7 +600,11 @@ class FakeApi(object): callable=__fake_outer_string_serialize ) - def __test_body_with_file_schema(self, file_schema_test_class_file_schema_test_class, **kwargs): # noqa: E501 + def __test_body_with_file_schema( + self, + file_schema_test_class_file_schema_test_class, + **kwargs + ): """test_body_with_file_schema # noqa: E501 For this test, the body for this request much reference a schema named `File`. # noqa: E501 @@ -579,30 +613,34 @@ class FakeApi(object): >>> thread = api.test_body_with_file_schema(file_schema_test_class_file_schema_test_class, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param file_schema_test_class.FileSchemaTestClass file_schema_test_class_file_schema_test_class: (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + file_schema_test_class_file_schema_test_class (file_schema_test_class.FileSchemaTestClass): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -677,7 +715,12 @@ class FakeApi(object): callable=__test_body_with_file_schema ) - def __test_body_with_query_params(self, query, user_user, **kwargs): # noqa: E501 + def __test_body_with_query_params( + self, + query, + user_user, + **kwargs + ): """test_body_with_query_params # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -685,31 +728,35 @@ class FakeApi(object): >>> thread = api.test_body_with_query_params(query, user_user, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param str query: (required) - :param user.User user_user: (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + query (str): + user_user (user.User): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -792,7 +839,11 @@ class FakeApi(object): callable=__test_body_with_query_params ) - def __test_client_model(self, client_client, **kwargs): # noqa: E501 + def __test_client_model( + self, + client_client, + **kwargs + ): """To test \"client\" model # noqa: E501 To test \"client\" model # noqa: E501 @@ -801,30 +852,34 @@ class FakeApi(object): >>> thread = api.test_client_model(client_client, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param client.Client client_client: client model (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: client.Client - If the method is called asynchronously, returns the request - thread. + Args: + client_client (client.Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + client.Client + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -901,7 +956,14 @@ class FakeApi(object): callable=__test_client_model ) - def __test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 + def __test_endpoint_parameters( + self, + number, + double, + pattern_without_delimiter, + byte, + **kwargs + ): """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 @@ -910,43 +972,47 @@ class FakeApi(object): >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param float number: None (required) - :param float double: None (required) - :param str pattern_without_delimiter: None (required) - :param str byte: None (required) - :param int integer: None - :param int int32: None - :param int int64: None - :param float float: None - :param str string: None - :param file_type binary: None - :param date date: None - :param datetime date_time: None - :param str password: None - :param str param_callback: None - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + number (float): None + double (float): None + pattern_without_delimiter (str): None + byte (str): None + + Keyword Args: + integer (int): None. [optional] + int32 (int): None. [optional] + int64 (int): None. [optional] + float (float): None. [optional] + string (str): None. [optional] + binary (file_type): None. [optional] + date (date): None. [optional] + date_time (datetime): None. [optional] + password (str): None. [optional] + param_callback (str): None. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -1147,7 +1213,10 @@ class FakeApi(object): callable=__test_endpoint_parameters ) - def __test_enum_parameters(self, **kwargs): # noqa: E501 + def __test_enum_parameters( + self, + **kwargs + ): """To test enum parameters # noqa: E501 To test enum parameters # noqa: E501 @@ -1156,37 +1225,40 @@ class FakeApi(object): >>> thread = api.test_enum_parameters(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param [str] enum_header_string_array: Header parameter enum test (string array) - :param str enum_header_string: Header parameter enum test (string) - :param [str] enum_query_string_array: Query parameter enum test (string array) - :param str enum_query_string: Query parameter enum test (string) - :param int enum_query_integer: Query parameter enum test (double) - :param float enum_query_double: Query parameter enum test (double) - :param [str] enum_form_string_array: Form parameter enum test (string array) - :param str enum_form_string: Form parameter enum test (string) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + + Keyword Args: + enum_header_string_array ([str]): Header parameter enum test (string array). [optional] + enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' + enum_query_string_array ([str]): Query parameter enum test (string array). [optional] + enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' + enum_query_integer (int): Query parameter enum test (double). [optional] + enum_query_double (float): Query parameter enum test (double). [optional] + enum_form_string_array ([str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of '$' + enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -1347,7 +1419,13 @@ class FakeApi(object): callable=__test_enum_parameters ) - def __test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 + def __test_group_parameters( + self, + required_string_group, + required_boolean_group, + required_int64_group, + **kwargs + ): """Fake endpoint to test group parameters (optional) # noqa: E501 Fake endpoint to test group parameters (optional) # noqa: E501 @@ -1356,35 +1434,39 @@ class FakeApi(object): >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param int required_string_group: Required String in group parameters (required) - :param bool required_boolean_group: Required Boolean in group parameters (required) - :param int required_int64_group: Required Integer in group parameters (required) - :param int string_group: String in group parameters - :param bool boolean_group: Boolean in group parameters - :param int int64_group: Integer in group parameters - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + required_string_group (int): Required String in group parameters + required_boolean_group (bool): Required Boolean in group parameters + required_int64_group (int): Required Integer in group parameters + + Keyword Args: + string_group (int): String in group parameters. [optional] + boolean_group (bool): Boolean in group parameters. [optional] + int64_group (int): Integer in group parameters. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -1491,7 +1573,11 @@ class FakeApi(object): callable=__test_group_parameters ) - def __test_inline_additional_properties(self, request_body, **kwargs): # noqa: E501 + def __test_inline_additional_properties( + self, + request_body, + **kwargs + ): """test inline additionalProperties # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1499,30 +1585,34 @@ class FakeApi(object): >>> thread = api.test_inline_additional_properties(request_body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param {str: (str,)} request_body: request body (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + request_body ({str: (str,)}): request body + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -1597,7 +1687,12 @@ class FakeApi(object): callable=__test_inline_additional_properties ) - def __test_json_form_data(self, param, param2, **kwargs): # noqa: E501 + def __test_json_form_data( + self, + param, + param2, + **kwargs + ): """test json serialization of form data # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -1605,31 +1700,35 @@ class FakeApi(object): >>> thread = api.test_json_form_data(param, param2, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param str param: field1 (required) - :param str param2: field2 (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + param (str): field1 + param2 (str): field2 + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -1713,7 +1812,15 @@ class FakeApi(object): callable=__test_json_form_data ) - def __test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 + def __test_query_parameter_collection_format( + self, + pipe, + ioutil, + http, + url, + context, + **kwargs + ): """test_query_parameter_collection_format # noqa: E501 To test the collection format in query parameters # noqa: E501 @@ -1722,34 +1829,38 @@ class FakeApi(object): >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param [str] pipe: (required) - :param [str] ioutil: (required) - :param [str] http: (required) - :param [str] url: (required) - :param [str] context: (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + pipe ([str]): + ioutil ([str]): + http ([str]): + url ([str]): + context ([str]): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py index 90da061d2d9..ec0225f1d1c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -49,7 +49,11 @@ class FakeClassnameTags123Api(object): api_client = ApiClient() self.api_client = api_client - def __test_classname(self, client_client, **kwargs): # noqa: E501 + def __test_classname( + self, + client_client, + **kwargs + ): """To test class name in snake case # noqa: E501 To test class name in snake case # noqa: E501 @@ -58,30 +62,34 @@ class FakeClassnameTags123Api(object): >>> thread = api.test_classname(client_client, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param client.Client client_client: client model (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: client.Client - If the method is called asynchronously, returns the request - thread. + Args: + client_client (client.Client): client model + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + client.Client + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py index 53f199f9a89..0a0849dfb95 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -50,7 +50,11 @@ class PetApi(object): api_client = ApiClient() self.api_client = api_client - def __add_pet(self, pet_pet, **kwargs): # noqa: E501 + def __add_pet( + self, + pet_pet, + **kwargs + ): """Add a new pet to the store # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -58,30 +62,34 @@ class PetApi(object): >>> thread = api.add_pet(pet_pet, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param pet.Pet pet_pet: Pet object that needs to be added to the store (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + pet_pet (pet.Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -163,7 +171,11 @@ class PetApi(object): callable=__add_pet ) - def __delete_pet(self, pet_id, **kwargs): # noqa: E501 + def __delete_pet( + self, + pet_id, + **kwargs + ): """Deletes a pet # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -171,31 +183,35 @@ class PetApi(object): >>> thread = api.delete_pet(pet_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param int pet_id: Pet id to delete (required) - :param str api_key: - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + pet_id (int): Pet id to delete + + Keyword Args: + api_key (str): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -276,7 +292,11 @@ class PetApi(object): callable=__delete_pet ) - def __find_pets_by_status(self, status, **kwargs): # noqa: E501 + def __find_pets_by_status( + self, + status, + **kwargs + ): """Finds Pets by status # noqa: E501 Multiple status values can be provided with comma separated strings # noqa: E501 @@ -285,30 +305,34 @@ class PetApi(object): >>> thread = api.find_pets_by_status(status, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param [str] status: Status values that need to be considered for filter (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: [pet.Pet] - If the method is called asynchronously, returns the request - thread. + Args: + status ([str]): Status values that need to be considered for filter + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + [pet.Pet] + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -396,7 +420,11 @@ class PetApi(object): callable=__find_pets_by_status ) - def __find_pets_by_tags(self, tags, **kwargs): # noqa: E501 + def __find_pets_by_tags( + self, + tags, + **kwargs + ): """Finds Pets by tags # noqa: E501 Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 @@ -405,30 +433,34 @@ class PetApi(object): >>> thread = api.find_pets_by_tags(tags, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param [str] tags: Tags to filter by (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: [pet.Pet] - If the method is called asynchronously, returns the request - thread. + Args: + tags ([str]): Tags to filter by + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + [pet.Pet] + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -509,7 +541,11 @@ class PetApi(object): callable=__find_pets_by_tags ) - def __get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 + def __get_pet_by_id( + self, + pet_id, + **kwargs + ): """Find pet by ID # noqa: E501 Returns a single pet # noqa: E501 @@ -518,30 +554,34 @@ class PetApi(object): >>> thread = api.get_pet_by_id(pet_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param int pet_id: ID of pet to return (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: pet.Pet - If the method is called asynchronously, returns the request - thread. + Args: + pet_id (int): ID of pet to return + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + pet.Pet + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -620,7 +660,11 @@ class PetApi(object): callable=__get_pet_by_id ) - def __update_pet(self, pet_pet, **kwargs): # noqa: E501 + def __update_pet( + self, + pet_pet, + **kwargs + ): """Update an existing pet # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -628,30 +672,34 @@ class PetApi(object): >>> thread = api.update_pet(pet_pet, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param pet.Pet pet_pet: Pet object that needs to be added to the store (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + pet_pet (pet.Pet): Pet object that needs to be added to the store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -733,7 +781,11 @@ class PetApi(object): callable=__update_pet ) - def __update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 + def __update_pet_with_form( + self, + pet_id, + **kwargs + ): """Updates a pet in the store with form data # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -741,32 +793,36 @@ class PetApi(object): >>> thread = api.update_pet_with_form(pet_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param int pet_id: ID of pet that needs to be updated (required) - :param str name: Updated name of the pet - :param str status: Updated status of the pet - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + pet_id (int): ID of pet that needs to be updated + + Keyword Args: + name (str): Updated name of the pet. [optional] + status (str): Updated status of the pet. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -854,7 +910,11 @@ class PetApi(object): callable=__update_pet_with_form ) - def __upload_file(self, pet_id, **kwargs): # noqa: E501 + def __upload_file( + self, + pet_id, + **kwargs + ): """uploads an image # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -862,32 +922,36 @@ class PetApi(object): >>> thread = api.upload_file(pet_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param int pet_id: ID of pet to update (required) - :param str additional_metadata: Additional data to pass to server - :param file_type file: file to upload - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: api_response.ApiResponse - If the method is called asynchronously, returns the request - thread. + Args: + pet_id (int): ID of pet to update + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + file (file_type): file to upload. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + api_response.ApiResponse + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -977,7 +1041,12 @@ class PetApi(object): callable=__upload_file ) - def __upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501 + def __upload_file_with_required_file( + self, + pet_id, + required_file, + **kwargs + ): """uploads an image (required) # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -985,32 +1054,36 @@ class PetApi(object): >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param int pet_id: ID of pet to update (required) - :param file_type required_file: file to upload (required) - :param str additional_metadata: Additional data to pass to server - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: api_response.ApiResponse - If the method is called asynchronously, returns the request - thread. + Args: + pet_id (int): ID of pet to update + required_file (file_type): file to upload + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + api_response.ApiResponse + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py index c45745f3e52..36fd9bd722c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -49,7 +49,11 @@ class StoreApi(object): api_client = ApiClient() self.api_client = api_client - def __delete_order(self, order_id, **kwargs): # noqa: E501 + def __delete_order( + self, + order_id, + **kwargs + ): """Delete purchase order by ID # noqa: E501 For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 @@ -58,30 +62,34 @@ class StoreApi(object): >>> thread = api.delete_order(order_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param str order_id: ID of the order that needs to be deleted (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + order_id (str): ID of the order that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -155,7 +163,10 @@ class StoreApi(object): callable=__delete_order ) - def __get_inventory(self, **kwargs): # noqa: E501 + def __get_inventory( + self, + **kwargs + ): """Returns pet inventories by status # noqa: E501 Returns a map of status codes to quantities # noqa: E501 @@ -164,29 +175,32 @@ class StoreApi(object): >>> thread = api.get_inventory(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: {str: (int,)} - If the method is called asynchronously, returns the request - thread. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + {str: (int,)} + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -255,7 +269,11 @@ class StoreApi(object): callable=__get_inventory ) - def __get_order_by_id(self, order_id, **kwargs): # noqa: E501 + def __get_order_by_id( + self, + order_id, + **kwargs + ): """Find purchase order by ID # noqa: E501 For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 @@ -264,30 +282,34 @@ class StoreApi(object): >>> thread = api.get_order_by_id(order_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param int order_id: ID of pet that needs to be fetched (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: order.Order - If the method is called asynchronously, returns the request - thread. + Args: + order_id (int): ID of pet that needs to be fetched + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + order.Order + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -370,7 +392,11 @@ class StoreApi(object): callable=__get_order_by_id ) - def __place_order(self, order_order, **kwargs): # noqa: E501 + def __place_order( + self, + order_order, + **kwargs + ): """Place an order for a pet # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -378,30 +404,34 @@ class StoreApi(object): >>> thread = api.place_order(order_order, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param order.Order order_order: order placed for purchasing the pet (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: order.Order - If the method is called asynchronously, returns the request - thread. + Args: + order_order (order.Order): order placed for purchasing the pet + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + order.Order + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py index 141520baa7e..aeac9949361 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -49,7 +49,11 @@ class UserApi(object): api_client = ApiClient() self.api_client = api_client - def __create_user(self, user_user, **kwargs): # noqa: E501 + def __create_user( + self, + user_user, + **kwargs + ): """Create user # noqa: E501 This can only be done by the logged in user. # noqa: E501 @@ -58,30 +62,34 @@ class UserApi(object): >>> thread = api.create_user(user_user, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param user.User user_user: Created user object (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + user_user (user.User): Created user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -156,7 +164,11 @@ class UserApi(object): callable=__create_user ) - def __create_users_with_array_input(self, user_user, **kwargs): # noqa: E501 + def __create_users_with_array_input( + self, + user_user, + **kwargs + ): """Creates list of users with given input array # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -164,30 +176,34 @@ class UserApi(object): >>> thread = api.create_users_with_array_input(user_user, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param [user.User] user_user: List of user object (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + user_user ([user.User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -262,7 +278,11 @@ class UserApi(object): callable=__create_users_with_array_input ) - def __create_users_with_list_input(self, user_user, **kwargs): # noqa: E501 + def __create_users_with_list_input( + self, + user_user, + **kwargs + ): """Creates list of users with given input array # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -270,30 +290,34 @@ class UserApi(object): >>> thread = api.create_users_with_list_input(user_user, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param [user.User] user_user: List of user object (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + user_user ([user.User]): List of user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -368,7 +392,11 @@ class UserApi(object): callable=__create_users_with_list_input ) - def __delete_user(self, username, **kwargs): # noqa: E501 + def __delete_user( + self, + username, + **kwargs + ): """Delete user # noqa: E501 This can only be done by the logged in user. # noqa: E501 @@ -377,30 +405,34 @@ class UserApi(object): >>> thread = api.delete_user(username, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param str username: The name that needs to be deleted (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + username (str): The name that needs to be deleted + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -474,7 +506,11 @@ class UserApi(object): callable=__delete_user ) - def __get_user_by_name(self, username, **kwargs): # noqa: E501 + def __get_user_by_name( + self, + username, + **kwargs + ): """Get user by user name # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -482,30 +518,34 @@ class UserApi(object): >>> thread = api.get_user_by_name(username, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param str username: The name that needs to be fetched. Use user1 for testing. (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: user.User - If the method is called asynchronously, returns the request - thread. + Args: + username (str): The name that needs to be fetched. Use user1 for testing. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + user.User + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -582,7 +622,12 @@ class UserApi(object): callable=__get_user_by_name ) - def __login_user(self, username, password, **kwargs): # noqa: E501 + def __login_user( + self, + username, + password, + **kwargs + ): """Logs user into the system # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -590,31 +635,35 @@ class UserApi(object): >>> thread = api.login_user(username, password, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param str username: The user name for login (required) - :param str password: The password for login in clear text (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: str - If the method is called asynchronously, returns the request - thread. + Args: + username (str): The user name for login + password (str): The password for login in clear text + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + str + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -699,7 +748,10 @@ class UserApi(object): callable=__login_user ) - def __logout_user(self, **kwargs): # noqa: E501 + def __logout_user( + self, + **kwargs + ): """Logs out current logged in user session # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -707,29 +759,32 @@ class UserApi(object): >>> thread = api.logout_user(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False @@ -794,7 +849,12 @@ class UserApi(object): callable=__logout_user ) - def __update_user(self, username, user_user, **kwargs): # noqa: E501 + def __update_user( + self, + username, + user_user, + **kwargs + ): """Updated user # noqa: E501 This can only be done by the logged in user. # noqa: E501 @@ -803,31 +863,35 @@ class UserApi(object): >>> thread = api.update_user(username, user_user, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - Default is False. - :param str username: name that need to be deleted (required) - :param user.User user_user: Updated user object (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. + Args: + username (str): name that need to be deleted + user_user (user.User): Updated user object + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int): specifies the index of the server + that we want to use. + Default is 0. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. """ kwargs['async_req'] = kwargs.get( 'async_req', False From 845acce4af92c50f170c3c76c9c3ea6d34dc53e3 Mon Sep 17 00:00:00 2001 From: Alexey Makhrov Date: Wed, 29 Jan 2020 23:47:09 -0800 Subject: [PATCH 53/85] Remove typeMapping for "List" from AbstractTypeScriptClientCodegen (#5160) --- .../codegen/languages/AbstractTypeScriptClientCodegen.java | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index 0285772a69a..5c3cd43e5a8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -131,7 +131,6 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp typeMapping = new HashMap(); typeMapping.put("Array", "Array"); typeMapping.put("array", "Array"); - typeMapping.put("List", "Array"); typeMapping.put("boolean", "boolean"); typeMapping.put("string", "string"); typeMapping.put("int", "number"); From 97c8009ccbd01cb9360a5fda391a29ded422af09 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Thu, 30 Jan 2020 16:00:13 -0500 Subject: [PATCH 54/85] [gradle] Clarify defining multiple tasks (#5167) --- .../README.adoc | 25 ++++++++++++++++++- .../samples/local-spec/build.gradle | 10 ++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc index 0f97dfb5510..2b613ebfddf 100644 --- a/modules/openapi-generator-gradle-plugin/README.adoc +++ b/modules/openapi-generator-gradle-plugin/README.adoc @@ -9,7 +9,6 @@ These map almost fully 1:1 with the options you'd pass to the CLI or Maven plugi Tasks are listed under the "OpenAPI Tools" tasks heading. - .OpenAPI Tools Tasks |=== |task name |description @@ -38,6 +37,30 @@ compileJava.dependsOn tasks.openApiGenerate ``` ==== +All extensions can be rewritten as tasks. Where you can have only a single extension defined in your gradle file, you may have multiple tasks. + +.One Extension, multiple tasks +[source,groovy] +---- +// Validating a single specification +openApiValidate { + inputSpec = "$rootDir/petstore-v3.0-invalid.yaml".toString() +} + +// Define a task for validating one specification +task validateGoodSpec(type: org.openapitools.generator.gradle.plugin.tasks.ValidateTask){ + inputSpec = "$rootDir/petstore-v3.0.yaml".toString() +} + +// Define a task for validating another specification +task validateBadSpec(type: org.openapitools.generator.gradle.plugin.tasks.ValidateTask){ + inputSpec = "$rootDir/petstore-v3.0-invalid.yaml".toString() +} + +// Define a task for batch validations +task validateSpecs(dependsOn: ['validateGoodSpec', 'validateBadSpec']) +---- + == Plugin Setup //# RELEASE_VERSION diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle b/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle index 70d810a83cb..c8c7e25dc0b 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle @@ -91,3 +91,13 @@ task generateGoWithInvalidSpec(type: org.openapitools.generator.gradle.plugin.ta dateLibrary: "threetenp" ] } + +task validateGoodSpec(type: org.openapitools.generator.gradle.plugin.tasks.ValidateTask){ + inputSpec = "$rootDir/petstore-v3.0.yaml".toString() +} + +task validateBadSpec(type: org.openapitools.generator.gradle.plugin.tasks.ValidateTask){ + inputSpec = "$rootDir/petstore-v3.0-invalid.yaml".toString() +} + +task validateSpecs(dependsOn: ['validateGoodSpec', 'validateBadSpec']) From 49a9b61f515abe82c4b9c08eacd1857112a44530 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Thu, 30 Jan 2020 20:18:39 -0500 Subject: [PATCH 55/85] [gradle] Reorganize build repositories (#5168) --- modules/openapi-generator-gradle-plugin/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator-gradle-plugin/build.gradle b/modules/openapi-generator-gradle-plugin/build.gradle index d6886b21756..b35ecef3611 100644 --- a/modules/openapi-generator-gradle-plugin/build.gradle +++ b/modules/openapi-generator-gradle-plugin/build.gradle @@ -45,15 +45,15 @@ sourceCompatibility = 1.8 targetCompatibility = 1.8 repositories { - jcenter() - maven { url "https://repo1.maven.org/maven2" } mavenLocal() + maven { url "https://repo1.maven.org/maven2" } maven { url "https://oss.sonatype.org/content/repositories/releases/" } maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } + jcenter() } dependencies { From f0d92bb0c1d2013fe7595d50166873face078e14 Mon Sep 17 00:00:00 2001 From: Alexey Makhrov Date: Thu, 30 Jan 2020 22:56:18 -0800 Subject: [PATCH 56/85] [typescript] Introduce "enumPropertyNaming" option (#5162) * Add enumPropertyNaming option to typescript generators * Regenerate docs * Add Locale.ROOT to toUpperCase() call * Use actual enum values in an error message, instead of hardcoding them * Add tests for "UPPERCASE" and "snake_case" enum var namings * Add LOCALE.ROOT to String#format call --- docs/generators/javascript-flowtyped.md | 1 + docs/generators/typescript-angular.md | 1 + docs/generators/typescript-angularjs.md | 1 + docs/generators/typescript-aurelia.md | 1 + docs/generators/typescript-axios.md | 1 + docs/generators/typescript-fetch.md | 1 + docs/generators/typescript-inversify.md | 1 + docs/generators/typescript-jquery.md | 1 + docs/generators/typescript-node.md | 1 + docs/generators/typescript-redux-query.md | 1 + docs/generators/typescript-rxjs.md | 1 + .../AbstractTypeScriptClientCodegen.java | 51 ++++++++++++++++--- ...ypeScriptAngularClientOptionsProvider.java | 2 + ...eScriptAngularJsClientOptionsProvider.java | 2 + ...ypeScriptAureliaClientOptionsProvider.java | 2 + .../TypeScriptFetchClientOptionsProvider.java | 2 + .../TypeScriptNodeClientOptionsProvider.java | 2 + .../TypeScriptAngularClientCodegenTest.java | 29 ++++++++++- 18 files changed, 94 insertions(+), 7 deletions(-) diff --git a/docs/generators/javascript-flowtyped.md b/docs/generators/javascript-flowtyped.md index 0946f519120..9c354db86bb 100644 --- a/docs/generators/javascript-flowtyped.md +++ b/docs/generators/javascript-flowtyped.md @@ -7,6 +7,7 @@ sidebar_label: javascript-flowtyped | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index cb9160d26ac..5324f24baa6 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -8,6 +8,7 @@ sidebar_label: typescript-angular |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiModulePrefix|The prefix of the generated ApiModule.| |null| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|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| |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| |camelCase| diff --git a/docs/generators/typescript-angularjs.md b/docs/generators/typescript-angularjs.md index 932d469935b..09beb233b1c 100644 --- a/docs/generators/typescript-angularjs.md +++ b/docs/generators/typescript-angularjs.md @@ -7,6 +7,7 @@ sidebar_label: typescript-angularjs | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/typescript-aurelia.md b/docs/generators/typescript-aurelia.md index 6f65c5174f6..8028d707794 100644 --- a/docs/generators/typescript-aurelia.md +++ b/docs/generators/typescript-aurelia.md @@ -7,6 +7,7 @@ sidebar_label: typescript-aurelia | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index 7df54bceb8f..29f419bb838 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -7,6 +7,7 @@ sidebar_label: typescript-axios | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |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 of your private npmRepo in the package.json| |null| diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index 98a52b89d78..c319cec9c19 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -7,6 +7,7 @@ sidebar_label: typescript-fetch | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| diff --git a/docs/generators/typescript-inversify.md b/docs/generators/typescript-inversify.md index c3bf2d710fa..68a4f9c65ae 100644 --- a/docs/generators/typescript-inversify.md +++ b/docs/generators/typescript-inversify.md @@ -7,6 +7,7 @@ sidebar_label: typescript-inversify | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| diff --git a/docs/generators/typescript-jquery.md b/docs/generators/typescript-jquery.md index 07d320ffe87..0ac83747079 100644 --- a/docs/generators/typescript-jquery.md +++ b/docs/generators/typescript-jquery.md @@ -7,6 +7,7 @@ sidebar_label: typescript-jquery | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |jqueryAlreadyImported|When using this in legacy app using mix of typescript and javascript, this will only declare jquery and not import it| |false| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-node.md b/docs/generators/typescript-node.md index 331905fd5c9..b35794784fa 100644 --- a/docs/generators/typescript-node.md +++ b/docs/generators/typescript-node.md @@ -7,6 +7,7 @@ sidebar_label: typescript-node | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| diff --git a/docs/generators/typescript-redux-query.md b/docs/generators/typescript-redux-query.md index 1bdb95c142f..db2f20c3e07 100644 --- a/docs/generators/typescript-redux-query.md +++ b/docs/generators/typescript-redux-query.md @@ -7,6 +7,7 @@ sidebar_label: typescript-redux-query | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| diff --git a/docs/generators/typescript-rxjs.md b/docs/generators/typescript-rxjs.md index 0516372fef8..90c85bbf143 100644 --- a/docs/generators/typescript-rxjs.md +++ b/docs/generators/typescript-rxjs.md @@ -7,6 +7,7 @@ sidebar_label: typescript-rxjs | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index 5c3cd43e5a8..3db985cb8c5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -24,6 +24,7 @@ import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.CodegenConstants.ENUM_PROPERTY_NAMING_TYPE; import org.openapitools.codegen.*; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.utils.ModelUtils; @@ -36,6 +37,7 @@ import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import java.util.stream.Stream; import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.underscore; @@ -54,6 +56,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp protected static final ThreadLocal SNAPSHOT_SUFFIX_FORMAT = ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyyMMddHHmm", Locale.ROOT)); protected String modelPropertyNaming = "camelCase"; + protected ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = ENUM_PROPERTY_NAMING_TYPE.PascalCase; protected Boolean supportsES6 = false; protected HashSet languageGenericTypes; protected String npmName = null; @@ -153,6 +156,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp typeMapping.put("URI", "string"); typeMapping.put("Error", "Error"); + cliOptions.add(new CliOption(CodegenConstants.ENUM_PROPERTY_NAMING, CodegenConstants.ENUM_PROPERTY_NAMING_DESC).defaultValue(this.enumPropertyNaming.name())); cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue(this.modelPropertyNaming)); cliOptions.add(new CliOption(CodegenConstants.SUPPORTS_ES6, CodegenConstants.SUPPORTS_ES6_DESC).defaultValue(String.valueOf(this.getSupportsES6()))); this.cliOptions.add(new CliOption(NPM_NAME, "The name under which you want to publish generated npm package." + @@ -175,6 +179,10 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp LOGGER.info("Warning: Environment variable 'TS_POST_PROCESS_FILE' is set but file post-processing is not enabled. To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); } + if (additionalProperties.containsKey(CodegenConstants.ENUM_PROPERTY_NAMING)) { + setEnumPropertyNaming((String) additionalProperties.get(CodegenConstants.ENUM_PROPERTY_NAMING)); + } + if (additionalProperties.containsKey(CodegenConstants.MODEL_PROPERTY_NAMING)) { setModelPropertyNaming((String) additionalProperties.get(CodegenConstants.MODEL_PROPERTY_NAMING)); } @@ -187,7 +195,6 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp if (additionalProperties.containsKey(NPM_NAME)) { this.setNpmName(additionalProperties.get(NPM_NAME).toString()); } - } @Override @@ -543,12 +550,12 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp @Override public String toEnumVarName(String name, String datatype) { if (name.length() == 0) { - return "Empty"; + return getNameUsingEnumPropertyNaming("empty"); } // for symbol, e.g. $, # if (getSymbolName(name) != null) { - return camelize(getSymbolName(name)); + return getNameUsingEnumPropertyNaming(getSymbolName(name)); } // number @@ -566,9 +573,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp enumName = enumName.replaceFirst("^_", ""); enumName = enumName.replaceFirst("_$", ""); - // camelize the enum variable name - // ref: https://basarat.gitbooks.io/typescript/content/docs/enums.html - enumName = camelize(enumName); + enumName = getNameUsingEnumPropertyNaming(enumName); if (enumName.matches("\\d.*")) { // starts with number return "_" + enumName; @@ -587,6 +592,40 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp } } + protected void setEnumPropertyNaming(String naming) { + try { + enumPropertyNaming = ENUM_PROPERTY_NAMING_TYPE.valueOf(naming); + } catch (IllegalArgumentException e) { + String values = Stream.of(ENUM_PROPERTY_NAMING_TYPE.values()) + .map(value -> "'" + value.name() + "'") + .collect(Collectors.joining(", ")); + + String msg = String.format(Locale.ROOT, "Invalid enum property naming '%s'. Must be one of %s.",naming, values); + throw new IllegalArgumentException(msg); + } + } + + protected ENUM_PROPERTY_NAMING_TYPE getEnumPropertyNaming() { + return enumPropertyNaming; + } + + private String getNameUsingEnumPropertyNaming(String name) { + switch (getEnumPropertyNaming()) { + case original: + return name; + case camelCase: + return camelize(name, true); + case PascalCase: + return camelize(name); + case snake_case: + return underscore(name); + case UPPERCASE: + return name.toUpperCase(Locale.ROOT); + default: + throw new IllegalArgumentException("Unsupported enum property naming: '" + name); + } + } + @Override protected void addImport(CodegenModel m, String type) { if (type == null) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java index 3f2a7fe7305..1aaf04f213f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java @@ -29,6 +29,7 @@ public class TypeScriptAngularClientOptionsProvider implements OptionsProvider { 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"; @@ -54,6 +55,7 @@ public class TypeScriptAngularClientOptionsProvider implements OptionsProvider { 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(TypeScriptAngularClientCodegen.STRING_ENUMS, STRING_ENUMS_VALUE) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java index a683e654f5b..8c6f9efde04 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java @@ -28,6 +28,7 @@ public class TypeScriptAngularJsClientOptionsProvider implements OptionsProvider public static final String SORT_MODEL_PROPERTIES_VALUE = "false"; public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; public static final String MODEL_PROPERTY_NAMING_VALUE = "camelCase"; + public static final String ENUM_PROPERTY_NAMING_VALUE = "PascalCase"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; @@ -43,6 +44,7 @@ public class TypeScriptAngularJsClientOptionsProvider implements OptionsProvider .put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, SORT_MODEL_PROPERTIES_VALUE) .put(CodegenConstants.SUPPORTS_ES6, SUPPORTS_ES6_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.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java index d117acce285..1105fa14a45 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java @@ -28,6 +28,7 @@ public class TypeScriptAureliaClientOptionsProvider implements OptionsProvider { public static final String SORT_MODEL_PROPERTIES_VALUE = "false"; public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; public static final Boolean SUPPORTS_ES6_VALUE = false; + public static final String ENUM_PROPERTY_NAMING_VALUE = "PascalCase"; public static final String MODEL_PROPERTY_NAMING_VALUE = "camelCase"; private static final String NPM_NAME = "npmName"; private static final String NPM_VERSION = "1.0.0"; @@ -45,6 +46,7 @@ public class TypeScriptAureliaClientOptionsProvider implements OptionsProvider { 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, String.valueOf(SUPPORTS_ES6_VALUE)) .put(TypeScriptAureliaClientCodegen.NPM_NAME, NPM_NAME) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java index 4b672179f49..6bf1bb7b082 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java @@ -29,6 +29,7 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider { public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; public static final Boolean SUPPORTS_ES6_VALUE = false; public static final String MODEL_PROPERTY_NAMING_VALUE = "camelCase"; + public static final String ENUM_PROPERTY_NAMING_VALUE = "PascalCase"; private static final String NMP_NAME = "npmName"; private static final String NMP_VERSION = "1.0.0"; private static final String NPM_REPOSITORY = "https://registry.npmjs.org"; @@ -47,6 +48,7 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider { 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, String.valueOf(SUPPORTS_ES6_VALUE)) .put(TypeScriptFetchClientCodegen.NPM_NAME, NMP_NAME) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java index 5e38ada840d..c46fea54e3c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java @@ -30,6 +30,7 @@ public class TypeScriptNodeClientOptionsProvider implements OptionsProvider { public static final String SORT_MODEL_PROPERTIES_VALUE = "false"; public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; public static final String MODEL_PROPERTY_NAMING_VALUE = "camelCase"; + public static final String ENUM_PROPERTY_NAMING_VALUE = "PascalCase"; public static final String NMP_NAME = "npmName"; public static final String NMP_VERSION = "1.1.2"; public static final String NPM_REPOSITORY = "https://registry.npmjs.org"; @@ -49,6 +50,7 @@ public class TypeScriptNodeClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, SORT_MODEL_PROPERTIES_VALUE) .put(CodegenConstants.SUPPORTS_ES6, SUPPORTS_ES6_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(TypeScriptAngularClientCodegen.NPM_NAME, NMP_NAME) .put(TypeScriptAngularClientCodegen.NPM_VERSION, NMP_VERSION) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java index 394ddc72e4e..6a538c69273 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java @@ -8,6 +8,7 @@ import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.responses.ApiResponses; +import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenOperation; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.TypeScriptAngularClientCodegen; @@ -16,6 +17,33 @@ import org.testng.annotations.Test; public class TypeScriptAngularClientCodegenTest { + @Test + public void toEnumVarName() { + TypeScriptAngularClientCodegen codegen = new TypeScriptAngularClientCodegen(); + // unspecified option should default to PascalCase + codegen.processOpts(); + Assert.assertEquals(codegen.toEnumVarName("valid_id", "string"), "ValidId"); + Assert.assertEquals(codegen.toEnumVarName("illegal-id+", "string"), "IllegalId"); + + codegen = new TypeScriptAngularClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.ENUM_PROPERTY_NAMING, CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.original.name()); + codegen.processOpts(); + Assert.assertEquals(codegen.toEnumVarName("valid_id", "string"), "valid_id"); + Assert.assertEquals(codegen.toEnumVarName("illegal-id+", "string"), "illegal_id"); + + codegen = new TypeScriptAngularClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.ENUM_PROPERTY_NAMING, CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.UPPERCASE.name()); + codegen.processOpts(); + Assert.assertEquals(codegen.toEnumVarName("valid_id", "string"), "VALID_ID"); + Assert.assertEquals(codegen.toEnumVarName("illegal-id+", "string"), "ILLEGAL_ID"); + + codegen = new TypeScriptAngularClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.ENUM_PROPERTY_NAMING, CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.snake_case.name()); + codegen.processOpts(); + Assert.assertEquals(codegen.toEnumVarName("valid_ID", "string"), "valid_id"); + Assert.assertEquals(codegen.toEnumVarName("Illegal-Id+", "string"), "illegal_id"); + } + @Test public void testModelSuffix() { TypeScriptAngularClientCodegen codegen = new TypeScriptAngularClientCodegen(); @@ -161,6 +189,5 @@ public class TypeScriptAngularClientCodegenTest { Assert.assertEquals(codegen.toModelImport(modelName), "model/foo-response-links"); Assert.assertEquals(codegen.toModelFilename(modelName), "./foo-response-links"); - } } From 26ace1337d42638e2f3c3727d3438666a6886b31 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 31 Jan 2020 16:24:06 +0800 Subject: [PATCH 57/85] Prepare 4.2.3 release (#5172) * release 4.2.3 * update readme --- README.md | 13 ++++++------- modules/openapi-generator-cli/pom.xml | 2 +- modules/openapi-generator-core/pom.xml | 2 +- modules/openapi-generator-gradle-plugin/README.adoc | 2 +- .../gradle.properties | 2 +- modules/openapi-generator-gradle-plugin/pom.xml | 2 +- .../samples/local-spec/README.md | 2 +- modules/openapi-generator-maven-plugin/README.md | 2 +- .../examples/java-client.xml | 2 +- .../examples/multi-module/java-client/pom.xml | 2 +- .../examples/non-java-invalid-spec.xml | 2 +- .../examples/non-java.xml | 2 +- modules/openapi-generator-maven-plugin/pom.xml | 2 +- modules/openapi-generator-online/pom.xml | 2 +- modules/openapi-generator/pom.xml | 2 +- pom.xml | 2 +- samples/meta-codegen/lib/pom.xml | 2 +- 17 files changed, 22 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 86a0f282887..0b596ea07df 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@
    -[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`4.2.3-SNAPSHOT`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator) +[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`4.2.3`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) [![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=master)](https://app.shippable.com/github/OpenAPITools/openapi-generator) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu) @@ -114,8 +114,7 @@ OpenAPI Generator Version | Release Date | Notes ---------------------------- | ------------ | ----- 5.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.0.0-SNAPSHOT/)| 13.05.2020 | Major release with breaking changes (no fallback) 4.3.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.3.0-SNAPSHOT/)| 29.02.2020 | Minor release (breaking changes with fallbacks) -4.2.3-SNAPSHOT (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.2.3-SNAPSHOT/)| 31.01.2020 | Patch release -[4.2.2](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.2.2) (latest stable release) | 02.12.2019 | Patch release +[4.2.3](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.2.3) (latest stable release) | 31.01.2019 | Patch release OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0 @@ -171,16 +170,16 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository. If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum): -JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.2/openapi-generator-cli-4.2.2.jar` +JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.3/openapi-generator-cli-4.2.3.jar` For **Mac/Linux** users: ```sh -wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.2/openapi-generator-cli-4.2.2.jar -O openapi-generator-cli.jar +wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.3/openapi-generator-cli-4.2.3.jar -O openapi-generator-cli.jar ``` For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. ``` -Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.2/openapi-generator-cli-4.2.2.jar +Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.3/openapi-generator-cli-4.2.3.jar ``` After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage. @@ -428,7 +427,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat (if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php -o c:\temp\php_api_client`) -You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.2/openapi-generator-cli-4.2.2.jar) +You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.3/openapi-generator-cli-4.2.3.jar) To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate` diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index 940242562ec..4ff3511f8d0 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.2.3-SNAPSHOT + 4.2.3 ../.. diff --git a/modules/openapi-generator-core/pom.xml b/modules/openapi-generator-core/pom.xml index c0b948f9849..54e87c5e0e3 100644 --- a/modules/openapi-generator-core/pom.xml +++ b/modules/openapi-generator-core/pom.xml @@ -6,7 +6,7 @@ openapi-generator-project org.openapitools - 4.2.3-SNAPSHOT + 4.2.3 ../.. diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc index 2b613ebfddf..e107d0956f9 100644 --- a/modules/openapi-generator-gradle-plugin/README.adoc +++ b/modules/openapi-generator-gradle-plugin/README.adoc @@ -68,7 +68,7 @@ task validateSpecs(dependsOn: ['validateGoodSpec', 'validateBadSpec']) [source,group] ---- plugins { - id "org.openapi.generator" version "4.2.3-SNAPSHOT" + id "org.openapi.generator" version "4.2.3" } ---- diff --git a/modules/openapi-generator-gradle-plugin/gradle.properties b/modules/openapi-generator-gradle-plugin/gradle.properties index bf9cf796c22..122afc6aa9c 100644 --- a/modules/openapi-generator-gradle-plugin/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/gradle.properties @@ -1,5 +1,5 @@ # RELEASE_VERSION -openApiGeneratorVersion=4.2.3-SNAPSHOT +openApiGeneratorVersion=4.2.3 # /RELEASE_VERSION # BEGIN placeholders diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index 3faf989a6bb..7fd73323e15 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.2.3-SNAPSHOT + 4.2.3 ../.. diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md b/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md index 23270faca3c..c537147edf7 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md @@ -18,5 +18,5 @@ gradle generateGoWithInvalidSpec The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example: ```bash -gradle -PopenApiGeneratorVersion=4.2.3-SNAPSHOT openApiValidate +gradle -PopenApiGeneratorVersion=4.2.3 openApiValidate ``` diff --git a/modules/openapi-generator-maven-plugin/README.md b/modules/openapi-generator-maven-plugin/README.md index fd6c8e25ca9..9714ace95f9 100644 --- a/modules/openapi-generator-maven-plugin/README.md +++ b/modules/openapi-generator-maven-plugin/README.md @@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase) org.openapitools openapi-generator-maven-plugin - 4.2.3-SNAPSHOT + 4.2.3 diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml index bc5e8d7f3b2..b2af9a9693c 100644 --- a/modules/openapi-generator-maven-plugin/examples/java-client.xml +++ b/modules/openapi-generator-maven-plugin/examples/java-client.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 4.2.3-SNAPSHOT + 4.2.3 diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml index 643bf333ddf..b2411ecc54b 100644 --- a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml @@ -19,7 +19,7 @@ org.openapitools openapi-generator-maven-plugin - 4.2.3-SNAPSHOT + 4.2.3 diff --git a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml index e05fd2eef0b..bfea21b8f87 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 4.2.3-SNAPSHOT + 4.2.3 diff --git a/modules/openapi-generator-maven-plugin/examples/non-java.xml b/modules/openapi-generator-maven-plugin/examples/non-java.xml index 469d1eb1c78..e41f65451bf 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 4.2.3-SNAPSHOT + 4.2.3 diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml index 84844cc99c1..a2d8c2e5140 100644 --- a/modules/openapi-generator-maven-plugin/pom.xml +++ b/modules/openapi-generator-maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.openapitools openapi-generator-project - 4.2.3-SNAPSHOT + 4.2.3 ../.. diff --git a/modules/openapi-generator-online/pom.xml b/modules/openapi-generator-online/pom.xml index bba07959468..3db077364e4 100644 --- a/modules/openapi-generator-online/pom.xml +++ b/modules/openapi-generator-online/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.2.3-SNAPSHOT + 4.2.3 ../.. diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index dea98573b94..d46aa9a7ec5 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.2.3-SNAPSHOT + 4.2.3 ../.. diff --git a/pom.xml b/pom.xml index 721f86d042c..ae0add21af0 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ pom openapi-generator-project - 4.2.3-SNAPSHOT + 4.2.3 https://github.com/openapitools/openapi-generator diff --git a/samples/meta-codegen/lib/pom.xml b/samples/meta-codegen/lib/pom.xml index ae44d802a0e..96e112315c9 100644 --- a/samples/meta-codegen/lib/pom.xml +++ b/samples/meta-codegen/lib/pom.xml @@ -121,7 +121,7 @@ UTF-8 - 4.2.3-SNAPSHOT + 4.2.3 1.0.0 4.8.1 From e90b1817b56856884197cc91c688659be9add6e1 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 31 Jan 2020 19:01:44 +0800 Subject: [PATCH 58/85] update readme --- README.md | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 0b596ea07df..9246e7ca297 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,13 @@
    -[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`4.2.3`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator) +[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`4.3.0`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) [![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=master)](https://app.shippable.com/github/OpenAPITools/openapi-generator) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu) [![JDK11 Build](https://cloud.drone.io/api/badges/OpenAPITools/openapi-generator/status.svg?ref=refs/heads/master)](https://cloud.drone.io/OpenAPITools/openapi-generator) [![iOS Build Status](https://app.bitrise.io/app/4a2b10a819d12b67/status.svg?token=859FMDR8QHwabCzwvZK6vQ&branch=master)](https://app.bitrise.io/app/4a2b10a819d12b67) -[`4.3.x`](https://github.com/OpenAPITools/openapi-generator/tree/4.3.x) branch: [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/4.3.x.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator) -[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/4.3.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) -[![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=4.3.x)](https://app.shippable.com/github/OpenAPITools/openapi-generator) -[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=4.3.x&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu) -[![JDK11 Build](https://cloud.drone.io/api/badges/OpenAPITools/openapi-generator/status.svg?ref=refs/heads/4.3.x)](https://cloud.drone.io/OpenAPITools/openapi-generator) -[![iOS Build Status](https://app.bitrise.io/app/4a2b10a819d12b67/status.svg?token=859FMDR8QHwabCzwvZK6vQ&branch=4.3.x)](https://app.bitrise.io/app/4a2b10a819d12b67) - [`5.0.x`](https://github.com/OpenAPITools/openapi-generator/tree/5.0.x) branch: [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/5.0.x.svg?label=Integration%20Test)](https://travis-ci.org/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/5.0.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) [![Run Status](https://api.shippable.com/projects/5af6bf74e790f4070084a115/badge?branch=5.0.x)](https://app.shippable.com/github/OpenAPITools/openapi-generator) @@ -114,7 +107,7 @@ OpenAPI Generator Version | Release Date | Notes ---------------------------- | ------------ | ----- 5.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.0.0-SNAPSHOT/)| 13.05.2020 | Major release with breaking changes (no fallback) 4.3.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.3.0-SNAPSHOT/)| 29.02.2020 | Minor release (breaking changes with fallbacks) -[4.2.3](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.2.3) (latest stable release) | 31.01.2019 | Patch release +[4.2.3](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.2.3) (latest stable release) | 31.01.2019 | Backward-compatible release OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0 From 92739a967aba0e2d20d68464d54f7c9684c0a08c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 31 Jan 2020 19:16:03 +0800 Subject: [PATCH 59/85] update samples --- .../go-experimental/go-petstore/.openapi-generator/VERSION | 2 +- .../petstore/python-experimental/.openapi-generator/VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION b/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION index 58592f031f6..bfbf77eb7fa 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.3-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION index 58592f031f6..bfbf77eb7fa 100644 --- a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.3-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file From e32a2f012135c394a128051c2e220fd3b9b2936c Mon Sep 17 00:00:00 2001 From: Alexey Makhrov Date: Fri, 31 Jan 2020 03:17:22 -0800 Subject: [PATCH 60/85] [typescript] Append enum suffix without model suffix (#5138) * [typescript] Generate enum name independently on model name, ignoring modelSuffix * Add `enumSufix` cli option for all typescript generators * Add ENUM_NAME_SUFFIX to to TypeScript***ClientOptionsProvider * Add a typeMapping for OAS2 built-in "file" type * Re-generate samples * Introduce `v4-compat` mode for enumNamePrefix * Update TypeScriptFetchModelTest - make sure codegen options are processed before running assertions * Regenerate samples * Regenerate docs * Regenerate docs --- docs/generators/javascript-flowtyped.md | 1 + docs/generators/typescript-angular.md | 1 + docs/generators/typescript-angularjs.md | 1 + docs/generators/typescript-aurelia.md | 1 + docs/generators/typescript-axios.md | 1 + docs/generators/typescript-fetch.md | 1 + docs/generators/typescript-inversify.md | 1 + docs/generators/typescript-jquery.md | 1 + docs/generators/typescript-node.md | 1 + docs/generators/typescript-redux-query.md | 1 + docs/generators/typescript-rxjs.md | 1 + .../AbstractTypeScriptClientCodegen.java | 69 +++++++++++++------ .../TypeScriptAngularClientCodegen.java | 23 +++++-- ...ypeScriptAngularClientOptionsProvider.java | 2 + ...eScriptAngularJsClientOptionsProvider.java | 2 + ...ypeScriptAureliaClientOptionsProvider.java | 2 + .../TypeScriptFetchClientOptionsProvider.java | 2 + .../TypeScriptNodeClientOptionsProvider.java | 2 + .../fetch/TypeScriptFetchModelTest.java | 2 + .../TypeScriptAngularClientCodegenTest.java | 52 ++++++++++++++ 20 files changed, 142 insertions(+), 25 deletions(-) diff --git a/docs/generators/javascript-flowtyped.md b/docs/generators/javascript-flowtyped.md index 9c354db86bb..8cf943fa317 100644 --- a/docs/generators/javascript-flowtyped.md +++ b/docs/generators/javascript-flowtyped.md @@ -7,6 +7,7 @@ sidebar_label: javascript-flowtyped | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |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. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index 5324f24baa6..13c700448a0 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -8,6 +8,7 @@ sidebar_label: typescript-angular |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiModulePrefix|The prefix of the generated ApiModule.| |null| |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. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |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| |modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null| diff --git a/docs/generators/typescript-angularjs.md b/docs/generators/typescript-angularjs.md index 09beb233b1c..ac3aaf63d60 100644 --- a/docs/generators/typescript-angularjs.md +++ b/docs/generators/typescript-angularjs.md @@ -7,6 +7,7 @@ sidebar_label: typescript-angularjs | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |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. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/typescript-aurelia.md b/docs/generators/typescript-aurelia.md index 8028d707794..7f934105a89 100644 --- a/docs/generators/typescript-aurelia.md +++ b/docs/generators/typescript-aurelia.md @@ -7,6 +7,7 @@ sidebar_label: typescript-aurelia | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |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. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index 29f419bb838..f34971518b6 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -7,6 +7,7 @@ sidebar_label: typescript-axios | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |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. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index c319cec9c19..695c85c033e 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -7,6 +7,7 @@ sidebar_label: typescript-fetch | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |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. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-inversify.md b/docs/generators/typescript-inversify.md index 68a4f9c65ae..62170b6117c 100644 --- a/docs/generators/typescript-inversify.md +++ b/docs/generators/typescript-inversify.md @@ -7,6 +7,7 @@ sidebar_label: typescript-inversify | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |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. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-jquery.md b/docs/generators/typescript-jquery.md index 0ac83747079..8a00cf0d97b 100644 --- a/docs/generators/typescript-jquery.md +++ b/docs/generators/typescript-jquery.md @@ -7,6 +7,7 @@ sidebar_label: typescript-jquery | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |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. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |jqueryAlreadyImported|When using this in legacy app using mix of typescript and javascript, this will only declare jquery and not import it| |false| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/typescript-node.md b/docs/generators/typescript-node.md index b35794784fa..7baeb924014 100644 --- a/docs/generators/typescript-node.md +++ b/docs/generators/typescript-node.md @@ -7,6 +7,7 @@ sidebar_label: typescript-node | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |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. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-redux-query.md b/docs/generators/typescript-redux-query.md index db2f20c3e07..e888c68f49f 100644 --- a/docs/generators/typescript-redux-query.md +++ b/docs/generators/typescript-redux-query.md @@ -7,6 +7,7 @@ sidebar_label: typescript-redux-query | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |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. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-rxjs.md b/docs/generators/typescript-rxjs.md index 90c85bbf143..41811e3d1ff 100644 --- a/docs/generators/typescript-rxjs.md +++ b/docs/generators/typescript-rxjs.md @@ -7,6 +7,7 @@ sidebar_label: typescript-rxjs | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |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. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index 3db985cb8c5..75a7c18c783 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -51,6 +51,11 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp public static final String NPM_VERSION = "npmVersion"; public static final String SNAPSHOT = "snapshot"; + public static final String ENUM_NAME_SUFFIX_V4_COMPAT = "v4-compat"; + public static final String ENUM_NAME_SUFFIX_DESC_CUSTOMIZED = CodegenConstants.ENUM_NAME_SUFFIX_DESC + + " A special '" + ENUM_NAME_SUFFIX_V4_COMPAT + "' value enables the backward-compatible behavior (as pre v4.2.3)"; + + // NOTE: SimpleDateFormat is not thread-safe and may not be static unless it is thread-local @SuppressWarnings("squid:S5164") protected static final ThreadLocal SNAPSHOT_SUFFIX_FORMAT = ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyyMMddHHmm", Locale.ROOT)); @@ -62,7 +67,9 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp protected String npmName = null; protected String npmVersion = "1.0.0"; - protected String enumSuffix = "Enum"; + protected String enumSuffix = ENUM_NAME_SUFFIX_V4_COMPAT; + protected Boolean isEnumSuffixV4Compat = false; + protected String classEnumSeparator = "."; public AbstractTypeScriptClientCodegen() { @@ -151,11 +158,13 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp typeMapping.put("DateTime", "Date"); typeMapping.put("binary", "any"); typeMapping.put("File", "any"); + typeMapping.put("file", "any"); typeMapping.put("ByteArray", "string"); typeMapping.put("UUID", "string"); typeMapping.put("URI", "string"); typeMapping.put("Error", "Error"); + cliOptions.add(new CliOption(CodegenConstants.ENUM_NAME_SUFFIX, ENUM_NAME_SUFFIX_DESC_CUSTOMIZED).defaultValue(this.enumSuffix)); cliOptions.add(new CliOption(CodegenConstants.ENUM_PROPERTY_NAMING, CodegenConstants.ENUM_PROPERTY_NAMING_DESC).defaultValue(this.enumPropertyNaming.name())); cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue(this.modelPropertyNaming)); cliOptions.add(new CliOption(CodegenConstants.SUPPORTS_ES6, CodegenConstants.SUPPORTS_ES6_DESC).defaultValue(String.valueOf(this.getSupportsES6()))); @@ -179,6 +188,9 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp LOGGER.info("Warning: Environment variable 'TS_POST_PROCESS_FILE' is set but file post-processing is not enabled. To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); } + if (additionalProperties.containsKey(CodegenConstants.ENUM_NAME_SUFFIX)) { + enumSuffix = additionalProperties.get(CodegenConstants.ENUM_NAME_SUFFIX).toString(); + } if (additionalProperties.containsKey(CodegenConstants.ENUM_PROPERTY_NAMING)) { setEnumPropertyNaming((String) additionalProperties.get(CodegenConstants.ENUM_PROPERTY_NAMING)); } @@ -195,6 +207,11 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp if (additionalProperties.containsKey(NPM_NAME)) { this.setNpmName(additionalProperties.get(NPM_NAME).toString()); } + + if (enumSuffix.equals(ENUM_NAME_SUFFIX_V4_COMPAT)) { + isEnumSuffixV4Compat = true; + enumSuffix = modelNameSuffix + "Enum"; + } } @Override @@ -298,40 +315,55 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp @Override public String toModelName(final String name) { + String fullModelName = name; + fullModelName = addPrefix(fullModelName, modelNamePrefix); + fullModelName = addSuffix(fullModelName, modelNameSuffix); + return toTypescriptTypeName(fullModelName, "Model"); + } + + protected String addPrefix(String name, String prefix) { + if (!StringUtils.isEmpty(prefix)) { + name = prefix + "_" + name; + } + return name; + } + + protected String addSuffix(String name, String suffix) { + if (!StringUtils.isEmpty(suffix)) { + name = name + "_" + suffix; + } + + return name; + } + + protected String toTypescriptTypeName(final String name, String safePrefix) { ArrayList exceptions = new ArrayList(Arrays.asList("\\|", " ")); String sanName = sanitizeName(name, "(?![| ])\\W", exceptions); - if (!StringUtils.isEmpty(modelNamePrefix)) { - sanName = modelNamePrefix + "_" + sanName; - } - - if (!StringUtils.isEmpty(modelNameSuffix)) { - sanName = sanName + "_" + modelNameSuffix; - } + sanName = camelize(sanName); // model name cannot use reserved keyword, e.g. return + // this is unlikely to happen, because we have just camelized the name, while reserved words are usually all lowcase if (isReservedWord(sanName)) { - String modelName = camelize("model_" + sanName); + String modelName = safePrefix + sanName; LOGGER.warn(sanName + " (reserved word) cannot be used as model name. Renamed to " + modelName); return modelName; } // model name starts with number if (sanName.matches("^\\d.*")) { - String modelName = camelize("model_" + sanName); // e.g. 200Response => Model200Response (after camelize) + String modelName = safePrefix + sanName; // e.g. 200Response => Model200Response LOGGER.warn(sanName + " (model name starts with number) cannot be used as model name. Renamed to " + modelName); return modelName; } if (languageSpecificPrimitives.contains(sanName)) { - String modelName = camelize("model_" + sanName); + String modelName = safePrefix + sanName; LOGGER.warn(sanName + " (model name matches existing language type) cannot be used as a model name. Renamed to " + modelName); return modelName; } - // camelize the model name - // phone_number => PhoneNumber - return camelize(sanName); + return sanName; } @Override @@ -584,12 +616,9 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp @Override public String toEnumName(CodegenProperty property) { - String enumName = toModelName(property.name) + enumSuffix; - if (enumName.matches("\\d.*")) { // starts with number - return "_" + enumName; - } else { - return enumName; - } + String enumName = property.name; + enumName = addSuffix(enumName, enumSuffix); + return toTypescriptTypeName(enumName, "_"); } protected void setEnumPropertyNaming(String naming) { 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 fc0f886c1df..bbf91dbd9b4 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 @@ -160,7 +160,6 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode setStringEnums(Boolean.valueOf(additionalProperties.get(STRING_ENUMS).toString())); additionalProperties.put("stringEnums", getStringEnums()); if (getStringEnums()) { - enumSuffix = ""; classEnumSeparator = ""; } } @@ -228,6 +227,23 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode if (additionalProperties.containsKey(FILE_NAMING)) { this.setFileNaming(additionalProperties.get(FILE_NAMING).toString()); } + + if (isEnumSuffixV4Compat) { + applyEnumSuffixV4CompatMode(); + } + } + + private void applyEnumSuffixV4CompatMode() { + String fullModelSuffix = modelSuffix + modelNameSuffix; + if (stringEnums) { + // with stringEnums, legacy code would discard "Enum" suffix altogether + // resulting in smth like PetModelTypeModeL + enumSuffix = fullModelSuffix; + } else { + // without stringEnums, "Enum" was appended to model suffix, e.g. PetModel.TypeModelEnum + enumSuffix = fullModelSuffix + "Enum"; + } + } private void addNpmPackageGeneration(SemVer ngVersion) { @@ -605,10 +621,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode @Override public String toModelName(String name) { - if (modelSuffix.length() != 0 && !name.endsWith(modelSuffix)) { - name = name + modelSuffix; - } - + name = addSuffix(name, modelSuffix); return super.toModelName(name); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java index 1aaf04f213f..d65ba459df6 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java @@ -25,6 +25,7 @@ import java.util.Map; public class TypeScriptAngularClientOptionsProvider implements OptionsProvider { public static final String SUPPORTS_ES6_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"; @@ -58,6 +59,7 @@ public class TypeScriptAngularClientOptionsProvider implements OptionsProvider { .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(CodegenConstants.ENUM_NAME_SUFFIX, ENUM_NAME_SUFFIX) .put(TypeScriptAngularClientCodegen.STRING_ENUMS, STRING_ENUMS_VALUE) .put(TypeScriptAngularClientCodegen.NPM_NAME, NMP_NAME) .put(TypeScriptAngularClientCodegen.NPM_VERSION, NMP_VERSION) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java index 8c6f9efde04..11aa70a681a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java @@ -24,6 +24,7 @@ import java.util.Map; public class TypeScriptAngularJsClientOptionsProvider implements OptionsProvider { public static final String SUPPORTS_ES6_VALUE = "false"; + public static final String ENUM_NAME_SUFFIX = "Enum"; 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"; @@ -43,6 +44,7 @@ public class TypeScriptAngularJsClientOptionsProvider implements OptionsProvider 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.SUPPORTS_ES6, SUPPORTS_ES6_VALUE) + .put(CodegenConstants.ENUM_NAME_SUFFIX, ENUM_NAME_SUFFIX) .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) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java index 1105fa14a45..2ec182979cc 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java @@ -28,6 +28,7 @@ public class TypeScriptAureliaClientOptionsProvider implements OptionsProvider { public static final String SORT_MODEL_PROPERTIES_VALUE = "false"; public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; public static final Boolean SUPPORTS_ES6_VALUE = false; + public static final String ENUM_NAME_SUFFIX = "Enum"; public static final String ENUM_PROPERTY_NAMING_VALUE = "PascalCase"; public static final String MODEL_PROPERTY_NAMING_VALUE = "camelCase"; private static final String NPM_NAME = "npmName"; @@ -49,6 +50,7 @@ public class TypeScriptAureliaClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.ENUM_PROPERTY_NAMING, ENUM_PROPERTY_NAMING_VALUE) .put(CodegenConstants.MODEL_PROPERTY_NAMING, MODEL_PROPERTY_NAMING_VALUE) .put(CodegenConstants.SUPPORTS_ES6, String.valueOf(SUPPORTS_ES6_VALUE)) + .put(CodegenConstants.ENUM_NAME_SUFFIX, ENUM_NAME_SUFFIX) .put(TypeScriptAureliaClientCodegen.NPM_NAME, NPM_NAME) .put(TypeScriptAureliaClientCodegen.NPM_VERSION, NPM_VERSION) .put(TypeScriptAureliaClientCodegen.SNAPSHOT, Boolean.FALSE.toString()) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java index 6bf1bb7b082..fe637cfe52b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java @@ -28,6 +28,7 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider { public static final String SORT_MODEL_PROPERTIES_VALUE = "false"; public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; public static final Boolean SUPPORTS_ES6_VALUE = false; + public static final String ENUM_NAME_SUFFIX = "Enum"; public static final String MODEL_PROPERTY_NAMING_VALUE = "camelCase"; public static final String ENUM_PROPERTY_NAMING_VALUE = "PascalCase"; private static final String NMP_NAME = "npmName"; @@ -51,6 +52,7 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.ENUM_PROPERTY_NAMING, ENUM_PROPERTY_NAMING_VALUE) .put(CodegenConstants.MODEL_PROPERTY_NAMING, MODEL_PROPERTY_NAMING_VALUE) .put(CodegenConstants.SUPPORTS_ES6, String.valueOf(SUPPORTS_ES6_VALUE)) + .put(CodegenConstants.ENUM_NAME_SUFFIX, ENUM_NAME_SUFFIX) .put(TypeScriptFetchClientCodegen.NPM_NAME, NMP_NAME) .put(TypeScriptFetchClientCodegen.NPM_VERSION, NMP_VERSION) .put(TypeScriptFetchClientCodegen.NPM_REPOSITORY, NPM_REPOSITORY) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java index c46fea54e3c..a369f1a2f56 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java @@ -26,6 +26,7 @@ import java.util.Map; public class TypeScriptNodeClientOptionsProvider implements OptionsProvider { public static final String SUPPORTS_ES6_VALUE = "false"; + public static final String ENUM_NAME_SUFFIX = "Enum"; 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"; @@ -49,6 +50,7 @@ public class TypeScriptNodeClientOptionsProvider implements OptionsProvider { 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.SUPPORTS_ES6, SUPPORTS_ES6_VALUE) + .put(CodegenConstants.ENUM_NAME_SUFFIX, ENUM_NAME_SUFFIX) .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) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java index 58b8848a6f0..ec451b308d3 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchModelTest.java @@ -227,6 +227,7 @@ public class TypeScriptFetchModelTest { // TODO: update yaml file. final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml"); final DefaultCodegen codegen = new TypeScriptFetchClientCodegen(); + codegen.processOpts(); codegen.setOpenAPI(openAPI); final Schema schema = openAPI.getComponents().getSchemas().get("EnumArrays"); @@ -264,6 +265,7 @@ public class TypeScriptFetchModelTest { public void enumMdoelValueTest() { final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml"); final DefaultCodegen codegen = new TypeScriptFetchClientCodegen(); + codegen.processOpts(); codegen.setOpenAPI(openAPI); final Schema schema = openAPI.getComponents().getSchemas().get("Enum_Test"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java index 6a538c69273..a1a07d28aa6 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java @@ -10,6 +10,7 @@ import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.responses.ApiResponses; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.TypeScriptAngularClientCodegen; import org.testng.Assert; @@ -54,6 +55,57 @@ public class TypeScriptAngularClientCodegenTest { Assert.assertEquals(codegen.toModelName("Error"), "ErrorMySuffix"); } + @Test + public void testToEnumName() { + TypeScriptAngularClientCodegen codegen = new TypeScriptAngularClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.ENUM_NAME_SUFFIX, "Enum"); + codegen.processOpts(); + + Assert.assertEquals(codegen.toEnumName(makeEnumProperty("TestName")), "TestNameEnum"); + Assert.assertEquals(codegen.toEnumName(makeEnumProperty("123")), "_123Enum"); + + // enum value should not use model suffix + codegen = new TypeScriptAngularClientCodegen(); + codegen.additionalProperties().put(TypeScriptAngularClientCodegen.MODEL_SUFFIX, "Model"); + codegen.additionalProperties().put(CodegenConstants.ENUM_NAME_SUFFIX, "Enum2"); + codegen.processOpts(); + Assert.assertEquals(codegen.toEnumName(makeEnumProperty("TestName")), "TestNameEnum2"); + + codegen = new TypeScriptAngularClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.ENUM_NAME_SUFFIX, ""); + codegen.processOpts(); + Assert.assertEquals(codegen.toEnumName(makeEnumProperty("TestName")), "TestName"); + } + + @Test + public void testToEnumNameCompatMode() { + TypeScriptAngularClientCodegen codegen = new TypeScriptAngularClientCodegen(); + // default - stringEnums=false + codegen.processOpts(); + + Assert.assertEquals(codegen.toEnumName(makeEnumProperty("TestName")), "TestNameEnum"); + + // model suffix is prepended to "Enum" suffix + codegen = new TypeScriptAngularClientCodegen(); + codegen.additionalProperties().put(CodegenConstants.MODEL_NAME_SUFFIX, "Model1"); + codegen.additionalProperties().put(TypeScriptAngularClientCodegen.MODEL_SUFFIX, "Model2"); + codegen.processOpts(); + Assert.assertEquals(codegen.toEnumName(makeEnumProperty("TestName")), "TestNameModel2Model1Enum"); + + codegen = new TypeScriptAngularClientCodegen(); + codegen.additionalProperties().put(TypeScriptAngularClientCodegen.STRING_ENUMS, true); + codegen.additionalProperties().put(CodegenConstants.MODEL_NAME_SUFFIX, "Model1"); + codegen.additionalProperties().put(TypeScriptAngularClientCodegen.MODEL_SUFFIX, "Model2"); + codegen.processOpts(); + Assert.assertEquals(codegen.toEnumName(makeEnumProperty("TestName")), "TestNameModel2Model1"); + } + + private CodegenProperty makeEnumProperty(String name) { + CodegenProperty enumProperty = new CodegenProperty(); + enumProperty.name = name; + return enumProperty; + } + @Test public void testModelFileSuffix() { TypeScriptAngularClientCodegen codegen = new TypeScriptAngularClientCodegen(); From f06ac9d91c19b93d488803ed09959560a871deb8 Mon Sep 17 00:00:00 2001 From: "Yutaka.Miyamae" <48900426+yutaka0m@users.noreply.github.com> Date: Fri, 31 Jan 2020 22:57:15 +0900 Subject: [PATCH 61/85] Add a link to a ytaka0m blog post (#5176) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9246e7ca297..25441aa85e0 100644 --- a/README.md +++ b/README.md @@ -722,6 +722,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2020-01-17 - [OpenAPI demo for Pulp 3.0 GA](https://www.youtube.com/watch?v=mFBP-M0ZPfw&t=178s) by [Pulp](https://www.youtube.com/channel/UCI43Ffs4VPDv7awXvvBJfRQ) at [Youtube](https://www.youtube.com/) - 2020-01-19 - [Why document a REST API as code?](https://dev.to/rolfstreefkerk/why-document-a-rest-api-as-code-5e7p) by [Rolf Streefkerk](https://github.com/rpstreef) at [DEV Community](https://dev.to) - 2020-01-28 - [Get Your Serverless Swagger Back with OpenAPI](https://dev.to/matttyler/get-your-serverless-swagger-back-with-openapi-48gc) by [Matt Tyler](https://dev.to/matttyler) +- 2020-01-30 - [OpenAPI Generatorへのコントリビュート](https://www.yutaka0m.work/entry/2020/01/30/163905) by [yutaka0m](https://github.com/yutaka0m) - ## [6 - About Us](#table-of-contents) From 22c6c0ca68aee25ca7923f7eff85079f9dc08376 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Fri, 31 Jan 2020 12:19:16 -0500 Subject: [PATCH 62/85] [core] Extracting recommendations to validation framework (#4979) * [core] Extracting recommendations to validation framework This is work to extract recommendation logic out of the CLI validate command into a shared evaluation instance which can be used elsewhere (such as Gradle, or the Online tool). For now, these validations are in addition to those provided by swagger-parser and are only the following recommendations: * Apache/Nginx warning that header values with underscore are dropped by default * Unused models/schemas * Use of properties with oneOf, which is ambiguous in OpenAPI Specification I've allowed for disabling recommendations via System properties, since this is something that has been requested a few times by users. System properties in this commit include: * openapi.generator.rule.recommendations=false - Allows for disabling recommendations completely. This wouldn't include all warnings and errors, only those we deem to be suggestions * openapi.generator.rule.apache-nginx-underscore=false - Allows for disabling the Apache/Nginx warning when header names have underscore - This is a legacy CGI configuration, and doesn't affect all web servers * openapi.generator.rule.oneof-properties-ambiguity=false - We support this functionality, but the specification may not intend for it - This is more to reduce noise * openapi.generator.rule.unused-schemas=false - We will warn when a schema is not referenced outside of Components, which users have requested to be able to turn off * openapi.generator.rule.anti-patterns.uri-unexpected-body=false * Move recommendation/validations to oas package and add javadoc comments * Refactor and test recommendation validations * Refactor validation function signatures to return explicit state rather than boolean * Add operation recommendation for GET/HEAD w/body --- .../openapitools/codegen/cmd/Validate.java | 44 ++---- .../codegen/validation/GenericValidator.java | 9 +- .../codegen/validation/Invalid.java | 21 ++- .../codegen/validation/Validated.java | 12 ++ .../codegen/validation/ValidationResult.java | 10 +- .../codegen/validation/ValidationRule.java | 85 +++++++++-- .../validation/GenericValidatorTest.java | 32 ++-- .../validation/ValidationRuleTest.java | 22 +-- .../validations/oas/OpenApiEvaluator.java | 94 ++++++++++++ .../oas/OpenApiOperationValidations.java | 75 ++++++++++ .../oas/OpenApiParameterValidations.java | 47 ++++++ .../oas/OpenApiSchemaValidations.java | 57 ++++++++ .../oas/OpenApiSecuritySchemeValidations.java | 47 ++++++ .../validations/oas/OperationWrapper.java | 42 ++++++ .../validations/oas/RuleConfiguration.java | 137 ++++++++++++++++++ .../validations/oas/ValidationConstants.java | 6 + .../oas/OpenApiOperationValidationsTest.java | 116 +++++++++++++++ .../oas/OpenApiParameterValidationsTest.java | 93 ++++++++++++ .../oas/OpenApiSchemaValidationsTest.java | 128 ++++++++++++++++ .../OpenApiSecuritySchemeValidationsTest.java | 87 +++++++++++ 20 files changed, 1089 insertions(+), 75 deletions(-) create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiEvaluator.java create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiOperationValidations.java create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiParameterValidations.java create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidations.java create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSecuritySchemeValidations.java create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OperationWrapper.java create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/RuleConfiguration.java create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/ValidationConstants.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiOperationValidationsTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiParameterValidationsTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidationsTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiSecuritySchemeValidationsTest.java diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Validate.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Validate.java index 153475f5032..a790464c781 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Validate.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Validate.java @@ -22,14 +22,14 @@ import io.airlift.airline.Option; import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.ComposedSchema; -import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.parser.core.models.SwaggerParseResult; -import org.openapitools.codegen.utils.ModelUtils; +import org.apache.commons.lang3.text.WordUtils; +import org.openapitools.codegen.validation.ValidationResult; +import org.openapitools.codegen.validations.oas.OpenApiEvaluator; +import org.openapitools.codegen.validations.oas.RuleConfiguration; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Set; @Command(name = "validate", description = "Validate specification") @@ -54,42 +54,28 @@ public class Validate implements Runnable { StringBuilder sb = new StringBuilder(); OpenAPI specification = result.getOpenAPI(); - if (Boolean.TRUE.equals(recommend)) { - if (specification != null) { - // Add information about unused models to the warnings set. - List unusedModels = ModelUtils.getUnusedSchemas(specification); - if (unusedModels != null) { - unusedModels.forEach(name -> warnings.add("Unused model: " + name)); - } + RuleConfiguration ruleConfiguration = new RuleConfiguration(); + ruleConfiguration.setEnableRecommendations(recommend != null ? recommend : false); - // check for loosely defined oneOf extension requirements. - // This is a recommendation because the 3.0.x spec is not clear enough on usage of oneOf. - // see https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.9.2.1.3 and the OAS section on 'Composition and Inheritance'. - Map schemas = ModelUtils.getSchemas(specification); - schemas.forEach((key, schema) -> { - if (schema instanceof ComposedSchema) { - final ComposedSchema composed = (ComposedSchema) schema; - if (composed.getOneOf() != null && composed.getOneOf().size() > 0) { - if (composed.getProperties() != null && composed.getProperties().size() >= 1 && composed.getProperties().get("discriminator") == null) { - warnings.add("Schema (oneOf) should not contain properties: " + key); - } - } - } - }); - } - } + OpenApiEvaluator evaluator = new OpenApiEvaluator(ruleConfiguration); + ValidationResult validationResult = evaluator.validate(specification); + + // TODO: We could also provide description here along with getMessage. getMessage is either a "generic" message or specific (e.g. Model 'Cat' has issues). + // This would require that we parse the messageList coming from swagger-parser into a better structure. + validationResult.getWarnings().forEach(invalid -> warnings.add(invalid.getMessage())); + validationResult.getErrors().forEach(invalid -> errors.add(invalid.getMessage())); if (!errors.isEmpty()) { sb.append("Errors:").append(System.lineSeparator()); errors.forEach(msg -> - sb.append("\t-").append(msg).append(System.lineSeparator()) + sb.append("\t- ").append(WordUtils.wrap(msg, 90).replace(System.lineSeparator(), System.lineSeparator() + "\t ")).append(System.lineSeparator()) ); } if (!warnings.isEmpty()) { sb.append("Warnings: ").append(System.lineSeparator()); warnings.forEach(msg -> - sb.append("\t-").append(msg).append(System.lineSeparator()) + sb.append("\t- ").append(WordUtils.wrap(msg, 90).replace(System.lineSeparator(), System.lineSeparator() + "\t ")).append(System.lineSeparator()) ); } diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/GenericValidator.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/GenericValidator.java index c095bc5abd5..00e4e00e463 100644 --- a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/GenericValidator.java +++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/GenericValidator.java @@ -23,9 +23,8 @@ import java.util.List; * * @param The type of object being evaluated. */ -@SuppressWarnings({"WeakerAccess"}) public class GenericValidator implements Validator { - private List rules; + protected List rules; /** * Constructs a new instance of {@link GenericValidator}. @@ -48,11 +47,11 @@ public class GenericValidator implements Validator { ValidationResult result = new ValidationResult(); if (rules != null) { rules.forEach(it -> { - boolean passes = it.evaluate(input); - if (passes) { + ValidationRule.Result attempt = it.evaluate(input); + if (attempt.passed()) { result.addResult(Validated.valid(it)); } else { - result.addResult(Validated.invalid(it, it.getFailureMessage())); + result.addResult(Validated.invalid(it, it.getFailureMessage(), attempt.getDetails())); } }); } diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/Invalid.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/Invalid.java index ad59a628536..131e7a73465 100644 --- a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/Invalid.java +++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/Invalid.java @@ -23,6 +23,7 @@ package org.openapitools.codegen.validation; public final class Invalid extends Validated { private String message; private ValidationRule rule; + private String details; /** * Constructs a new {@link Invalid} instance. @@ -35,13 +36,29 @@ public final class Invalid extends Validated { this.message = message; } + /** + * Constructs a new {@link Invalid} instance. + * + * @param rule The rule which was evaluated and resulted in this state. + * @param message The message to be displayed for this invalid state. + * @param details Additional contextual details related to the invalid state. + */ + public Invalid(ValidationRule rule, String message, String details) { + this(rule, message); + this.details = details; + } + + public String getDetails() { + return details; + } + @Override - String getMessage() { + public String getMessage() { return message; } @Override - ValidationRule getRule() { + public ValidationRule getRule() { return rule; } diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/Validated.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/Validated.java index 2df3b9c3ae3..05f9df833e4 100644 --- a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/Validated.java +++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/Validated.java @@ -54,6 +54,18 @@ public abstract class Validated { public static Validated invalid(ValidationRule rule, String message) { return new Invalid(rule, message); } + /** + * Creates an instance of an {@link Invalid} validation state. + * + * @param rule The rule which was evaluated. + * @param message The message to display to a user. + * @param details Additional contextual details related to the invalid state. + * + * @return A {@link Validated} instance representing an invalid state according to the rule. + */ + public static Validated invalid(ValidationRule rule, String message, String details) { + return new Invalid(rule, message, details); + } /** * Creates an instance of an {@link Valid} validation state. diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/ValidationResult.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/ValidationResult.java index 374c3544544..628a11a225c 100644 --- a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/ValidationResult.java +++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/ValidationResult.java @@ -24,7 +24,6 @@ import java.util.stream.Collectors; /** * Encapsulates details about the result of a validation test. */ -@SuppressWarnings("WeakerAccess") public final class ValidationResult { private final List validations; @@ -96,9 +95,16 @@ public final class ValidationResult { public void addResult(Validated validated) { synchronized (validations) { ValidationRule rule = validated.getRule(); - if (rule != null && !rule.equals(ValidationRule.empty())) { + if (rule != null && !rule.equals(ValidationRule.empty()) && !validations.contains(validated)) { validations.add(validated); } } } + + public ValidationResult consume(ValidationResult other) { + synchronized (validations) { + validations.addAll(other.validations); + } + return this; + } } diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/ValidationRule.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/ValidationRule.java index e220e0482cf..8d5818b2887 100644 --- a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/ValidationRule.java +++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/validation/ValidationRule.java @@ -26,7 +26,7 @@ public class ValidationRule { private Severity severity; private String description; private String failureMessage; - private Function test; + private Function test; /** * Constructs a new instance of {@link ValidationRule} @@ -37,7 +37,7 @@ public class ValidationRule { * @param test The test condition to be applied as a part of this rule, when this function returns true, * the evaluated instance will be considered "valid" according to this rule. */ - ValidationRule(Severity severity, String description, String failureMessage, Function test) { + ValidationRule(Severity severity, String description, String failureMessage, Function test) { this.severity = severity; this.description = description; this.failureMessage = failureMessage; @@ -60,7 +60,7 @@ public class ValidationRule { * * @return true if the object state is valid according to this rule, otherwise false. */ - public boolean evaluate(Object input) { + public Result evaluate(Object input) { return test.apply(input); } @@ -90,7 +90,7 @@ public class ValidationRule { * @return An "empty" rule. */ static ValidationRule empty() { - return new ValidationRule(Severity.ERROR, "empty", "failure message", (i) -> false); + return new ValidationRule(Severity.ERROR, "empty", "failure message", (i) -> Fail.empty() ); } /** @@ -106,8 +106,8 @@ public class ValidationRule { * @return A new instance of a {@link ValidationRule} */ @SuppressWarnings("unchecked") - public static ValidationRule create(Severity severity, String description, String failureMessage, Function fn) { - return new ValidationRule(severity, description, failureMessage, (Function) fn); + public static ValidationRule create(Severity severity, String description, String failureMessage, Function fn) { + return new ValidationRule(severity, description, failureMessage, (Function) fn); } /** @@ -121,8 +121,8 @@ public class ValidationRule { * @return A new instance of a {@link ValidationRule} */ @SuppressWarnings("unchecked") - public static ValidationRule error(String failureMessage, Function fn) { - return new ValidationRule(Severity.ERROR, null, failureMessage, (Function) fn); + public static ValidationRule error(String failureMessage, Function fn) { + return new ValidationRule(Severity.ERROR, null, failureMessage, (Function) fn); } /** @@ -137,8 +137,8 @@ public class ValidationRule { * @return A new instance of a {@link ValidationRule} */ @SuppressWarnings("unchecked") - public static ValidationRule warn(String description, String failureMessage, Function fn) { - return new ValidationRule(Severity.WARNING, description, failureMessage, (Function) fn); + public static ValidationRule warn(String description, String failureMessage, Function fn) { + return new ValidationRule(Severity.WARNING, description, failureMessage, (Function) fn); } @Override @@ -149,4 +149,69 @@ public class ValidationRule { ", failureMessage='" + failureMessage + '\'' + '}'; } + + public static abstract class Result { + protected String details = null; + protected Throwable throwable = null; + + public String getDetails() { + return details; + } + + public void setDetails(String details) { + assert this.details == null; + this.details = details; + } + + public abstract boolean passed(); + public final boolean failed() { return !passed(); } + + public Throwable getThrowable() { + return throwable; + } + + public boolean thrown() { return this.throwable == null; } + } + + public static final class Pass extends Result { + public static Result empty() { return new Pass(); } + + public Pass() { + super(); + } + + public Pass(String details) { + this(); + this.details = details; + } + + @Override + public boolean passed() { + return true; + } + } + + public static final class Fail extends Result { + public static Result empty() { return new Fail(); } + + public Fail() { + super(); + } + + public Fail(String details) { + this(); + this.details = details; + } + + public Fail(String details, Throwable throwable) { + this(); + this.throwable = throwable; + this.details = details; + } + + @Override + public boolean passed() { + return false; + } + } } diff --git a/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/validation/GenericValidatorTest.java b/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/validation/GenericValidatorTest.java index d37dc827c84..3fa8874ff19 100644 --- a/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/validation/GenericValidatorTest.java +++ b/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/validation/GenericValidatorTest.java @@ -25,7 +25,7 @@ import java.util.List; import java.util.Optional; public class GenericValidatorTest { - class Person { + static class Person { private int age; private String name; @@ -35,33 +35,33 @@ public class GenericValidatorTest { } } - private static boolean isValidAge(Person person) { - return person.age > 0; + private static ValidationRule.Result checkAge(Person person) { + return person.age > 0 ? ValidationRule.Pass.empty() : ValidationRule.Fail.empty(); } - private static boolean isAdult(Person person) { - return person.age > 18; + private static ValidationRule.Result checkAdult(Person person) { + return person.age > 18 ? ValidationRule.Pass.empty() : ValidationRule.Fail.empty(); } - private static boolean isNameSet(Person person) { - return person.name != null && person.name.length() > 0; + private static ValidationRule.Result checkName(Person person) { + return (person.name != null && person.name.length() > 0) ? ValidationRule.Pass.empty() : ValidationRule.Fail.empty(); } - private static boolean isNameValid(Person person) { + private static ValidationRule.Result checkNamePattern(Person person) { String pattern = "^[A-Z][a-z]*$"; - return person.name.matches(pattern); + return person.name.matches(pattern) ? ValidationRule.Pass.empty() : ValidationRule.Fail.empty(); } - private static boolean isNameNormalLength(Person person) { - return person.name.length() < 10; + private static ValidationRule.Result checkNameNormalLength(Person person) { + return person.name.length() < 10? ValidationRule.Pass.empty() : ValidationRule.Fail.empty(); } private List validationRules = Arrays.asList( - ValidationRule.error("Age must be positive and more than zero", GenericValidatorTest::isValidAge), - ValidationRule.error("Only adults (18 years old and older)", GenericValidatorTest::isAdult), - ValidationRule.error("Name isn't set!", GenericValidatorTest::isNameSet), - ValidationRule.error("Name isn't formatted correct", GenericValidatorTest::isNameValid), - ValidationRule.warn("Name too long?", "Name may be too long.", GenericValidatorTest::isNameNormalLength) + ValidationRule.error("Age must be positive and more than zero", GenericValidatorTest::checkAge), + ValidationRule.error("Only adults (18 years old and older)", GenericValidatorTest::checkAdult), + ValidationRule.error("Name isn't set!", GenericValidatorTest::checkName), + ValidationRule.error("Name isn't formatted correct", GenericValidatorTest::checkNamePattern), + ValidationRule.warn("Name too long?", "Name may be too long.", GenericValidatorTest::checkNameNormalLength) ); @Test diff --git a/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/validation/ValidationRuleTest.java b/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/validation/ValidationRuleTest.java index ce0fa165ce7..b626085c8b3 100644 --- a/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/validation/ValidationRuleTest.java +++ b/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/validation/ValidationRuleTest.java @@ -33,13 +33,13 @@ public class ValidationRuleTest { } } - private static boolean checkName(Sample input) { - return input.getName() != null && input.getName().length() > 7; + private static ValidationRule.Result checkName(Sample input) { + return (input.getName() != null && input.getName().length() > 7) ? ValidationRule.Pass.empty() : ValidationRule.Fail.empty(); } - private static boolean checkPattern(Sample input) { + private static ValidationRule.Result checkPattern(Sample input) { String pattern = "^[A-Z][a-z]*$"; - return input.getName() != null && input.getName().matches(pattern); + return (input.getName() != null && input.getName().matches(pattern)) ? ValidationRule.Pass.empty() : ValidationRule.Fail.empty(); } @Test @@ -49,10 +49,10 @@ public class ValidationRuleTest { Sample seven = new Sample("1234567"); Sample eight = new Sample("12345678"); ValidationRule result = ValidationRule.error("test", ValidationRuleTest::checkName); - assertFalse(result.evaluate(nil)); - assertFalse(result.evaluate(six)); - assertFalse(result.evaluate(seven)); - assertTrue(result.evaluate(eight)); + assertFalse(result.evaluate(nil).passed()); + assertFalse(result.evaluate(six).passed()); + assertFalse(result.evaluate(seven).passed()); + assertTrue(result.evaluate(eight).passed()); } @Test @@ -61,8 +61,8 @@ public class ValidationRuleTest { Sample lowercase = new Sample("jim"); Sample titlecase = new Sample("Jim"); ValidationRule result = ValidationRule.error("test", i -> checkPattern((Sample)i)); - assertFalse(result.evaluate(nil)); - assertFalse(result.evaluate(lowercase)); - assertTrue(result.evaluate(titlecase)); + assertFalse(result.evaluate(nil).passed()); + assertFalse(result.evaluate(lowercase).passed()); + assertTrue(result.evaluate(titlecase).passed()); } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiEvaluator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiEvaluator.java new file mode 100644 index 00000000000..e28a69b4386 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiEvaluator.java @@ -0,0 +1,94 @@ +package org.openapitools.codegen.validations.oas; + +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Paths; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.openapitools.codegen.utils.ModelUtils; +import org.openapitools.codegen.validation.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * A validator which evaluates an OpenAPI 3.x specification document + */ +public class OpenApiEvaluator implements Validator { + private RuleConfiguration ruleConfiguration; + + /** + * Constructs a new instance of {@link OpenApiEvaluator} with applied rules. + * + * @param ruleConfiguration The set of rules to be applied to evaluation. + */ + public OpenApiEvaluator(RuleConfiguration ruleConfiguration) { + this.ruleConfiguration = ruleConfiguration; + } + + /** + * Validates input, resulting in a instance of {@link ValidationResult} which provides details on all validations performed (success, error, warning). + * + * @param specification The {@link OpenAPI} object instance to be validated. + * @return A {@link ValidationResult} which details the success, error, and warning validation results. + */ + @Override + public ValidationResult validate(OpenAPI specification) { + ValidationResult validationResult = new ValidationResult(); + if (specification == null) return validationResult; + + OpenApiParameterValidations parameterValidations = new OpenApiParameterValidations(ruleConfiguration); + OpenApiSecuritySchemeValidations securitySchemeValidations = new OpenApiSecuritySchemeValidations(ruleConfiguration); + OpenApiSchemaValidations schemaValidations = new OpenApiSchemaValidations(ruleConfiguration); + OpenApiOperationValidations operationValidations = new OpenApiOperationValidations(ruleConfiguration); + + if (ruleConfiguration.isEnableUnusedSchemasRecommendation()) { + ValidationRule unusedSchema = ValidationRule.create(Severity.WARNING, "Unused schema", "A schema was determined to be unused.", s -> ValidationRule.Pass.empty()); + ModelUtils.getUnusedSchemas(specification).forEach(schemaName -> validationResult.addResult(Validated.invalid(unusedSchema, "Unused model: " + schemaName))); + } + + Map schemas = ModelUtils.getSchemas(specification); + schemas.forEach((key, schema) -> validationResult.consume(schemaValidations.validate(schema))); + + List parameters = new ArrayList<>(50); + + Paths paths = specification.getPaths(); + if (paths != null) { + paths.forEach((key, pathItem) -> { + // parameters defined "globally" + List pathParameters = pathItem.getParameters(); + if (pathParameters != null) parameters.addAll(pathItem.getParameters()); + + pathItem.readOperationsMap().forEach((httpMethod, op) -> { + if (op != null) { + // parameters on each operation method + if (op.getParameters() != null) { + parameters.addAll(op.getParameters()); + } + + OperationWrapper wrapper = new OperationWrapper(op, httpMethod); + validationResult.consume(operationValidations.validate(wrapper)); + } + }); + }); + } + + Components components = specification.getComponents(); + if (components != null) { + Map securitySchemes = components.getSecuritySchemes(); + if (securitySchemes != null && !securitySchemes.isEmpty()) { + securitySchemes.values().forEach(securityScheme -> validationResult.consume(securitySchemeValidations.validate(securityScheme))); + } + + if (components.getParameters() != null) { + parameters.addAll(components.getParameters().values()); + } + } + + parameters.forEach(parameter -> validationResult.consume(parameterValidations.validate(parameter))); + + return validationResult; + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiOperationValidations.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiOperationValidations.java new file mode 100644 index 00000000000..9b1de83e524 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiOperationValidations.java @@ -0,0 +1,75 @@ +package org.openapitools.codegen.validations.oas; + +import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.parameters.RequestBody; +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.validation.GenericValidator; +import org.openapitools.codegen.validation.ValidationRule; + +import java.util.ArrayList; +import java.util.Locale; + +/** + * A standalone instance for evaluating rule and recommendations related to OAS {@link io.swagger.v3.oas.models.Operation} + */ +class OpenApiOperationValidations extends GenericValidator { + OpenApiOperationValidations(RuleConfiguration ruleConfiguration) { + super(new ArrayList<>()); + if (ruleConfiguration.isEnableRecommendations()) { + if (ruleConfiguration.isEnableApiRequestUriWithBodyRecommendation()) { + rules.add(ValidationRule.warn( + "API GET/HEAD defined with request body", + "While technically allowed, GET/HEAD with request body may indicate programming error, and is considered an anti-pattern.", + OpenApiOperationValidations::checkAntipatternGetOrHeadWithBody + )); + } + } + } + + /** + * Determines whether a GET or HEAD operation is configured to expect a body. + *

    + * RFC7231 describes this behavior as: + *

    + * A payload within a GET request message has no defined semantics; + * sending a payload body on a GET request might cause some existing + * implementations to reject the request. + *

    + * See https://tools.ietf.org/html/rfc7231#section-4.3.1 + *

    + * Because there are no defined semantics, and because some client and server implementations + * may silently ignore the entire body (see https://xhr.spec.whatwg.org/#the-send()-method) or + * throw an error (see https://fetch.spec.whatwg.org/#ref-for-dfn-throw%E2%91%A1%E2%91%A1), + * we maintain that the existence of a body for this operation is most likely programmer error and raise awareness. + * + * @param wrapper Wraps an operation with accompanying HTTP Method + * @return {@link ValidationRule.Pass} if the check succeeds, otherwise {@link ValidationRule.Fail} + */ + private static ValidationRule.Result checkAntipatternGetOrHeadWithBody(OperationWrapper wrapper) { + if (wrapper == null) { + return ValidationRule.Pass.empty(); + } + + ValidationRule.Result result = ValidationRule.Pass.empty(); + + if (wrapper.getHttpMethod() == PathItem.HttpMethod.GET || wrapper.getHttpMethod() == PathItem.HttpMethod.HEAD) { + RequestBody body = wrapper.getOperation().getRequestBody(); + + if (body != null) { + if (StringUtils.isNotEmpty(body.get$ref()) || (body.getContent() != null && body.getContent().size() > 0)) { + result = new ValidationRule.Fail(); + result.setDetails(String.format( + Locale.ROOT, + "%s %s contains a request body and is considered an anti-pattern.", + wrapper.getHttpMethod().name(), + wrapper.getOperation().getOperationId()) + ); + } + } + + } + + return result; + } + +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiParameterValidations.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiParameterValidations.java new file mode 100644 index 00000000000..0e3585585a0 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiParameterValidations.java @@ -0,0 +1,47 @@ +package org.openapitools.codegen.validations.oas; + +import io.swagger.v3.oas.models.parameters.HeaderParameter; +import io.swagger.v3.oas.models.parameters.Parameter; +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.validation.GenericValidator; +import org.openapitools.codegen.validation.ValidationRule; + +import java.util.ArrayList; +import java.util.Locale; + +/** + * A standalone instance for evaluating rules and recommendations related to OAS {@link Parameter} + */ +class OpenApiParameterValidations extends GenericValidator { + OpenApiParameterValidations(RuleConfiguration ruleConfiguration) { + super(new ArrayList<>()); + if (ruleConfiguration.isEnableRecommendations()) { + if (ruleConfiguration.isEnableApacheNginxUnderscoreRecommendation()) { + rules.add(ValidationRule.warn( + ValidationConstants.ApacheNginxUnderscoreDescription, + ValidationConstants.ApacheNginxUnderscoreFailureMessage, + OpenApiParameterValidations::apacheNginxHeaderCheck + )); + } + } + } + + /** + * Apache and Nginx default to legacy CGI behavior in which header with underscore are ignored. Raise this for awareness to the user. + * + * @param parameter Any spec doc parameter. The method will handle {@link HeaderParameter} evaluation. + * @return {@link ValidationRule.Pass} if the check succeeds, otherwise {@link ValidationRule.Fail} with details "[key] contains an underscore." + */ + private static ValidationRule.Result apacheNginxHeaderCheck(Parameter parameter) { + if (parameter == null || !parameter.getIn().equals("header")) return ValidationRule.Pass.empty(); + ValidationRule.Result result = ValidationRule.Pass.empty(); + + String headerName = parameter.getName(); + if (StringUtils.isNotEmpty(headerName) && StringUtils.contains(headerName, '_')) { + result = new ValidationRule.Fail(); + result.setDetails(String.format(Locale.ROOT, "%s contains an underscore.", headerName)); + } + + return result; + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidations.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidations.java new file mode 100644 index 00000000000..bfb829a8010 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidations.java @@ -0,0 +1,57 @@ +package org.openapitools.codegen.validations.oas; + +import io.swagger.v3.oas.models.media.ComposedSchema; +import io.swagger.v3.oas.models.media.Schema; +import org.openapitools.codegen.validation.GenericValidator; +import org.openapitools.codegen.validation.ValidationRule; + +import java.util.ArrayList; + +/** + * A standalone instance for evaluating rules and recommendations related to OAS {@link Schema} + */ +class OpenApiSchemaValidations extends GenericValidator { + OpenApiSchemaValidations(RuleConfiguration ruleConfiguration) { + super(new ArrayList<>()); + if (ruleConfiguration.isEnableRecommendations()) { + if (ruleConfiguration.isEnableOneOfWithPropertiesRecommendation()) { + rules.add(ValidationRule.warn( + "Schema defines properties alongside oneOf.", + "Schemas defining properties and oneOf are not clearly defined in the OpenAPI Specification. While our tooling supports this, it may cause issues with other tools.", + OpenApiSchemaValidations::checkOneOfWithProperties + )); + } + } + } + + /** + * JSON Schema defines oneOf as a validation property which can be applied to any schema. + *

    + * OpenAPI Specification is a variant of JSON Schema for which oneOf is defined as: + * "Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema." + *

    + * Where the only examples of oneOf in OpenAPI Specification are used to define either/or type structures rather than validations. + * Because of this ambiguity in the spec about what is non-standard about oneOf support, we'll warn as a recommendation that + * properties on the schema defining oneOf relationships may not be intentional in the OpenAPI Specification. + * + * @param schema An input schema, regardless of the type of schema + * @return {@link ValidationRule.Pass} if the check succeeds, otherwise {@link ValidationRule.Fail} + */ + private static ValidationRule.Result checkOneOfWithProperties(Schema schema) { + ValidationRule.Result result = ValidationRule.Pass.empty(); + + if (schema instanceof ComposedSchema) { + final ComposedSchema composed = (ComposedSchema) schema; + // check for loosely defined oneOf extension requirements. + // This is a recommendation because the 3.0.x spec is not clear enough on usage of oneOf. + // see https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.9.2.1.3 and the OAS section on 'Composition and Inheritance'. + if (composed.getOneOf() != null && composed.getOneOf().size() > 0) { + if (composed.getProperties() != null && composed.getProperties().size() >= 1 && composed.getProperties().get("discriminator") == null) { + // not necessarily "invalid" here, but we trigger the recommendation which requires the method to return false. + result = ValidationRule.Fail.empty(); + } + } + } + return result; + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSecuritySchemeValidations.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSecuritySchemeValidations.java new file mode 100644 index 00000000000..53bc3f5224e --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiSecuritySchemeValidations.java @@ -0,0 +1,47 @@ +package org.openapitools.codegen.validations.oas; + +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.validation.GenericValidator; +import org.openapitools.codegen.validation.ValidationRule; + +import java.util.ArrayList; +import java.util.Locale; + +/** + * A standalone instance for evaluating rules and recommendations related to OAS {@link SecurityScheme} + */ +class OpenApiSecuritySchemeValidations extends GenericValidator { + OpenApiSecuritySchemeValidations(RuleConfiguration ruleConfiguration) { + super(new ArrayList<>()); + if (ruleConfiguration.isEnableRecommendations()) { + if (ruleConfiguration.isEnableApacheNginxUnderscoreRecommendation()) { + rules.add(ValidationRule.warn( + ValidationConstants.ApacheNginxUnderscoreDescription, + ValidationConstants.ApacheNginxUnderscoreFailureMessage, + OpenApiSecuritySchemeValidations::apacheNginxHeaderCheck + )); + } + } + } + + /** + * Apache and Nginx default to legacy CGI behavior in which header with underscore are ignored. Raise this for awareness to the user. + * + * @param securityScheme Security schemes are often used as header parameters (e.g. APIKEY). + * @return true if the check succeeds (header does not have an underscore, e.g. 'api_key') + */ + private static ValidationRule.Result apacheNginxHeaderCheck(SecurityScheme securityScheme) { + if (securityScheme == null || securityScheme.getIn() != SecurityScheme.In.HEADER) + return ValidationRule.Pass.empty(); + ValidationRule.Result result = ValidationRule.Pass.empty(); + + String key = securityScheme.getName(); + if (StringUtils.contains(key, '_')) { + result = new ValidationRule.Fail(); + result.setDetails(String.format(Locale.ROOT, "%s contains an underscore.", key)); + } + + return result; + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OperationWrapper.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OperationWrapper.java new file mode 100644 index 00000000000..c2e3b249fda --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OperationWrapper.java @@ -0,0 +1,42 @@ +package org.openapitools.codegen.validations.oas; + +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.PathItem; + +/** + * Encapsulates an operation with its HTTP Method. In OAS, the {@link PathItem} structure contains more than what we'd + * want to evaluate for operation-only checks. + */ +public class OperationWrapper { + private Operation operation; + private PathItem.HttpMethod httpMethod; + + /** + * Constructs a new instance of {@link OperationWrapper} + * + * @param operation The operation instances to wrap + * @param httpMethod The http method to wrap + */ + OperationWrapper(Operation operation, PathItem.HttpMethod httpMethod) { + this.operation = operation; + this.httpMethod = httpMethod; + } + + /** + * Gets the operation associated with the http method + * + * @return An operation instance + */ + public Operation getOperation() { + return operation; + } + + /** + * Gets the http method associated with the operation + * + * @return The http method + */ + public PathItem.HttpMethod getHttpMethod() { + return httpMethod; + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/RuleConfiguration.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/RuleConfiguration.java new file mode 100644 index 00000000000..c8238ef590e --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/RuleConfiguration.java @@ -0,0 +1,137 @@ +package org.openapitools.codegen.validations.oas; + +/** + * Allows for configuration of validation rules which will be applied to a specification. + */ +@SuppressWarnings({"WeakerAccess", "unused"}) +public class RuleConfiguration { + private static String propertyPrefix = "openapi.generator.rule"; + private boolean enableRecommendations = defaultedBoolean(propertyPrefix + ".recommendations", true); + private boolean enableApacheNginxUnderscoreRecommendation = defaultedBoolean(propertyPrefix + ".apache-nginx-underscore", true); + private boolean enableOneOfWithPropertiesRecommendation = defaultedBoolean(propertyPrefix + ".oneof-properties-ambiguity", true); + private boolean enableUnusedSchemasRecommendation = defaultedBoolean(propertyPrefix + ".unused-schemas", true); + + private boolean enableApiRequestUriWithBodyRecommendation = defaultedBoolean(propertyPrefix + ".anti-patterns.uri-unexpected-body", true); + + @SuppressWarnings("SameParameterValue") + private static boolean defaultedBoolean(String key, boolean defaultValue) { + String property = System.getProperty(key); + if (property == null) return defaultValue; + return Boolean.parseBoolean(property); + } + + /** + * Gets whether we will raise awareness that header parameters with underscore may be ignored in Apache or Nginx by default. + * For more details, see https://stackoverflow.com/a/22856867/151445. + * + * @return true if enabled, false if disabled + */ + public boolean isEnableApacheNginxUnderscoreRecommendation() { + return enableApacheNginxUnderscoreRecommendation; + } + + /** + * Enable or Disable the recommendation check for Apache/Nginx potentially ignoring header with underscore by default. + *

    + * For more details, see {@link RuleConfiguration#isEnableApacheNginxUnderscoreRecommendation()} + * + * @param enableApacheNginxUnderscoreRecommendation true to enable, false to disable + */ + public void setEnableApacheNginxUnderscoreRecommendation(boolean enableApacheNginxUnderscoreRecommendation) { + this.enableApacheNginxUnderscoreRecommendation = enableApacheNginxUnderscoreRecommendation; + } + + /** + * Gets whether we will raise awareness a GET or HEAD operation is defined with body. + * + * @return true if enabled, false if disabled + */ + public boolean isEnableApiRequestUriWithBodyRecommendation() { + return enableApiRequestUriWithBodyRecommendation; + } + + /** + * Enable or Disable the recommendation check for GET or HEAD operations with bodies. + *

    + * For more details, see {@link RuleConfiguration#isEnableApiRequestUriWithBodyRecommendation()} + * + * @param enableApiRequestUriWithBodyRecommendation true to enable, false to disable + */ + public void setEnableApiRequestUriWithBodyRecommendation(boolean enableApiRequestUriWithBodyRecommendation) { + this.enableApiRequestUriWithBodyRecommendation = enableApiRequestUriWithBodyRecommendation; + } + + /** + * Gets whether the recommendation check for oneOf with sibling properties exists. + *

    + * JSON Schema defines oneOf as a validation property which can be applied to any schema. + *

    + * OpenAPI Specification is a variant of JSON Schema for which oneOf is defined as: + * "Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema." + *

    + * Where the only examples of oneOf in OpenAPI Specification are used to define either/or type structures rather than validations. + * Because of this ambiguity in the spec about what is non-standard about oneOf support, we'll warn as a recommendation that + * properties on the schema defining oneOf relationships may not be intentional in the OpenAPI Specification. + * + * @return true if enabled, false if disabled + */ + public boolean isEnableOneOfWithPropertiesRecommendation() { + return enableOneOfWithPropertiesRecommendation; + } + + /** + * Enable or Disable the recommendation check for schemas containing properties and oneOf definitions. + *

    + * For more details, see {@link RuleConfiguration#isEnableOneOfWithPropertiesRecommendation()} + * + * @param enableOneOfWithPropertiesRecommendation true to enable, false to disable + */ + public void setEnableOneOfWithPropertiesRecommendation(boolean enableOneOfWithPropertiesRecommendation) { + this.enableOneOfWithPropertiesRecommendation = enableOneOfWithPropertiesRecommendation; + } + + /** + * Get whether recommendations are enabled. + * + * @return true if enabled, false if disabled + */ + public boolean isEnableRecommendations() { + return enableRecommendations; + } + + /** + * Enable or Disable recommendations. Recommendations are either informational or warning level type validations + * which are raised to communicate issues to the user which they may not be aware of, or for which support in the + * tooling/spec may not be clearly defined. + * + * @param enableRecommendations true to enable, false to disable + */ + public void setEnableRecommendations(boolean enableRecommendations) { + this.enableRecommendations = enableRecommendations; + } + + /** + * Gets whether the recommendation to check for unused schemas is enabled. + *

    + * While the tooling may or may not support generation of models representing unused schemas, we take the stance that + * a schema which is defined but not referenced in an operation or by some schema bound to an operation may be a good + * indicator of a programming error. We surface this information to the user in case the orphaned schema(s) are not + * intentional. + * + * @return true if enabled, false if disabled + */ + public boolean isEnableUnusedSchemasRecommendation() { + return enableUnusedSchemasRecommendation; + } + + /** + * Enable or Disable the recommendation check for unused schemas. + *

    + * For more details, see {@link RuleConfiguration#isEnableUnusedSchemasRecommendation()} + * + * @param enableUnusedSchemasRecommendation true to enable, false to disable + */ + public void setEnableUnusedSchemasRecommendation(boolean enableUnusedSchemasRecommendation) { + this.enableUnusedSchemasRecommendation = enableUnusedSchemasRecommendation; + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/ValidationConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/ValidationConstants.java new file mode 100644 index 00000000000..9571f1bedcd --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/ValidationConstants.java @@ -0,0 +1,6 @@ +package org.openapitools.codegen.validations.oas; + +final class ValidationConstants { + static String ApacheNginxUnderscoreDescription = "Apache and Nginx may fail on headers keys with underscore!"; + static String ApacheNginxUnderscoreFailureMessage = "Apache and Nginx webservers may fail due to legacy CGI constraints enabled by default in which header keys with underscore are disallowed. See https://stackoverflow.com/a/22856867/151445."; +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiOperationValidationsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiOperationValidationsTest.java new file mode 100644 index 00000000000..c4d911563ec --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiOperationValidationsTest.java @@ -0,0 +1,116 @@ +package org.openapitools.codegen.validations.oas; + +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.media.Content; +import io.swagger.v3.oas.models.media.MediaType; +import io.swagger.v3.oas.models.parameters.RequestBody; +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.validation.Invalid; +import org.openapitools.codegen.validation.ValidationResult; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.util.List; +import java.util.stream.Collectors; + +public class OpenApiOperationValidationsTest { + @DataProvider(name = "getOrHeadWithBodyExpectations") + public Object[][] getOrHeadWithBodyExpectations() { + return new Object[][]{ + /* method */ /* operationId */ /* ref */ /* content */ /* triggers warning */ + {PathItem.HttpMethod.GET, "opWithRef", "#/components/schemas/Animal", null, true}, + {PathItem.HttpMethod.GET, "opWithContent", null, new Content().addMediaType("a", new MediaType()), true}, + {PathItem.HttpMethod.GET, "opWithoutRefOrContent", null, null, false}, + {PathItem.HttpMethod.HEAD, "opWithRef", "#/components/schemas/Animal", null, true}, + {PathItem.HttpMethod.HEAD, "opWithContent", null, new Content().addMediaType("a", new MediaType()), true}, + {PathItem.HttpMethod.HEAD, "opWithoutRefOrContent", null, null, false}, + {PathItem.HttpMethod.POST, "opWithRef", "#/components/schemas/Animal", null, false}, + {PathItem.HttpMethod.POST, "opWithContent", null, new Content().addMediaType("a", new MediaType()), false}, + {PathItem.HttpMethod.POST, "opWithoutRefOrContent", null, null, false} + }; + } + + @Test(dataProvider = "getOrHeadWithBodyExpectations") + public void testGetOrHeadWithBody(PathItem.HttpMethod method, String operationId, String ref, Content content, boolean shouldTriggerFailure) { + RuleConfiguration config = new RuleConfiguration(); + config.setEnableRecommendations(true); + OpenApiOperationValidations validator = new OpenApiOperationValidations(config); + + Operation op = new Operation().operationId(operationId); + RequestBody body = new RequestBody(); + if (StringUtils.isNotEmpty(ref) || content != null) { + body.$ref(ref); + body.content(content); + + op.setRequestBody(body); + } + + ValidationResult result = validator.validate(new OperationWrapper(op, method)); + Assert.assertNotNull(result.getWarnings()); + + List warnings = result.getWarnings().stream() + .filter(invalid -> "API GET/HEAD defined with request body".equals(invalid.getRule().getDescription())) + .collect(Collectors.toList()); + + Assert.assertNotNull(warnings); + if (shouldTriggerFailure) { + Assert.assertEquals(warnings.size(), 1, "Expected warnings to include recommendation."); + } else { + Assert.assertEquals(warnings.size(), 0, "Expected warnings not to include recommendation."); + } + } + + @Test(dataProvider = "getOrHeadWithBodyExpectations") + public void testGetOrHeadWithBodyWithDisabledRecommendations(PathItem.HttpMethod method, String operationId, String ref, Content content, boolean shouldTriggerFailure) { + RuleConfiguration config = new RuleConfiguration(); + config.setEnableRecommendations(false); + OpenApiOperationValidations validator = new OpenApiOperationValidations(config); + + Operation op = new Operation().operationId(operationId); + RequestBody body = new RequestBody(); + if (StringUtils.isNotEmpty(ref) || content != null) { + body.$ref(ref); + body.content(content); + + op.setRequestBody(body); + } + + ValidationResult result = validator.validate(new OperationWrapper(op, method)); + Assert.assertNotNull(result.getWarnings()); + + List warnings = result.getWarnings().stream() + .filter(invalid -> "API GET/HEAD defined with request body".equals(invalid.getRule().getDescription())) + .collect(Collectors.toList()); + + Assert.assertNotNull(warnings); + Assert.assertEquals(warnings.size(), 0, "Expected warnings not to include recommendation."); + } + + @Test(dataProvider = "getOrHeadWithBodyExpectations") + public void testGetOrHeadWithBodyWithDisabledRule(PathItem.HttpMethod method, String operationId, String ref, Content content, boolean shouldTriggerFailure) { + RuleConfiguration config = new RuleConfiguration(); + config.setEnableApiRequestUriWithBodyRecommendation(false); + OpenApiOperationValidations validator = new OpenApiOperationValidations(config); + + Operation op = new Operation().operationId(operationId); + RequestBody body = new RequestBody(); + if (StringUtils.isNotEmpty(ref) || content != null) { + body.$ref(ref); + body.content(content); + + op.setRequestBody(body); + } + + ValidationResult result = validator.validate(new OperationWrapper(op, method)); + Assert.assertNotNull(result.getWarnings()); + + List warnings = result.getWarnings().stream() + .filter(invalid -> "API GET/HEAD defined with request body".equals(invalid.getRule().getDescription())) + .collect(Collectors.toList()); + + Assert.assertNotNull(warnings); + Assert.assertEquals(warnings.size(), 0, "Expected warnings not to include recommendation."); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiParameterValidationsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiParameterValidationsTest.java new file mode 100644 index 00000000000..a242a355e3a --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiParameterValidationsTest.java @@ -0,0 +1,93 @@ +package org.openapitools.codegen.validations.oas; + +import io.swagger.v3.oas.models.parameters.Parameter; +import org.openapitools.codegen.validation.Invalid; +import org.openapitools.codegen.validation.ValidationResult; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.util.List; +import java.util.stream.Collectors; + +public class OpenApiParameterValidationsTest { + + @Test(dataProvider = "apacheNginxRecommendationExpectations", description = "disable apache nginx via turning off recommendations") + public void testApacheNginxWithDisabledRecommendations(String in, String key, boolean matches) { + RuleConfiguration config = new RuleConfiguration(); + config.setEnableRecommendations(false); + OpenApiParameterValidations validator = new OpenApiParameterValidations(config); + + Parameter parameter = new Parameter(); + parameter.setIn(in); + parameter.setName(key); + + ValidationResult result = validator.validate(parameter); + Assert.assertNotNull(result.getWarnings()); + + List warnings = result.getWarnings().stream() + .filter(invalid -> ValidationConstants.ApacheNginxUnderscoreFailureMessage.equals(invalid.getMessage())) + .collect(Collectors.toList()); + + Assert.assertNotNull(warnings); + Assert.assertEquals(warnings.size(), 0, "Expected recommendations to be disabled completely."); + } + + @Test(dataProvider = "apacheNginxRecommendationExpectations", description = "disable apache nginx via turning off recommendations") + public void testApacheNginxWithDisabledRule(String in, String key, boolean matches) { + RuleConfiguration config = new RuleConfiguration(); + config.setEnableApacheNginxUnderscoreRecommendation(false); + OpenApiParameterValidations validator = new OpenApiParameterValidations(config); + + Parameter parameter = new Parameter(); + parameter.setIn(in); + parameter.setName(key); + + ValidationResult result = validator.validate(parameter); + Assert.assertNotNull(result.getWarnings()); + + List warnings = result.getWarnings().stream() + .filter(invalid -> ValidationConstants.ApacheNginxUnderscoreFailureMessage.equals(invalid.getMessage())) + .collect(Collectors.toList()); + + Assert.assertNotNull(warnings); + Assert.assertEquals(warnings.size(), 0, "Expected rule to be disabled."); + } + + @Test(dataProvider = "apacheNginxRecommendationExpectations", description = "default apache nginx recommendation") + public void testDefaultRecommendationApacheNginx(String in, String key, boolean matches) { + RuleConfiguration config = new RuleConfiguration(); + config.setEnableRecommendations(true); + OpenApiParameterValidations validator = new OpenApiParameterValidations(config); + + Parameter parameter = new Parameter(); + parameter.setIn(in); + parameter.setName(key); + + ValidationResult result = validator.validate(parameter); + Assert.assertNotNull(result.getWarnings()); + + List warnings = result.getWarnings().stream() + .filter(invalid -> ValidationConstants.ApacheNginxUnderscoreFailureMessage.equals(invalid.getMessage())) + .collect(Collectors.toList()); + + Assert.assertNotNull(warnings); + if (matches) { + Assert.assertEquals(warnings.size(), 1, "Expected " + key + " to match recommendation."); + } else { + Assert.assertEquals(warnings.size(), 0, "Expected " + key + " not to match recommendation."); + } + } + + @DataProvider(name = "apacheNginxRecommendationExpectations") + public Object[][] apacheNginxRecommendationExpectations() { + return new Object[][]{ + {"header", "api_key", true}, + {"header", "apikey", false}, + {"cookie", "api_key", false}, + {"cookie", "apikey", false}, + {"query", "api_key", false}, + {"query", "apikey", false} + }; + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidationsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidationsTest.java new file mode 100644 index 00000000000..2f8ad8ce5c9 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiSchemaValidationsTest.java @@ -0,0 +1,128 @@ +package org.openapitools.codegen.validations.oas; + +import io.swagger.v3.oas.models.media.*; +import org.openapitools.codegen.validation.Invalid; +import org.openapitools.codegen.validation.ValidationResult; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +public class OpenApiSchemaValidationsTest { + @Test(dataProvider = "apacheNginxRecommendationExpectations", description = "default oneOf with sibling properties recommendation") + public void testDefaultRecommendationOneOfWithSiblingProperties(Schema schema, boolean matches) { + RuleConfiguration config = new RuleConfiguration(); + config.setEnableRecommendations(true); + OpenApiSchemaValidations validator = new OpenApiSchemaValidations(config); + + ValidationResult result = validator.validate(schema); + Assert.assertNotNull(result.getWarnings()); + + List warnings = result.getWarnings().stream() + .filter(invalid -> "Schema defines properties alongside oneOf." .equals(invalid.getRule().getDescription())) + .collect(Collectors.toList()); + + Assert.assertNotNull(warnings); + if (matches) { + Assert.assertEquals(warnings.size(), 1, "Expected to match recommendation."); + } else { + Assert.assertEquals(warnings.size(), 0, "Expected not to match recommendation."); + } + } + + @Test(dataProvider = "apacheNginxRecommendationExpectations", description = "disable oneOf with sibling properties recommendation via turning off recommendations") + public void testOneOfWithSiblingPropertiesDisabledRecommendations(Schema schema, boolean matches) { + RuleConfiguration config = new RuleConfiguration(); + config.setEnableRecommendations(false); + OpenApiSchemaValidations validator = new OpenApiSchemaValidations(config); + + ValidationResult result = validator.validate(schema); + Assert.assertNotNull(result.getWarnings()); + + List warnings = result.getWarnings().stream() + .filter(invalid -> "Schema defines properties alongside oneOf." .equals(invalid.getRule().getDescription())) + .collect(Collectors.toList()); + + Assert.assertNotNull(warnings); + Assert.assertEquals(warnings.size(), 0, "Expected recommendations to be disabled completely."); + } + + @Test(dataProvider = "apacheNginxRecommendationExpectations", description = "disable oneOf with sibling properties recommendation via turning off rule") + public void testOneOfWithSiblingPropertiesDisabledRule(Schema schema, boolean matches) { + RuleConfiguration config = new RuleConfiguration(); + config.setEnableOneOfWithPropertiesRecommendation(false); + OpenApiSchemaValidations validator = new OpenApiSchemaValidations(config); + + ValidationResult result = validator.validate(schema); + Assert.assertNotNull(result.getWarnings()); + + List warnings = result.getWarnings().stream() + .filter(invalid -> "Schema defines properties alongside oneOf." .equals(invalid.getRule().getDescription())) + .collect(Collectors.toList()); + + Assert.assertNotNull(warnings); + Assert.assertEquals(warnings.size(), 0, "Expected rule to be disabled."); + } + + @DataProvider(name = "apacheNginxRecommendationExpectations") + public Object[][] apacheNginxRecommendationExpectations() { + return new Object[][]{ + {getOneOfSample(true), true}, + {getOneOfSample(false), false}, + {getAllOfSample(true), false}, + {getAllOfSample(false), false}, + {getAnyOfSample(true), false}, + {getAnyOfSample(false), false}, + {new StringSchema(), false}, + {new MapSchema(), false}, + {new ArraySchema(), false}, + {new ObjectSchema(), false} + }; + } + + private ComposedSchema getOneOfSample(boolean withProperties) { + ComposedSchema schema = new ComposedSchema().oneOf(Arrays.asList( + new StringSchema(), + new IntegerSchema().format("int64")) + ); + + if (withProperties) { + schema.addProperties("other", new ArraySchema() + .items(new Schema().$ref("#/definitions/Other"))); + } + + return schema; + } + + private ComposedSchema getAllOfSample(boolean withProperties) { + // This doesn't matter if it's realistic; it's a structural check + ComposedSchema schema = new ComposedSchema().allOf(Arrays.asList( + new StringSchema(), + new IntegerSchema().format("int64")) + ); + + if (withProperties) { + schema.addProperties("other", new ArraySchema() + .items(new Schema().$ref("#/definitions/Other"))); + } + + return schema; + } + + private ComposedSchema getAnyOfSample(boolean withProperties) { + ComposedSchema schema = new ComposedSchema().anyOf(Arrays.asList( + new StringSchema(), + new IntegerSchema().format("int64")) + ); + + if (withProperties) { + schema.addProperties("other", new ArraySchema() + .items(new Schema().$ref("#/definitions/Other"))); + } + + return schema; + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiSecuritySchemeValidationsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiSecuritySchemeValidationsTest.java new file mode 100644 index 00000000000..aae32dd3012 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/validations/oas/OpenApiSecuritySchemeValidationsTest.java @@ -0,0 +1,87 @@ +package org.openapitools.codegen.validations.oas; + +import io.swagger.v3.oas.models.security.SecurityScheme; +import org.openapitools.codegen.validation.Invalid; +import org.openapitools.codegen.validation.ValidationResult; +import org.testng.Assert; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.util.List; +import java.util.stream.Collectors; + +public class OpenApiSecuritySchemeValidationsTest { + + @Test(dataProvider = "apacheNginxRecommendationExpectations", description = "disable apache nginx via turning off recommendations") + public void testApacheNginxWithDisabledRecommendations(SecurityScheme.In in, String key, boolean matches) { + RuleConfiguration config = new RuleConfiguration(); + config.setEnableRecommendations(false); + OpenApiSecuritySchemeValidations validator = new OpenApiSecuritySchemeValidations(config); + + SecurityScheme securityScheme = new SecurityScheme().in(in).name(key); + + ValidationResult result = validator.validate(securityScheme); + Assert.assertNotNull(result.getWarnings()); + + List warnings = result.getWarnings().stream() + .filter(invalid -> ValidationConstants.ApacheNginxUnderscoreFailureMessage.equals(invalid.getMessage())) + .collect(Collectors.toList()); + + Assert.assertNotNull(warnings); + Assert.assertEquals(warnings.size(), 0, "Expected recommendations to be disabled completely."); + } + + @Test(dataProvider = "apacheNginxRecommendationExpectations", description = "disable apache nginx via turning off rule") + public void testApacheNginxWithDisabledRule(SecurityScheme.In in, String key, boolean matches) { + RuleConfiguration config = new RuleConfiguration(); + config.setEnableApacheNginxUnderscoreRecommendation(false); + OpenApiSecuritySchemeValidations validator = new OpenApiSecuritySchemeValidations(config); + + SecurityScheme securityScheme = new SecurityScheme().in(in).name(key); + + ValidationResult result = validator.validate(securityScheme); + Assert.assertNotNull(result.getWarnings()); + + List warnings = result.getWarnings().stream() + .filter(invalid -> ValidationConstants.ApacheNginxUnderscoreFailureMessage.equals(invalid.getMessage())) + .collect(Collectors.toList()); + + Assert.assertNotNull(warnings); + Assert.assertEquals(warnings.size(), 0, "Expected rule to be disabled."); + } + + @Test(dataProvider = "apacheNginxRecommendationExpectations", description = "default apache nginx recommendation") + public void testDefaultRecommendationApacheNginx(SecurityScheme.In in, String key, boolean matches) { + RuleConfiguration config = new RuleConfiguration(); + config.setEnableRecommendations(true); + OpenApiSecuritySchemeValidations validator = new OpenApiSecuritySchemeValidations(config); + + SecurityScheme securityScheme = new SecurityScheme().in(in).name(key); + + ValidationResult result = validator.validate(securityScheme); + Assert.assertNotNull(result.getWarnings()); + + List warnings = result.getWarnings().stream() + .filter(invalid -> ValidationConstants.ApacheNginxUnderscoreFailureMessage.equals(invalid.getMessage())) + .collect(Collectors.toList()); + + Assert.assertNotNull(warnings); + if (matches) { + Assert.assertEquals(warnings.size(), 1, "Expected " + key + " to match recommendation."); + } else { + Assert.assertEquals(warnings.size(), 0, "Expected " + key + " not to match recommendation."); + } + } + + @DataProvider(name = "apacheNginxRecommendationExpectations") + public Object[][] apacheNginxRecommendationExpectations() { + return new Object[][]{ + {SecurityScheme.In.HEADER, "api_key", true}, + {SecurityScheme.In.HEADER, "apikey", false}, + {SecurityScheme.In.COOKIE, "api_key", false}, + {SecurityScheme.In.COOKIE, "apikey", false}, + {SecurityScheme.In.QUERY, "api_key", false}, + {SecurityScheme.In.COOKIE, "apikey", false} + }; + } +} \ No newline at end of file From 507f80617db695b745a9b02038040a75bc18ea9d Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Fri, 31 Jan 2020 17:36:06 -0500 Subject: [PATCH 63/85] [bug] Templates via classpath (#5164) * Fixes issue with templates loading via classpath The templating engines were originally written to load templates via the classpath, but this functionality was blocked by file-only checks further up the stack. This loosens those file-only checks, allowing files and relatively imported files to be included via classpath. * [docs] Add details about classpath-level templates * [feat][maven] templateResourcePath for template on classpath - NOTE templateResourcePath is not needed for gradle, as it accepts a string for the target template directory, which supports classpath --- docs/templating.md | 23 +++++++++++++++++++ .../codegen/config/WorkflowSettings.java | 23 ++++++++++++++++--- .../openapi-generator-maven-plugin/README.md | 1 + .../codegen/plugin/CodeGenMojo.java | 14 +++++++++++ .../codegen/AbstractGenerator.java | 4 ++-- 5 files changed, 60 insertions(+), 5 deletions(-) diff --git a/docs/templating.md b/docs/templating.md index a2f5b2335b1..1f8cad04332 100644 --- a/docs/templating.md +++ b/docs/templating.md @@ -26,6 +26,29 @@ OpenAPI Generator supports user-defined templates. This approach is often the ea > **Note:** You cannot use this approach to create new templates, only override existing ones. If you'd like to create a new generator to contribute back to the project, see `new.sh` in the repository root. If you'd like to create a private generator for more templating control, see the [customization](./customization.md) docs. +OpenAPI Generator not only supports local files for templating, but also templates defined on the classpath. This is a great option if you want to reuse templates across multiple projects. To load a template via classpath, you'll need to generate a little differently. For example, if you've created an artifact called `template-classpath-example` which contains extended templates for the `htmlDocs` generator with the following structure: + +``` +└── src + ├── main + │   ├── java + │   └── resources + │   └── templates + │   └── htmlDocs + │   ├── index.mustache + │   └── style.css.mustache +``` + +You can define your classpath to contain your JAR and the openapi-generator-cli _fat jar_, then invoke main class `org.openapitools.codegen.OpenAPIGenerator`. For instance, + +```sh +java -cp /path/totemplate-classpath-example-1.0-SNAPSHOT.jar:modules/openapi-generator-cli/target/openapi-generator-cli.jar \ + org.openapitools.codegen.OpenAPIGenerator generate -i https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml \ + -g html -o template-example -t templates/htmlDocs +``` + +Note that our template directory is relative to the resource directory of the JAR defined on the classpath. + ### Custom Logic For this example, let's modify a Java client to use AOP via [jcabi/jcabi-aspects](https://github.com/jcabi/jcabi-aspects). We'll log API method execution at the `INFO` level. The jcabi-aspects project could also be used to implement method retries on failures; this would be a great exercise to further play around with templating. diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java index 2bc94188cfa..0fdc6c6e99c 100644 --- a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java +++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/config/WorkflowSettings.java @@ -21,6 +21,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; import java.nio.file.Paths; import java.util.HashMap; import java.util.Map; @@ -406,15 +409,29 @@ public class WorkflowSettings { */ public Builder withTemplateDir(String templateDir) { if (templateDir != null) { + URI uri = null; File f = new File(templateDir); // check to see if the folder exists - if (!(f.exists() && f.isDirectory())) { + if (f.exists() && f.isDirectory()) { + uri = f.toURI(); + this.templateDir = Paths.get(uri).toAbsolutePath().toString(); + } else { + URL url = this.getClass().getClassLoader().getResource(templateDir); + if (url != null) { + try { + uri = url.toURI(); + this.templateDir = templateDir; + } catch (URISyntaxException e) { + LOGGER.warn("The requested template was found on the classpath, but resulted in a syntax error."); + } + } + } + + if (uri == null) { throw new IllegalArgumentException( "Template directory " + templateDir + " does not exist."); } - - this.templateDir = Paths.get(f.toURI()).toAbsolutePath().toString(); } return this; diff --git a/modules/openapi-generator-maven-plugin/README.md b/modules/openapi-generator-maven-plugin/README.md index 9714ace95f9..2522af1f212 100644 --- a/modules/openapi-generator-maven-plugin/README.md +++ b/modules/openapi-generator-maven-plugin/README.md @@ -48,6 +48,7 @@ mvn clean compile | `generatorName` | `openapi.generator.maven.plugin.generatorName` | target generator name | `output` | `openapi.generator.maven.plugin.output` | target output path (default is `${project.build.directory}/generated-sources/openapi`. Can also be set globally through the `openapi.generator.maven.plugin.output` property) | `templateDirectory` | `openapi.generator.maven.plugin.templateDirectory` | directory with mustache templates +| `templateResourcePath` | `openapi.generator.maven.plugin.templateResourcePath` | directory with mustache templates via resource path. This option will overwrite any option defined in `templateDirectory`. | `addCompileSourceRoot` | `openapi.generator.maven.plugin.addCompileSourceRoot` | add the output directory to the project as a source root (`true` by default) | `modelPackage` | `openapi.generator.maven.plugin.modelPackage` | the package to use for generated model objects/classes | `apiPackage` | `openapi.generator.maven.plugin.apiPackage` | the package to use for generated api objects/classes diff --git a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java index 49fb45efa07..c03586f39a0 100644 --- a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java +++ b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java @@ -40,6 +40,7 @@ import java.util.Set; import com.google.common.io.ByteSource; import com.google.common.io.CharSource; import io.swagger.v3.parser.util.ClasspathHelper; +import org.apache.commons.lang3.StringUtils; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; @@ -133,6 +134,12 @@ public class CodeGenMojo extends AbstractMojo { @Parameter(name = "templateDirectory", property = "openapi.generator.maven.plugin.templateDirectory") private File templateDirectory; + /** + * Resource path containing template files. + */ + @Parameter(name = "templateResourcePath", property = "openapi.generator.maven.plugin.templateResourcePath") + private String templateResourcePath; + /** * The name of templating engine to use, "mustache" (default) or "handlebars" (beta) */ @@ -583,6 +590,13 @@ public class CodeGenMojo extends AbstractMojo { configurator.setTemplateDir(templateDirectory.getAbsolutePath()); } + if (StringUtils.isNotEmpty(templateResourcePath)) { + if (null != templateDirectory) { + LOGGER.warn("Both templateDirectory and templateResourcePath were configured. templateResourcePath overwrites templateDirectory."); + } + configurator.setTemplateDir(templateResourcePath); + } + if (null != engine) { configurator.setTemplatingEngineName(engine); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/AbstractGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/AbstractGenerator.java index 64b74e1ad0a..ba17f231aeb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/AbstractGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/AbstractGenerator.java @@ -161,14 +161,14 @@ public abstract class AbstractGenerator implements TemplatingGenerator { if (StringUtils.isNotEmpty(library)) { //look for the file in the library subfolder of the supplied template final String libTemplateFile = buildLibraryFilePath(config.templateDir(), library, templateFile); - if (new File(libTemplateFile).exists()) { + if (new File(libTemplateFile).exists() || this.getClass().getClassLoader().getResource(libTemplateFile) != null) { return libTemplateFile; } } //check the supplied template main folder for the file final String template = config.templateDir() + File.separator + templateFile; - if (new File(template).exists()) { + if (new File(template).exists() || this.getClass().getClassLoader().getResource(template) != null) { return template; } From 7cdbcec1a55d9d98e0a888e5d2bed99adaa7ad19 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Fri, 31 Jan 2020 22:40:33 -0500 Subject: [PATCH 64/85] [doc] Update versions missed during release (#5185) * [doc] Update versions missed during release Removed old script bin/utils/release_version_update_docs.sh to avoid confusion. New script solves issues of not "globally" replacing. New script is at: bin/utils/release/release_version_update_docs.sh * Update Gradle Plugin README with correct version * Update gradle.properties to correct version --- README.md | 4 +- bin/utils/release/release_version_update.sh | 1 + .../release/release_version_update_docs.sh | 1 + bin/utils/release_version_update_docs.sh | 61 ------------------- docs/installation.md | 8 +-- .../README.adoc | 4 +- .../samples/local-spec/gradle.properties | 2 +- website/pages/en/index.js | 2 +- 8 files changed, 12 insertions(+), 71 deletions(-) delete mode 100755 bin/utils/release_version_update_docs.sh diff --git a/README.md b/README.md index 25441aa85e0..86b1546febe 100644 --- a/README.md +++ b/README.md @@ -393,10 +393,10 @@ openapi-generator version ``` -Or install a particular OpenAPI Generator version (e.g. v4.2.2): +Or install a particular OpenAPI Generator version (e.g. v4.2.3): ```sh -npm install @openapitools/openapi-generator-cli@cli-4.2.2 -g +npm install @openapitools/openapi-generator-cli@cli-4.2.3 -g ``` Or install it as dev-dependency: diff --git a/bin/utils/release/release_version_update.sh b/bin/utils/release/release_version_update.sh index 95d41712c52..c2be83681ca 100755 --- a/bin/utils/release/release_version_update.sh +++ b/bin/utils/release/release_version_update.sh @@ -78,6 +78,7 @@ declare -a xml_files=( "${root}/modules/openapi-generator-maven-plugin/pom.xml" "${root}/modules/openapi-generator-online/pom.xml" "${root}/modules/openapi-generator/pom.xml" + "${root}/modules/openapi-generator-gradle-plugin/gradle.properties" "${root}/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml" "${root}/modules/openapi-generator-maven-plugin/examples/java-client.xml" "${root}/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml" diff --git a/bin/utils/release/release_version_update_docs.sh b/bin/utils/release/release_version_update_docs.sh index cfd66070e95..160674acbd3 100755 --- a/bin/utils/release/release_version_update_docs.sh +++ b/bin/utils/release/release_version_update_docs.sh @@ -103,6 +103,7 @@ fi declare -a xml_files=( "${root}/modules/openapi-generator-maven-plugin/README.md" + "${root}/modules/openapi-generator-gradle-plugin/README.adoc" "${root}/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md" "${root}/README.md" "${root}/docs/installation.md" diff --git a/bin/utils/release_version_update_docs.sh b/bin/utils/release_version_update_docs.sh deleted file mode 100755 index c6b8f129218..00000000000 --- a/bin/utils/release_version_update_docs.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# -# usage: ./bin/utils/release_version_update.sh 3.0.1-SNAPSHOT 3.0.1 -# -# 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. -# - -if [[ "$1" != "" ]]; then - FROM="$1" -else - echo "Missing argument. Usage e.g.: ./bin/utils/release_version_update.sh 3.0.1-SNAPSHOT 3.0.1" - exit 1; -fi - -if [[ "$2" != "" ]]; then - TO="$2" -else - echo "Missing argument. Usage e.g.: ./bin/utils/release_version_update.sh 3.0.1-SNAPSHOT 3.0.1" - exit 1; -fi - -echo "Release preparation: replacing $FROM with $TO in different files" - -declare -a files=("modules/openapi-generator-maven-plugin/README.md" - "modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml" - "modules/openapi-generator-maven-plugin/examples/java-client.xml" - "modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml" - "modules/openapi-generator-maven-plugin/examples/non-java.xml" - "modules/openapi-generator-gradle-plugin/README.adoc" - "modules/openapi-generator-gradle-plugin/gradle.properties" - "modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties" - "modules/openapi-generator-gradle-plugin/samples/local-spec/README.md" - "README.md") - -sedi () { - # Cross-platform version of sed -i that works both on Mac and Linux - sed --version >/dev/null 2>&1 && sed -i -e "$@" || sed -i "" "$@" -} - -for filename in "${files[@]}"; do - # e.g. sed -i '' "s/3.0.1-SNAPSHOT/3.0.1/g" CI/pom.xml.bash - #echo "Running command: sed -i '' "s/$FROM/$TO/g" $filename" - if sedi "s/$FROM/$TO/g" $filename; then - echo "Updated $filename successfully!" - else - echo "ERROR: Failed to update $filename with the following command" - echo "sed -i '' \"s/$FROM/$TO/g\" $filename" - fi -done diff --git a/docs/installation.md b/docs/installation.md index 60105c9a9bc..ff84a2de771 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -22,7 +22,7 @@ npm install @openapitools/openapi-generator-cli -g To install a specific version of the tool, pass the version during installation: ```bash -npm install @openapitools/openapi-generator-cli@cli-4.2.2 -g +npm install @openapitools/openapi-generator-cli@cli-4.2.3 -g ``` To install the tool as a dev dependency in your current project: @@ -80,18 +80,18 @@ docker run --rm \ If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum): -JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.2/openapi-generator-cli-4.2.2.jar` +JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.3/openapi-generator-cli-4.2.3.jar` For **Mac/Linux** users: ```bash -wget https//repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.2/openapi-generator-cli-4.2.2.jar -O openapi-generator-cli.jar +wget https//repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.3/openapi-generator-cli-4.2.3.jar -O openapi-generator-cli.jar ``` For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. ``` -Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.2/openapi-generator-cli-4.2.2.jar +Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.3/openapi-generator-cli-4.2.3.jar ``` diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc index e107d0956f9..f386781447a 100644 --- a/modules/openapi-generator-gradle-plugin/README.adoc +++ b/modules/openapi-generator-gradle-plugin/README.adoc @@ -84,7 +84,7 @@ buildscript { // url "https://plugins.gradle.org/m2/" } dependencies { - classpath "org.openapitools:openapi-generator-gradle-plugin:4.2.0" + classpath "org.openapitools:openapi-generator-gradle-plugin:4.2.3" } } @@ -649,7 +649,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.2.1' - classpath('org.openapitools:openapi-generator-gradle-plugin:4.2.0') { + classpath('org.openapitools:openapi-generator-gradle-plugin:4.2.3') { exclude group: 'com.google.guava' } } 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 240b76bafa8..14a68fc42ad 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties @@ -1,3 +1,3 @@ # RELEASE_VERSION -openApiGeneratorVersion=4.2.0 +openApiGeneratorVersion=4.3.0-SNAPSHOT # /RELEASE_VERSION diff --git a/website/pages/en/index.js b/website/pages/en/index.js index 698cec53814..155ebb7b84a 100755 --- a/website/pages/en/index.js +++ b/website/pages/en/index.js @@ -185,7 +185,7 @@ class Index extends React.Component { | npm install @openapitools/openapi-generator-cli -g | | # install a specific version of "openapi-generator-cli" - | npm install @openapitools/openapi-generator-cli@cli-4.2.2 -g + | npm install @openapitools/openapi-generator-cli@cli-4.2.3 -g | | # Or install it as dev-dependency in your node.js projects | npm install @openapitools/openapi-generator-cli -D From c8cd255ad31a704615640c9ecea87950578210bf Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Sat, 1 Feb 2020 04:03:34 -0500 Subject: [PATCH 65/85] [gradle] Add recommendations to validate task (#5183) * [gradle] Add recommendations to validate task * Use current version of Gradle Plugin in build checks. * Fix gradle project build version confusion in CI * [gradle] Bump samples to 5.2.1 wrapper Previously, the Gradle plugin was building in CI against openapi-generator 4.2.0 and Gradle version 4.10.2. At some point, a contribution was made with an API which is incomatible at 4.10.2 and due to a release script error which pinned the local-spec version to release 4.2.0, we didn't notice this inconsistency. This bumps the project to build against Gradle 5.2.1. --- .../README.adoc | 6 +++ .../gradle/wrapper/gradle-wrapper.properties | 5 +- .../openapi-generator-gradle-plugin/pom.xml | 1 + .../samples/local-spec/build.gradle | 1 + .../gradle/wrapper/gradle-wrapper.jar | Bin 56177 -> 58702 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../samples/local-spec/gradlew | 51 +++++++++++------- .../samples/local-spec/gradlew.bat | 18 ++++++- .../gradle/plugin/OpenApiGeneratorPlugin.kt | 1 + .../OpenApiGeneratorValidateExtension.kt | 14 +++++ .../gradle/plugin/tasks/ValidateTask.kt | 40 +++++++++++++- 11 files changed, 114 insertions(+), 25 deletions(-) diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc index f386781447a..f7f22550b4f 100644 --- a/modules/openapi-generator-gradle-plugin/README.adoc +++ b/modules/openapi-generator-gradle-plugin/README.adoc @@ -377,6 +377,11 @@ openApiGenerate { |None |The input specification to validate. Supports all formats supported by the Parser. +|recommend +|Boolean +|true +|Whether or not to offer recommendations related to the validated specification document. + |=== === openApiMeta @@ -521,6 +526,7 @@ BUILD SUCCESSFUL in 0s ---- openApiValidate { inputSpec = "/src/openapi-generator/modules/openapi-generator/src/test/resources/3_0/petstore.yaml" + recommend = true } ---- diff --git a/modules/openapi-generator-gradle-plugin/gradle/wrapper/gradle-wrapper.properties b/modules/openapi-generator-gradle-plugin/gradle/wrapper/gradle-wrapper.properties index 44e7c4d1d7b..5b9bdfe705b 100644 --- a/modules/openapi-generator-gradle-plugin/gradle/wrapper/gradle-wrapper.properties +++ b/modules/openapi-generator-gradle-plugin/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Thu Jan 30 22:14:34 EST 2020 +distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index 6346e2c05d2..213341d8f11 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -96,6 +96,7 @@ clean assemble publishToMavenLocal + publishPluginMavenPublicationToMavenLocal diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle b/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle index c8c7e25dc0b..22a21f46c6f 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle @@ -28,6 +28,7 @@ openApiMeta { openApiValidate { inputSpec = "$rootDir/petstore-v3.0-invalid.yaml".toString() + recommend = true } // Builds a Kotlin client by default. diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle/wrapper/gradle-wrapper.jar b/modules/openapi-generator-gradle-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li*zci6H>!xF-5%fnMzTe}Rn-`JKV@8r`4xfA(sFfeF6Ai-!NkFDDTE zt3WUIroA9F#{DL(u9N(k$=}<5Kx59!OzMHZ@j{@{QaJP91J#R-7B4dDNdAlXZ_*2= z^%tbswBIC!eC&Vyq!+%?FG$nrzeylhX<+!~i{AXV$0_LD@$zR)XZ^(?{j(bW_Vokx z5VjY2^ydD?OK)NQiGSe%_5x2(@EaddLG-U5^1@x_1xcqEm|Okt=KjC)4gYXNKLa1S zXn^+HzlZJfAzWbW_OD?(s0*0B4SMVUvNnEoypmoZ! { description = "Validates an Open API 2.0 or 3.x specification document." inputSpec.set(validate.inputSpec) + recommend.set(validate.recommend) } create("openApiGenerate", GenerateTask::class.java) { diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorValidateExtension.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorValidateExtension.kt index cbf525bd7cb..72b9fb6bf2a 100644 --- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorValidateExtension.kt +++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorValidateExtension.kt @@ -29,4 +29,18 @@ open class OpenApiGeneratorValidateExtension(project: Project) { * The input specification to validate. Supports all formats supported by the Parser. */ val inputSpec = project.objects.property() + + /** + * Whether or not to offer recommendations related to the validated specification document. + */ + val recommend = project.objects.property() + + init { + applyDefaults() + } + + @Suppress("MemberVisibilityCanBePrivate") + fun applyDefaults(){ + recommend.set(true) + } } \ No newline at end of file diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/ValidateTask.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/ValidateTask.kt index 6e5283163ba..81e8d2ee984 100644 --- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/ValidateTask.kt +++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/ValidateTask.kt @@ -14,6 +14,8 @@ * limitations under the License. */ +@file:Suppress("UnstableApiUsage") + package org.openapitools.generator.gradle.plugin.tasks import io.swagger.parser.OpenAPIParser @@ -22,9 +24,12 @@ import org.gradle.api.GradleException import org.gradle.api.tasks.Internal import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.options.Option +import org.gradle.api.logging.Logging import org.gradle.internal.logging.text.StyledTextOutput import org.gradle.internal.logging.text.StyledTextOutputFactory import org.gradle.kotlin.dsl.property +import org.openapitools.codegen.validations.oas.OpenApiEvaluator +import org.openapitools.codegen.validations.oas.RuleConfiguration /** * A generator which validates an Open API spec. This task outputs a list of validation issues and errors. @@ -46,6 +51,9 @@ open class ValidateTask : DefaultTask() { @get:Internal var inputSpec = project.objects.property() + @get:Internal + var recommend = project.objects.property() + @Suppress("unused") @get:Internal @set:Option(option = "input", description = "The input specification.") @@ -57,13 +65,35 @@ open class ValidateTask : DefaultTask() { @Suppress("unused") @TaskAction fun doWork() { + val logger = Logging.getLogger(javaClass) + val spec = inputSpec.get() + val recommendations = recommend.get() + logger.quiet("Validating spec $spec") val result = OpenAPIParser().readLocation(spec, null, null) val messages = result.messages.toSet() val out = services.get(StyledTextOutputFactory::class.java).create("openapi") - if (messages.isNotEmpty()) { + + val ruleConfiguration = RuleConfiguration() + ruleConfiguration.isEnableRecommendations = recommendations + + val evaluator = OpenApiEvaluator(ruleConfiguration) + val validationResult = evaluator.validate(result.openAPI) + + if (validationResult.warnings.isNotEmpty()) { + out.withStyle(StyledTextOutput.Style.Info) + out.println("\nSpec has issues or recommendations.\nIssues:\n") + + validationResult.warnings.forEach { + out.withStyle(StyledTextOutput.Style.Info) + out.println("\t${it.message}\n") + logger.debug("WARNING: ${it.message}|${it.details}") + } + } + + if (messages.isNotEmpty() || validationResult.errors.isNotEmpty()) { out.withStyle(StyledTextOutput.Style.Error) out.println("\nSpec is invalid.\nIssues:\n") @@ -71,11 +101,19 @@ open class ValidateTask : DefaultTask() { messages.forEach { out.withStyle(StyledTextOutput.Style.Error) out.println("\t$it\n") + logger.debug("ERROR: $it") + } + + validationResult.errors.forEach { + out.withStyle(StyledTextOutput.Style.Error) + out.println("\t${it.message}\n") + logger.debug("ERROR: ${it.message}|${it.details}") } throw GradleException("Validation failed.") } else { out.withStyle(StyledTextOutput.Style.Success) + logger.debug("No error validations from swagger-parser or internal validations.") out.println("Spec is valid.") } } From 6f1ce5645ebf61b77ae0d6bc523b553f706d25c2 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Sat, 1 Feb 2020 05:50:11 -0800 Subject: [PATCH 66/85] [codegen] Add code comments and improve "first content" warning (#5184) * Add code comments and improve warning --- .../openapitools/codegen/DefaultCodegen.java | 13 ++++++++- .../codegen/utils/ModelUtils.java | 27 ++++++++++++++++--- 2 files changed, 36 insertions(+), 4 deletions(-) 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 4ebed00b41b..6d704fe9509 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 @@ -1593,9 +1593,13 @@ public class DefaultCodegen implements CodegenConfig { public String getSchemaType(Schema schema) { if (schema instanceof ComposedSchema) { // composed schema ComposedSchema cs = (ComposedSchema) schema; + // Get the interfaces, i.e. the set of elements under 'allOf', 'anyOf' or 'oneOf'. List schemas = ModelUtils.getInterfaces(cs); List names = new ArrayList<>(); + // Build a list of the schema types under each interface. + // For example, if a 'allOf' composed schema has $ref children, + // add the type of each child to the list of names. for (Schema s : schemas) { names.add(getSingleSchemaType(s)); } @@ -1637,7 +1641,8 @@ public class DefaultCodegen implements CodegenConfig { } else if (names.size() == 1) { return names.get(0); } else { - LOGGER.warn("allOf with multiple schemas defined. Using only the first one: {}. To fully utilize allOf, please use $ref instead of inline schema definition", names.get(0)); + LOGGER.warn("allOf with multiple schemas defined. Using only the first one: {}. " + + "To fully utilize allOf, please use $ref instead of inline schema definition", names.get(0)); return names.get(0); } } @@ -1670,6 +1675,12 @@ public class DefaultCodegen implements CodegenConfig { return "oneOf<" + String.join(",", names) + ">"; } + /** + * Return a string representation of the schema type, resolving aliasing and references if necessary. + * + * @param schema + * @return the string representation of the schema type. + */ private String getSingleSchemaType(Schema schema) { Schema unaliasSchema = ModelUtils.unaliasSchema(this.openAPI, schema); 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 a539cddb1fd..3872b11d872 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 @@ -791,15 +791,36 @@ public class ModelUtils { return getSchemaFromContent(response.getContent()); } + /** + * Return the first Schema from a specified OAS 'content' section. + * + * For example, given the following OAS, this method returns the schema + * for the 'application/json' content type because it is listed first in the OAS. + * + * responses: + * '200': + * content: + * application/json: + * schema: + * $ref: '#/components/schemas/XYZ' + * application/xml: + * ... + * + * @param content a 'content' section in the OAS specification. + * @return the Schema. + */ private static Schema getSchemaFromContent(Content content) { if (content == null || content.isEmpty()) { return null; } + Map.Entry entry = content.entrySet().iterator().next(); if (content.size() > 1) { - LOGGER.warn("Multiple schemas found in content, returning only the first one"); + // Other content types are currently ignored by codegen. If you see this warning, + // reorder the OAS spec to put the desired content type first. + LOGGER.warn("Multiple schemas found in the OAS 'content' section, returning only the first one ({})", + entry.getKey()); } - MediaType mediaType = content.values().iterator().next(); - return mediaType.getSchema(); + return entry.getValue().getSchema(); } /** From 20e5c5d6e714218b9d8a8441163df198eb3bf24d Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Sat, 1 Feb 2020 06:44:15 -0800 Subject: [PATCH 67/85] [Golang] Add support allOf inheritance with embedded go structs (#4934) * Golang: generate embedded structs and set supportsInheritance to true * Run bin/go-experimental-petstore.sh --- .../codegen/languages/AbstractGoCodegen.java | 29 +++++++ .../resources/go-experimental/model.mustache | 5 ++ .../src/main/resources/go/model.mustache | 4 +- .../src/main/resources/go/model_doc.mustache | 4 +- .../go-petstore/docs/BigCat.md | 78 ----------------- .../go-experimental/go-petstore/docs/Cat.md | 52 ------------ .../go-experimental/go-petstore/docs/Dog.md | 52 ------------ .../go-petstore/model_big_cat.go | 85 +------------------ .../go-experimental/go-petstore/model_cat.go | 51 +---------- .../go-experimental/go-petstore/model_dog.go | 51 +---------- .../go-experimental/go-petstore/docs/Cat.md | 52 ------------ .../go-experimental/go-petstore/docs/Dog.md | 52 ------------ .../go-experimental/go-petstore/model_cat.go | 51 +---------- .../go-experimental/go-petstore/model_dog.go | 51 +---------- 14 files changed, 43 insertions(+), 574 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java index 6b910f44676..24547880a79 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java @@ -51,6 +51,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege public AbstractGoCodegen() { super(); + supportsInheritance = true; hideGenerationTimestamp = Boolean.FALSE; defaultIncludes = new HashSet( @@ -332,6 +333,34 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege type = openAPIType; return type; } + + /** + * Determines the golang instantiation type of the specified schema. + * + * This function is called when the input schema is a map, and specifically + * when the 'additionalProperties' attribute is present in the OAS specification. + * Codegen invokes this function to resolve the "parent" association to + * 'additionalProperties'. + * + * Note the 'parent' attribute in the codegen model is used in the following scenarios: + * - Indicate a polymorphic association with some other type (e.g. class inheritance). + * - If the specification has a discriminator, cogegen create a “parent” based on the discriminator. + * - Use of the 'additionalProperties' attribute in the OAS specification. + * This is the specific scenario when codegen invokes this function. + * + * @param property the input schema + * + * @return the golang instantiation type of the specified property. + */ + @Override + public String toInstantiationType(Schema property) { + if (ModelUtils.isMapSchema(property)) { + return getTypeDeclaration(property); + } else if (ModelUtils.isArraySchema(property)) { + return getTypeDeclaration(property); + } + return super.toInstantiationType(property); + } @Override public String toOperationId(String operationId) { diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model.mustache index cbffd1fc340..ac200f650a5 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/model.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/model.mustache @@ -29,6 +29,11 @@ const ( {{^isEnum}} // {{classname}}{{#description}} {{{description}}}{{/description}}{{^description}} struct for {{{classname}}}{{/description}} type {{classname}} struct { +{{#parent}} +{{^isMapModel}} + {{{parent}}} +{{/isMapModel}} +{{/parent}} {{#vars}} {{^-first}} {{/-first}} diff --git a/modules/openapi-generator/src/main/resources/go/model.mustache b/modules/openapi-generator/src/main/resources/go/model.mustache index 201fd507ff9..f30047a9e21 100644 --- a/modules/openapi-generator/src/main/resources/go/model.mustache +++ b/modules/openapi-generator/src/main/resources/go/model.mustache @@ -29,14 +29,14 @@ const ( {{^isEnum}} // {{classname}}{{#description}} {{{description}}}{{/description}}{{^description}} struct for {{{classname}}}{{/description}} type {{classname}} struct { -{{#vars}} +{{#allVars}} {{^-first}} {{/-first}} {{#description}} // {{{description}}} {{/description}} {{name}} {{#isNullable}}*{{/isNullable}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}` -{{/vars}} +{{/allVars}} } {{/isEnum}} {{/model}} diff --git a/modules/openapi-generator/src/main/resources/go/model_doc.mustache b/modules/openapi-generator/src/main/resources/go/model_doc.mustache index e96a7f53257..ae517d4a75a 100644 --- a/modules/openapi-generator/src/main/resources/go/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_doc.mustache @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isNullable}}Pointer to {{/isNullable}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} -{{/vars}} +{{#allVars}}**{{name}}** | {{#isNullable}}Pointer to {{/isNullable}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/allVars}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/BigCat.md b/samples/client/petstore/go-experimental/go-petstore/docs/BigCat.md index dd23b619342..1f1f446d027 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/BigCat.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/BigCat.md @@ -4,88 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClassName** | Pointer to **string** | | -**Color** | Pointer to **string** | | [optional] [default to red] -**Declawed** | Pointer to **bool** | | [optional] **Kind** | Pointer to **string** | | [optional] ## Methods -### GetClassName - -`func (o *BigCat) GetClassName() string` - -GetClassName returns the ClassName field if non-nil, zero value otherwise. - -### GetClassNameOk - -`func (o *BigCat) GetClassNameOk() (string, bool)` - -GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### HasClassName - -`func (o *BigCat) HasClassName() bool` - -HasClassName returns a boolean if a field has been set. - -### SetClassName - -`func (o *BigCat) SetClassName(v string)` - -SetClassName gets a reference to the given string and assigns it to the ClassName field. - -### GetColor - -`func (o *BigCat) GetColor() string` - -GetColor returns the Color field if non-nil, zero value otherwise. - -### GetColorOk - -`func (o *BigCat) GetColorOk() (string, bool)` - -GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### HasColor - -`func (o *BigCat) HasColor() bool` - -HasColor returns a boolean if a field has been set. - -### SetColor - -`func (o *BigCat) SetColor(v string)` - -SetColor gets a reference to the given string and assigns it to the Color field. - -### GetDeclawed - -`func (o *BigCat) GetDeclawed() bool` - -GetDeclawed returns the Declawed field if non-nil, zero value otherwise. - -### GetDeclawedOk - -`func (o *BigCat) GetDeclawedOk() (bool, bool)` - -GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### HasDeclawed - -`func (o *BigCat) HasDeclawed() bool` - -HasDeclawed returns a boolean if a field has been set. - -### SetDeclawed - -`func (o *BigCat) SetDeclawed(v bool)` - -SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. - ### GetKind `func (o *BigCat) GetKind() string` diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Cat.md b/samples/client/petstore/go-experimental/go-petstore/docs/Cat.md index 0f2fe5a1f1f..c7ea3b3adfb 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Cat.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Cat.md @@ -4,62 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClassName** | Pointer to **string** | | -**Color** | Pointer to **string** | | [optional] [default to red] **Declawed** | Pointer to **bool** | | [optional] ## Methods -### GetClassName - -`func (o *Cat) GetClassName() string` - -GetClassName returns the ClassName field if non-nil, zero value otherwise. - -### GetClassNameOk - -`func (o *Cat) GetClassNameOk() (string, bool)` - -GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### HasClassName - -`func (o *Cat) HasClassName() bool` - -HasClassName returns a boolean if a field has been set. - -### SetClassName - -`func (o *Cat) SetClassName(v string)` - -SetClassName gets a reference to the given string and assigns it to the ClassName field. - -### GetColor - -`func (o *Cat) GetColor() string` - -GetColor returns the Color field if non-nil, zero value otherwise. - -### GetColorOk - -`func (o *Cat) GetColorOk() (string, bool)` - -GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### HasColor - -`func (o *Cat) HasColor() bool` - -HasColor returns a boolean if a field has been set. - -### SetColor - -`func (o *Cat) SetColor(v string)` - -SetColor gets a reference to the given string and assigns it to the Color field. - ### GetDeclawed `func (o *Cat) GetDeclawed() bool` diff --git a/samples/client/petstore/go-experimental/go-petstore/docs/Dog.md b/samples/client/petstore/go-experimental/go-petstore/docs/Dog.md index 4b5c332d8e1..ddc5be776dc 100644 --- a/samples/client/petstore/go-experimental/go-petstore/docs/Dog.md +++ b/samples/client/petstore/go-experimental/go-petstore/docs/Dog.md @@ -4,62 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClassName** | Pointer to **string** | | -**Color** | Pointer to **string** | | [optional] [default to red] **Breed** | Pointer to **string** | | [optional] ## Methods -### GetClassName - -`func (o *Dog) GetClassName() string` - -GetClassName returns the ClassName field if non-nil, zero value otherwise. - -### GetClassNameOk - -`func (o *Dog) GetClassNameOk() (string, bool)` - -GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### HasClassName - -`func (o *Dog) HasClassName() bool` - -HasClassName returns a boolean if a field has been set. - -### SetClassName - -`func (o *Dog) SetClassName(v string)` - -SetClassName gets a reference to the given string and assigns it to the ClassName field. - -### GetColor - -`func (o *Dog) GetColor() string` - -GetColor returns the Color field if non-nil, zero value otherwise. - -### GetColorOk - -`func (o *Dog) GetColorOk() (string, bool)` - -GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### HasColor - -`func (o *Dog) HasColor() bool` - -HasColor returns a boolean if a field has been set. - -### SetColor - -`func (o *Dog) SetColor(v string)` - -SetColor gets a reference to the given string and assigns it to the Color field. - ### GetBreed `func (o *Dog) GetBreed() string` diff --git a/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go b/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go index c9a0a1b6978..1960c5f32f6 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_big_cat.go @@ -16,93 +16,10 @@ import ( // BigCat struct for BigCat type BigCat struct { - ClassName string `json:"className"` - Color *string `json:"color,omitempty"` - Declawed *bool `json:"declawed,omitempty"` + Cat Kind *string `json:"kind,omitempty"` } -// GetClassName returns the ClassName field value -func (o *BigCat) GetClassName() string { - if o == nil { - var ret string - return ret - } - - return o.ClassName -} - -// SetClassName sets field value -func (o *BigCat) SetClassName(v string) { - o.ClassName = v -} - -// GetColor returns the Color field value if set, zero value otherwise. -func (o *BigCat) GetColor() string { - if o == nil || o.Color == nil { - var ret string - return ret - } - return *o.Color -} - -// GetColorOk returns a tuple with the Color field value if set, zero value otherwise -// and a boolean to check if the value has been set. -func (o *BigCat) GetColorOk() (string, bool) { - if o == nil || o.Color == nil { - var ret string - return ret, false - } - return *o.Color, true -} - -// HasColor returns a boolean if a field has been set. -func (o *BigCat) HasColor() bool { - if o != nil && o.Color != nil { - return true - } - - return false -} - -// SetColor gets a reference to the given string and assigns it to the Color field. -func (o *BigCat) SetColor(v string) { - o.Color = &v -} - -// GetDeclawed returns the Declawed field value if set, zero value otherwise. -func (o *BigCat) GetDeclawed() bool { - if o == nil || o.Declawed == nil { - var ret bool - return ret - } - return *o.Declawed -} - -// GetDeclawedOk returns a tuple with the Declawed field value if set, zero value otherwise -// and a boolean to check if the value has been set. -func (o *BigCat) GetDeclawedOk() (bool, bool) { - if o == nil || o.Declawed == nil { - var ret bool - return ret, false - } - return *o.Declawed, true -} - -// HasDeclawed returns a boolean if a field has been set. -func (o *BigCat) HasDeclawed() bool { - if o != nil && o.Declawed != nil { - return true - } - - return false -} - -// SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. -func (o *BigCat) SetDeclawed(v bool) { - o.Declawed = &v -} - // GetKind returns the Kind field value if set, zero value otherwise. func (o *BigCat) GetKind() string { if o == nil || o.Kind == nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_cat.go b/samples/client/petstore/go-experimental/go-petstore/model_cat.go index a9f83cc8c40..0303bc0826a 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_cat.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_cat.go @@ -16,59 +16,10 @@ import ( // Cat struct for Cat type Cat struct { - ClassName string `json:"className"` - Color *string `json:"color,omitempty"` + Animal Declawed *bool `json:"declawed,omitempty"` } -// GetClassName returns the ClassName field value -func (o *Cat) GetClassName() string { - if o == nil { - var ret string - return ret - } - - return o.ClassName -} - -// SetClassName sets field value -func (o *Cat) SetClassName(v string) { - o.ClassName = v -} - -// GetColor returns the Color field value if set, zero value otherwise. -func (o *Cat) GetColor() string { - if o == nil || o.Color == nil { - var ret string - return ret - } - return *o.Color -} - -// GetColorOk returns a tuple with the Color field value if set, zero value otherwise -// and a boolean to check if the value has been set. -func (o *Cat) GetColorOk() (string, bool) { - if o == nil || o.Color == nil { - var ret string - return ret, false - } - return *o.Color, true -} - -// HasColor returns a boolean if a field has been set. -func (o *Cat) HasColor() bool { - if o != nil && o.Color != nil { - return true - } - - return false -} - -// SetColor gets a reference to the given string and assigns it to the Color field. -func (o *Cat) SetColor(v string) { - o.Color = &v -} - // GetDeclawed returns the Declawed field value if set, zero value otherwise. func (o *Cat) GetDeclawed() bool { if o == nil || o.Declawed == nil { diff --git a/samples/client/petstore/go-experimental/go-petstore/model_dog.go b/samples/client/petstore/go-experimental/go-petstore/model_dog.go index eb2d7f05d41..17682057389 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_dog.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_dog.go @@ -16,59 +16,10 @@ import ( // Dog struct for Dog type Dog struct { - ClassName string `json:"className"` - Color *string `json:"color,omitempty"` + Animal Breed *string `json:"breed,omitempty"` } -// GetClassName returns the ClassName field value -func (o *Dog) GetClassName() string { - if o == nil { - var ret string - return ret - } - - return o.ClassName -} - -// SetClassName sets field value -func (o *Dog) SetClassName(v string) { - o.ClassName = v -} - -// GetColor returns the Color field value if set, zero value otherwise. -func (o *Dog) GetColor() string { - if o == nil || o.Color == nil { - var ret string - return ret - } - return *o.Color -} - -// GetColorOk returns a tuple with the Color field value if set, zero value otherwise -// and a boolean to check if the value has been set. -func (o *Dog) GetColorOk() (string, bool) { - if o == nil || o.Color == nil { - var ret string - return ret, false - } - return *o.Color, true -} - -// HasColor returns a boolean if a field has been set. -func (o *Dog) HasColor() bool { - if o != nil && o.Color != nil { - return true - } - - return false -} - -// SetColor gets a reference to the given string and assigns it to the Color field. -func (o *Dog) SetColor(v string) { - o.Color = &v -} - // GetBreed returns the Breed field value if set, zero value otherwise. func (o *Dog) GetBreed() string { if o == nil || o.Breed == nil { diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Cat.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Cat.md index 0f2fe5a1f1f..c7ea3b3adfb 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Cat.md +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Cat.md @@ -4,62 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClassName** | Pointer to **string** | | -**Color** | Pointer to **string** | | [optional] [default to red] **Declawed** | Pointer to **bool** | | [optional] ## Methods -### GetClassName - -`func (o *Cat) GetClassName() string` - -GetClassName returns the ClassName field if non-nil, zero value otherwise. - -### GetClassNameOk - -`func (o *Cat) GetClassNameOk() (string, bool)` - -GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### HasClassName - -`func (o *Cat) HasClassName() bool` - -HasClassName returns a boolean if a field has been set. - -### SetClassName - -`func (o *Cat) SetClassName(v string)` - -SetClassName gets a reference to the given string and assigns it to the ClassName field. - -### GetColor - -`func (o *Cat) GetColor() string` - -GetColor returns the Color field if non-nil, zero value otherwise. - -### GetColorOk - -`func (o *Cat) GetColorOk() (string, bool)` - -GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### HasColor - -`func (o *Cat) HasColor() bool` - -HasColor returns a boolean if a field has been set. - -### SetColor - -`func (o *Cat) SetColor(v string)` - -SetColor gets a reference to the given string and assigns it to the Color field. - ### GetDeclawed `func (o *Cat) GetDeclawed() bool` diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Dog.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Dog.md index 4b5c332d8e1..ddc5be776dc 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Dog.md +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Dog.md @@ -4,62 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ClassName** | Pointer to **string** | | -**Color** | Pointer to **string** | | [optional] [default to red] **Breed** | Pointer to **string** | | [optional] ## Methods -### GetClassName - -`func (o *Dog) GetClassName() string` - -GetClassName returns the ClassName field if non-nil, zero value otherwise. - -### GetClassNameOk - -`func (o *Dog) GetClassNameOk() (string, bool)` - -GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### HasClassName - -`func (o *Dog) HasClassName() bool` - -HasClassName returns a boolean if a field has been set. - -### SetClassName - -`func (o *Dog) SetClassName(v string)` - -SetClassName gets a reference to the given string and assigns it to the ClassName field. - -### GetColor - -`func (o *Dog) GetColor() string` - -GetColor returns the Color field if non-nil, zero value otherwise. - -### GetColorOk - -`func (o *Dog) GetColorOk() (string, bool)` - -GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### HasColor - -`func (o *Dog) HasColor() bool` - -HasColor returns a boolean if a field has been set. - -### SetColor - -`func (o *Dog) SetColor(v string)` - -SetColor gets a reference to the given string and assigns it to the Color field. - ### GetBreed `func (o *Dog) GetBreed() string` diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go index a9f83cc8c40..0303bc0826a 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go @@ -16,59 +16,10 @@ import ( // Cat struct for Cat type Cat struct { - ClassName string `json:"className"` - Color *string `json:"color,omitempty"` + Animal Declawed *bool `json:"declawed,omitempty"` } -// GetClassName returns the ClassName field value -func (o *Cat) GetClassName() string { - if o == nil { - var ret string - return ret - } - - return o.ClassName -} - -// SetClassName sets field value -func (o *Cat) SetClassName(v string) { - o.ClassName = v -} - -// GetColor returns the Color field value if set, zero value otherwise. -func (o *Cat) GetColor() string { - if o == nil || o.Color == nil { - var ret string - return ret - } - return *o.Color -} - -// GetColorOk returns a tuple with the Color field value if set, zero value otherwise -// and a boolean to check if the value has been set. -func (o *Cat) GetColorOk() (string, bool) { - if o == nil || o.Color == nil { - var ret string - return ret, false - } - return *o.Color, true -} - -// HasColor returns a boolean if a field has been set. -func (o *Cat) HasColor() bool { - if o != nil && o.Color != nil { - return true - } - - return false -} - -// SetColor gets a reference to the given string and assigns it to the Color field. -func (o *Cat) SetColor(v string) { - o.Color = &v -} - // GetDeclawed returns the Declawed field value if set, zero value otherwise. func (o *Cat) GetDeclawed() bool { if o == nil || o.Declawed == nil { diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go index eb2d7f05d41..17682057389 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go @@ -16,59 +16,10 @@ import ( // Dog struct for Dog type Dog struct { - ClassName string `json:"className"` - Color *string `json:"color,omitempty"` + Animal Breed *string `json:"breed,omitempty"` } -// GetClassName returns the ClassName field value -func (o *Dog) GetClassName() string { - if o == nil { - var ret string - return ret - } - - return o.ClassName -} - -// SetClassName sets field value -func (o *Dog) SetClassName(v string) { - o.ClassName = v -} - -// GetColor returns the Color field value if set, zero value otherwise. -func (o *Dog) GetColor() string { - if o == nil || o.Color == nil { - var ret string - return ret - } - return *o.Color -} - -// GetColorOk returns a tuple with the Color field value if set, zero value otherwise -// and a boolean to check if the value has been set. -func (o *Dog) GetColorOk() (string, bool) { - if o == nil || o.Color == nil { - var ret string - return ret, false - } - return *o.Color, true -} - -// HasColor returns a boolean if a field has been set. -func (o *Dog) HasColor() bool { - if o != nil && o.Color != nil { - return true - } - - return false -} - -// SetColor gets a reference to the given string and assigns it to the Color field. -func (o *Dog) SetColor(v string) { - o.Color = &v -} - // GetBreed returns the Breed field value if set, zero value otherwise. func (o *Dog) GetBreed() string { if o == nil || o.Breed == nil { From e86faa4ed12744dd30290b5c63dc1a300baad7e7 Mon Sep 17 00:00:00 2001 From: Tatsuro Shibamura Date: Sun, 2 Feb 2020 00:54:53 +0900 Subject: [PATCH 68/85] [csharp][csharp-netcore][csharp-dotnet2] Convert bool value to string in lower case (#5178) * Convert bool value to string in lower case * Update sample projects --- .../csharp-dotnet2/ApiClient.mustache | 2 ++ .../csharp-netcore/ClientUtils.mustache | 2 ++ .../main/resources/csharp/ApiClient.mustache | 2 ++ .../Org/OpenAPITools/Client/ApiClient.cs | 2 ++ .../Org.OpenAPITools/Client/ClientUtils.cs | 2 ++ .../Org.OpenAPITools/Client/ClientUtils.cs | 2 ++ .../src/Org.OpenAPITools/Client/ApiClient.cs | 2 ++ .../csharp/OpenAPIClientNet35/README.md | 2 +- .../csharp/OpenAPIClientNet35/docs/FakeApi.md | 8 +++---- .../src/Org.OpenAPITools/Api/FakeApi.cs | 12 +++++----- .../src/Org.OpenAPITools/Client/ApiClient.cs | 2 ++ .../csharp/OpenAPIClientNet40/README.md | 2 +- .../csharp/OpenAPIClientNet40/docs/FakeApi.md | 8 +++---- .../src/Org.OpenAPITools/Api/FakeApi.cs | 12 +++++----- .../src/Org.OpenAPITools/Client/ApiClient.cs | 2 ++ .../csharp/OpenAPIClientNetStandard/README.md | 2 +- .../OpenAPIClientNetStandard/docs/FakeApi.md | 8 +++---- .../src/Org.OpenAPITools/Api/FakeApi.cs | 24 +++++++++---------- .../src/Org.OpenAPITools/Client/ApiClient.cs | 2 ++ .../README.md | 2 +- .../docs/FakeApi.md | 8 +++---- .../src/Org.OpenAPITools/Api/FakeApi.cs | 24 +++++++++---------- .../src/Org.OpenAPITools/Client/ApiClient.cs | 2 ++ 23 files changed, 78 insertions(+), 56 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-dotnet2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-dotnet2/ApiClient.mustache index 4c8d13c5a99..c382839d898 100644 --- a/modules/openapi-generator/src/main/resources/csharp-dotnet2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-dotnet2/ApiClient.mustache @@ -148,6 +148,8 @@ namespace {{clientPackage}} // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return ((DateTime)obj).ToString (Configuration.DateTimeFormat); + else if (obj is bool) + return (bool)obj ? "true" : "false"; else if (obj is List) return String.Join(",", (obj as List).ToArray()); else diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache index b569ade0d66..4528441a5ab 100755 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache @@ -99,6 +99,8 @@ namespace {{packageName}}.Client // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return ((DateTimeOffset)obj).ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + else if (obj is bool) + return (bool)obj ? "true" : "false"; else { if (obj is IList) diff --git a/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache index 812ac789ae5..1b6ee4fa8ad 100644 --- a/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache @@ -297,6 +297,8 @@ namespace {{packageName}}.Client // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return ((DateTimeOffset)obj).ToString (Configuration.DateTimeFormat); + else if (obj is bool) + return (bool)obj ? "true" : "false"; else if (obj is IList) { var flattenedString = new StringBuilder(); diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs index 095f97997ec..934ae82628d 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs @@ -148,6 +148,8 @@ namespace Org.OpenAPITools.Client // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return ((DateTime)obj).ToString (Configuration.DateTimeFormat); + else if (obj is bool) + return (bool)obj ? "true" : "false"; else if (obj is List) return String.Join(",", (obj as List).ToArray()); else diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs index eb882784701..dde50ca71de 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -104,6 +104,8 @@ namespace Org.OpenAPITools.Client // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return ((DateTimeOffset)obj).ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + else if (obj is bool) + return (bool)obj ? "true" : "false"; else { if (obj is IList) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ClientUtils.cs index eb882784701..dde50ca71de 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -104,6 +104,8 @@ namespace Org.OpenAPITools.Client // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return ((DateTimeOffset)obj).ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + else if (obj is bool) + return (bool)obj ? "true" : "false"; else { if (obj is IList) diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs index 973dc3ec597..4d536076615 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs @@ -254,6 +254,8 @@ namespace Org.OpenAPITools.Client // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return ((DateTimeOffset)obj).ToString (Configuration.DateTimeFormat); + else if (obj is bool) + return (bool)obj ? "true" : "false"; else if (obj is IList) { var flattenedString = new StringBuilder(); diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/README.md b/samples/client/petstore/csharp/OpenAPIClientNet35/README.md index 5f55053b6f5..2e2e37841c4 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/README.md @@ -114,7 +114,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeApi.md index a295fe0554f..edffb58d3c7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**TestClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -616,9 +616,9 @@ No authorization required > void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null) -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example @@ -658,7 +658,7 @@ namespace Example try { - // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } catch (ApiException e) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs index 4064d18eb89..ec114cf37c7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs @@ -195,10 +195,10 @@ namespace Org.OpenAPITools.Api /// ApiResponse of ModelClient ApiResponse TestClientModelWithHttpInfo (ModelClient body); ///

    - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -219,10 +219,10 @@ namespace Org.OpenAPITools.Api void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -1073,7 +1073,7 @@ namespace Org.OpenAPITools.Api } /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -1097,7 +1097,7 @@ namespace Org.OpenAPITools.Api } /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Client/ApiClient.cs index 82cc839063b..0d0e5fad12f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Client/ApiClient.cs @@ -227,6 +227,8 @@ namespace Org.OpenAPITools.Client // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return ((DateTimeOffset)obj).ToString (Configuration.DateTimeFormat); + else if (obj is bool) + return (bool)obj ? "true" : "false"; else if (obj is IList) { var flattenedString = new StringBuilder(); diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/README.md b/samples/client/petstore/csharp/OpenAPIClientNet40/README.md index 5f55053b6f5..2e2e37841c4 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/README.md @@ -114,7 +114,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeApi.md index a295fe0554f..edffb58d3c7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**TestClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -616,9 +616,9 @@ No authorization required > void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null) -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example @@ -658,7 +658,7 @@ namespace Example try { - // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } catch (ApiException e) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeApi.cs index 7d8cf0e1ee6..7da4d32ecbc 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeApi.cs @@ -195,10 +195,10 @@ namespace Org.OpenAPITools.Api /// ApiResponse of ModelClient ApiResponse TestClientModelWithHttpInfo (ModelClient body); /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -219,10 +219,10 @@ namespace Org.OpenAPITools.Api void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -1073,7 +1073,7 @@ namespace Org.OpenAPITools.Api } /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -1097,7 +1097,7 @@ namespace Org.OpenAPITools.Api } /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Client/ApiClient.cs index 82cc839063b..0d0e5fad12f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Client/ApiClient.cs @@ -227,6 +227,8 @@ namespace Org.OpenAPITools.Client // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return ((DateTimeOffset)obj).ToString (Configuration.DateTimeFormat); + else if (obj is bool) + return (bool)obj ? "true" : "false"; else if (obj is IList) { var flattenedString = new StringBuilder(); diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/README.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/README.md index 87280d665a0..19c69aa88d0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/README.md @@ -90,7 +90,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeApi.md index a295fe0554f..edffb58d3c7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**TestClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -616,9 +616,9 @@ No authorization required > void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null) -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example @@ -658,7 +658,7 @@ namespace Example try { - // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } catch (ApiException e) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs index 9eb33690b17..6195602de81 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs @@ -195,10 +195,10 @@ namespace Org.OpenAPITools.Api /// ApiResponse of ModelClient ApiResponse TestClientModelWithHttpInfo (ModelClient body); /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -219,10 +219,10 @@ namespace Org.OpenAPITools.Api void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -553,10 +553,10 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse (ModelClient) System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body); /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -577,10 +577,10 @@ namespace Org.OpenAPITools.Api System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -2020,7 +2020,7 @@ namespace Org.OpenAPITools.Api } /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -2044,7 +2044,7 @@ namespace Org.OpenAPITools.Api } /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -2139,7 +2139,7 @@ namespace Org.OpenAPITools.Api } /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -2164,7 +2164,7 @@ namespace Org.OpenAPITools.Api } /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Client/ApiClient.cs index 3d9c30ab1fc..4b8e41dc2a1 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Client/ApiClient.cs @@ -259,6 +259,8 @@ namespace Org.OpenAPITools.Client // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return ((DateTimeOffset)obj).ToString (Configuration.DateTimeFormat); + else if (obj is bool) + return (bool)obj ? "true" : "false"; else if (obj is IList) { var flattenedString = new StringBuilder(); diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/README.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/README.md index 5f55053b6f5..2e2e37841c4 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/README.md @@ -114,7 +114,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeApi.md index a295fe0554f..edffb58d3c7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description [**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**TestClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters [**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -616,9 +616,9 @@ No authorization required > void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null) -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example @@ -658,7 +658,7 @@ namespace Example try { - // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } catch (ApiException e) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs index bc14d5e90f5..8739ddfa49a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs @@ -195,10 +195,10 @@ namespace Org.OpenAPITools.Api /// ApiResponse of ModelClient ApiResponse TestClientModelWithHttpInfo (ModelClient body); /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -219,10 +219,10 @@ namespace Org.OpenAPITools.Api void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -553,10 +553,10 @@ namespace Org.OpenAPITools.Api /// Task of ApiResponse (ModelClient) System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body); /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -577,10 +577,10 @@ namespace Org.OpenAPITools.Api System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -2020,7 +2020,7 @@ namespace Org.OpenAPITools.Api } /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -2044,7 +2044,7 @@ namespace Org.OpenAPITools.Api } /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -2139,7 +2139,7 @@ namespace Org.OpenAPITools.Api } /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None @@ -2164,7 +2164,7 @@ namespace Org.OpenAPITools.Api } /// - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// /// Thrown when fails to make API call /// None diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Client/ApiClient.cs index 973dc3ec597..4d536076615 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Client/ApiClient.cs @@ -254,6 +254,8 @@ namespace Org.OpenAPITools.Client // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 return ((DateTimeOffset)obj).ToString (Configuration.DateTimeFormat); + else if (obj is bool) + return (bool)obj ? "true" : "false"; else if (obj is IList) { var flattenedString = new StringBuilder(); From a8435d153e71d405f881c8d430c406160d07289a Mon Sep 17 00:00:00 2001 From: Tatsuro Shibamura Date: Sun, 2 Feb 2020 01:08:09 +0900 Subject: [PATCH 69/85] [csharp-netcore] Remove unnecessary legacy project definitions (#5108) * Remove unnecessary csproj definitions * Removed deprecated files generation * Fixed code generator compile error * Update sample code * Update sample projects * Revert "Removed deprecated files generation" This reverts commit c6841c2b54fac74d31a1cf59ea73d50c430609ba. * Revert "Fixed code generator compile error" This reverts commit cc0bd070e75d9fbc9620045105631fef8ca6fc1b. * Regenerate missing project.json file --- .../Org.OpenAPITools.Test.csproj | 5 --- .../Org.OpenAPITools.Test.csproj | 5 --- .../resources/csharp-netcore/Project.mustache | 15 ++++---- .../csharp-netcore/TestProject.mustache | 19 ++++------- .../csharp-netcore/netcore_project.mustache | 27 +++------------ .../netcore_testproject.mustache | 34 ++----------------- .../Org.OpenAPITools.Test.csproj | 5 --- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 15 ++++---- .../Org.OpenAPITools.Test.csproj | 5 --- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 25 +++----------- .../src/Org.OpenAPITools/project.json | 12 ------- 11 files changed, 32 insertions(+), 135 deletions(-) delete mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/project.json diff --git a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 6155a476849..4893f78082a 100644 --- a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -24,13 +24,8 @@ OpenAPI spec version: 1.0.0 - - - - - diff --git a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 6155a476849..4893f78082a 100644 --- a/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/CI/samples.ci/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -24,13 +24,8 @@ OpenAPI spec version: 1.0.0 - - - - - diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache index c0f69d349b6..bc7ff402032 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache @@ -34,15 +34,12 @@ {{releaseNote}}{{/releaseNote}}{{#packageTags}} {{{packageTags}}}{{/packageTags}} + - - - - - - - - - + + + + + diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache index a5d12469807..8be9bfd8620 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache @@ -22,20 +22,15 @@ 512 - - - - - - - - + + + - - {{packageGuid}} - {{packageName}} - + + {{packageGuid}} + {{packageName}} + diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache index ac52e613eb9..0346837de67 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache @@ -11,9 +11,6 @@ {{packageTitle}} {{packageDescription}} {{packageCopyright}} - true - true - true {{packageName}} {{packageVersion}} bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml{{#licenseId}} @@ -25,25 +22,11 @@ - - - - - + + + + + - {{^netStandard}} - - - - - - - - - - - - {{/netStandard}} - diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache index d6faf0b43f9..e75195ffea2 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_testproject.mustache @@ -2,45 +2,17 @@ {{testPackageName}} - {{testPackageName}} - Library - {{packageAuthors}} - {{packageCompany}} - {{packageTitle}} - {{packageDescription}} - {{packageCopyright}} - true - true - true {{testPackageName}} {{testTargetFramework}} false - - - - - - - + + + - {{^netStandard}} - - - - - - - - - - - - {{/netStandard}} - diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 6155a476849..4893f78082a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -24,13 +24,8 @@ OpenAPI spec version: 1.0.0 - - - - - diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj index f416158b591..5402a1dc233 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -28,15 +28,12 @@ The version of the OpenAPI document: 1.0.0 https://github.com/GIT_USER_ID/GIT_REPO_ID Minor update + - - - - - - - - - + + + + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj index 6155a476849..4893f78082a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj @@ -24,13 +24,8 @@ OpenAPI spec version: 1.0.0 - - - - - diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj index d30de15d9e1..13e44d29d9f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -11,9 +11,6 @@ OpenAPI Library A library generated from a OpenAPI doc No Copyright - true - true - true Org.OpenAPITools 1.0.0 bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml @@ -23,23 +20,11 @@ - - - - - - - - - - - - - - - - - + + + + + diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/project.json b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/project.json deleted file mode 100644 index 252f5b93e63..00000000000 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/project.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "supports": {}, - "dependencies": { - "Newtonsoft.Json": "12.0.1", - "CompareNETObjects": "4.57.0", - "JsonSubTypes": "1.5.2", - "RestSharp": "106.6.7" - }, - "frameworks": { - "netcoreapp2.0": {} - } -} From 8197a8a47bc9ca9d618c9b24460568d4c4ef3d87 Mon Sep 17 00:00:00 2001 From: Tatsuro Shibamura Date: Sun, 2 Feb 2020 01:26:27 +0900 Subject: [PATCH 70/85] Explicitly set `netCoreProjectFile` only for .NET Core target (#5151) --- .../codegen/languages/CSharpNetCoreClientCodegen.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 f21f156e200..779f2b66c5e 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 @@ -569,7 +569,10 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { setSupportsAsync(Boolean.TRUE); setNetStandard(strategy.isNetStandard); - setNetCoreProjectFileFlag(!strategy.isNetStandard); + + if (!strategy.isNetStandard) { + setNetCoreProjectFileFlag(true); + } if (additionalProperties.containsKey(CodegenConstants.GENERATE_PROPERTY_CHANGED)) { LOGGER.warn(CodegenConstants.GENERATE_PROPERTY_CHANGED + " is not supported in the .NET Standard generator."); From cd67822d68f46adc206908b246662705eced5ee0 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 2 Feb 2020 00:29:17 +0800 Subject: [PATCH 71/85] Add shibayan to C# technical committee (#5186) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 86b1546febe..75d9475a558 100644 --- a/README.md +++ b/README.md @@ -907,7 +907,7 @@ If you want to join the committee, please kindly apply by sending an email to te | Bash | @frol (2017/07) @bkryza (2017/08) @kenjones-cisco (2017/09) | | C | @zhemant (2018/11) @ityuhui (2019/12) | | C++ | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08) | -| C# | @mandrean (2017/08), @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert) @frankyjuang (2019/09) | +| C# | @mandrean (2017/08), @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert) @frankyjuang (2019/09) @shibayan (2020/02)| | Clojure | | | Dart | @ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) @nickmeinhold (2019/09) @athornz (2019/12) @amondnet (2019/12) | | Eiffel | @jvelilla (2017/09) | From 8d8c106c3a2675871b9d5d6fc7f35575779399f7 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Sat, 1 Feb 2020 12:42:15 -0800 Subject: [PATCH 72/85] [Go] Support HTTP signature (#4959) * add support for ECDSA keys * Add support for HTTP signature * use bytes.Buffer instead of strings.Builder * Add unit tests, compliance with HTTP signature draft version 12 * Support (expires) parameter * Validate list of signed headers does not have duplicate values * move method to ProcessUtils * Add http-signature security scheme * add http_signature_test to security scheme * remove http signature from petapi * Add separate OAS file with support for HTTP signature * Include HTTP signature in README file * Add generated files for HTTP signature * Add helper function to return public key, and add more unit tests for signature validation * some people save their private key with file extensions other than .pem, so I am relaxing the validation of the private key suffix --- bin/openapi3/go-experimental-petstore.sh | 6 +- .../GoClientExperimentalCodegen.java | 12 + .../resources/go-experimental/README.mustache | 36 +- .../resources/go-experimental/client.mustache | 13 +- .../go-experimental/configuration.mustache | 3 + .../http_signature_test.mustache | 720 +++++++++++++++++ .../go-experimental/signing.mustache | 414 ++++++++++ .../go-experimental/go-petstore/client.go | 1 - .../go-petstore/configuration.go | 3 + .../go-experimental/go-petstore/README.md | 44 +- .../go-petstore/api/openapi.yaml | 7 + .../go-experimental/go-petstore/client.go | 11 +- .../go-petstore/configuration.go | 3 + .../go-petstore/docs/PetApi.md | 8 +- .../go-petstore/http_signature_test.go | 728 ++++++++++++++++++ .../go-experimental/go-petstore/signing.go | 422 ++++++++++ 16 files changed, 2410 insertions(+), 21 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/go-experimental/http_signature_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/go-experimental/signing.mustache create mode 100644 samples/openapi3/client/petstore/go-experimental/go-petstore/http_signature_test.go create mode 100644 samples/openapi3/client/petstore/go-experimental/go-petstore/signing.go diff --git a/bin/openapi3/go-experimental-petstore.sh b/bin/openapi3/go-experimental-petstore.sh index 46c7841a280..901c8c62dc4 100755 --- a/bin/openapi3/go-experimental-petstore.sh +++ b/bin/openapi3/go-experimental-petstore.sh @@ -25,7 +25,11 @@ then mvn -B clean package fi -SPEC="modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml" +#SPEC="modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml" +# petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml is the same as the above file, with +# the addition of the HTTP signature security scheme. Ideally, this would have been directly added to +# petstore-with-fake-endpoints-models-for-testing.yaml, but this cannot be done until issue #5025 is resolved. +SPEC="modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml" GENERATOR="go-experimental" STUB_DIR="samples/openapi3/client/petstore/go-experimental/go-petstore" diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java index 5edabbefbd1..d7fa0c435a4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java @@ -16,11 +16,14 @@ package org.openapitools.codegen.languages; +import io.swagger.v3.oas.models.security.SecurityScheme; import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.CodegenSecurity; import org.openapitools.codegen.SupportingFile; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; +import org.openapitools.codegen.utils.ProcessUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -67,6 +70,15 @@ public class GoClientExperimentalCodegen extends GoClientCodegen { public void processOpts() { super.processOpts(); supportingFiles.add(new SupportingFile("utils.mustache", "", "utils.go")); + + // Generate the 'signing.py' module, but only if the 'HTTP signature' security scheme is specified in the OAS. + Map securitySchemeMap = openAPI != null ? + (openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null) : null; + List authMethods = fromSecurity(securitySchemeMap); + if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { + supportingFiles.add(new SupportingFile("signing.mustache", "", "signing.go")); + supportingFiles.add(new SupportingFile("http_signature_test.mustache", "", "http_signature_test.go")); + } } @Override diff --git a/modules/openapi-generator/src/main/resources/go-experimental/README.mustache b/modules/openapi-generator/src/main/resources/go-experimental/README.mustache index ca2082dc8dc..3f037b0be5a 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/README.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/README.mustache @@ -104,7 +104,9 @@ Class | Method | HTTP request | Description Note, each API key must be added to a map of `map[string]APIKey` where the key is: {{keyParamName}} and passed in as the auth context for each request. {{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication +{{#isBasic}} +{{#isBasicBasic}} +- **Type**: HTTP basic authentication Example @@ -116,6 +118,38 @@ auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAut r, err := client.Service.Operation(auth, args) ``` +{{/isBasicBasic}} +{{#isHttpSignature}} +- **Type**: HTTP signature authentication + +Example + +```golang + authConfig := sw.HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: "rsa.pem", + Passphrase: "my-passphrase", + SigningScheme: sw.HttpSigningSchemeHs2019, + SignedHeaders: []string{ + sw.HttpSignatureParameterRequestTarget, // The special (request-target) parameter expresses the HTTP request target. + sw.HttpSignatureParameterCreated, // Time when request was signed, formatted as a Unix timestamp integer value. + "Host", // The Host request header specifies the domain name of the server, and optionally the TCP port number. + "Date", // The date and time at which the message was originated. + "Content-Type", // The Media type of the body of the request. + "Digest", // A cryptographic digest of the request body. + }, + SigningAlgorithm: sw.HttpSigningAlgorithmRsaPSS, + SignatureMaxValidity: 5 * time.Minute, + } + var authCtx context.Context + var err error + if authCtx, err = authConfig.ContextWithValue(context.Background()); err != nil { + // Process error + } + r, err = client.Service.Operation(auth, args) + +``` +{{/isHttpSignature}} {{/isBasic}} {{#isOAuth}} diff --git a/modules/openapi-generator/src/main/resources/go-experimental/client.mustache b/modules/openapi-generator/src/main/resources/go-experimental/client.mustache index 6678caedfb8..b4567ea9d9e 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/client.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/client.mustache @@ -351,7 +351,18 @@ func (c *APIClient) prepareRequest( for header, value := range c.cfg.DefaultHeader { localVarRequest.Header.Add(header, value) } - +{{#hasHttpSignatureMethods}} + if ctx != nil { + // HTTP Signature Authentication. All request headers must be set (including default headers) + // because the headers may be included in the signature. + if auth, ok := ctx.Value(ContextHttpSignatureAuth).(HttpSignatureAuth); ok { + err = SignRequest(ctx, localVarRequest, auth) + if err != nil { + return nil, err + } + } + } +{{/hasHttpSignatureMethods}} return localVarRequest, nil } diff --git a/modules/openapi-generator/src/main/resources/go-experimental/configuration.mustache b/modules/openapi-generator/src/main/resources/go-experimental/configuration.mustache index d7b93eac06a..3cda1954db8 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/configuration.mustache @@ -31,6 +31,9 @@ var ( // ContextAPIKeys takes a string apikey as authentication for the request ContextAPIKeys = contextKey("apiKeys") + // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. + ContextHttpSignatureAuth = contextKey("httpsignature") + // ContextServerIndex uses a server configuration from the index. ContextServerIndex = contextKey("serverIndex") diff --git a/modules/openapi-generator/src/main/resources/go-experimental/http_signature_test.mustache b/modules/openapi-generator/src/main/resources/go-experimental/http_signature_test.mustache new file mode 100644 index 00000000000..79202f6f4af --- /dev/null +++ b/modules/openapi-generator/src/main/resources/go-experimental/http_signature_test.mustache @@ -0,0 +1,720 @@ +{{>partial_header}} +package {{packageName}} + +import ( + "bytes" + "context" + "crypto" + "crypto/ecdsa" + "crypto/rand" + "crypto/rsa" + "crypto/x509" + "encoding/asn1" + "encoding/base64" + "encoding/pem" + "fmt" + "io/ioutil" + "math/big" + "net/http" + "net/http/httputil" + "os" + "path/filepath" + "regexp" + "strings" + "testing" + "time" +) + +// Test RSA private key as published in Appendix C 'Test Values' of +// https://www.ietf.org/id/draft-cavage-http-signatures-12.txt +const rsaTestPrivateKey string = `-----BEGIN RSA PRIVATE KEY----- +MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF +NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F +UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB +AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA +QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK +kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg +f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u +412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc +mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7 +kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA +gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW +G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI +7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA== +-----END RSA PRIVATE KEY-----` + +func writeTestRsaPemKey(t *testing.T, filePath string) { + err := ioutil.WriteFile(filePath, []byte(rsaTestPrivateKey), 0644) + if err != nil { + t.Fatalf("Error writing private key: %v", err) + } +} + +type keyFormat int // The serialization format of the private key. + +const ( + keyFormatPem keyFormat = iota // Private key is serialized in PEM format. + keyFormatPkcs8Pem // Private key is serialized as PKCS#8 encoded in PEM format. + keyFormatPkcs8Der // Private key is serialized as PKCS#8 encoded in DER format. +) + +func writeRandomTestRsaPemKey(t *testing.T, filePath string, bits int, format keyFormat, passphrase string, alg *x509.PEMCipher) { + key, err := rsa.GenerateKey(rand.Reader, bits) + if err != nil { + t.Fatalf("Error generating RSA private key file: %v", err) + } + var outFile *os.File + outFile, err = os.Create(filePath) + if err != nil { + t.Fatalf("Error creating RSA private key file: %v", err) + } + defer outFile.Close() + var privKeyBytes []byte + switch format { + case keyFormatPem: + if passphrase != "" { + t.Fatalf("Encrypting PKCS#1-encoded private key with passphrase is not supported") + } + privKeyBytes = x509.MarshalPKCS1PrivateKey(key) + case keyFormatPkcs8Pem: + privKeyBytes, err = x509.MarshalPKCS8PrivateKey(key) + if err != nil { + t.Fatalf("Error writing private key: %v", err) + } + case keyFormatPkcs8Der: + if passphrase != "" { + t.Fatalf("Encrypting DER-encoded private key with passphrase is not supported") + } + privKeyBytes, err = x509.MarshalPKCS8PrivateKey(key) + if err != nil { + t.Fatalf("Error writing private key: %v", err) + } + _, err = outFile.Write(privKeyBytes) + if err != nil { + t.Fatalf("Error writing DER-encoded private key: %v", err) + } + default: + t.Fatalf("Unsupported key format: %v", format) + } + + switch format { + case keyFormatPem, keyFormatPkcs8Der: + var pemBlock *pem.Block + if passphrase == "" { + pemBlock = &pem.Block{ + Type: "RSA PRIVATE KEY", + Bytes: privKeyBytes, + } + } else { + pemBlock, err = x509.EncryptPEMBlock(rand.Reader, "ENCRYPTED PRIVATE KEY", privKeyBytes, []byte(passphrase), *alg) + if err != nil { + t.Fatalf("Error encoding RSA private key: %v", err) + } + } + err = pem.Encode(outFile, pemBlock) + if err != nil { + t.Fatalf("Error encoding RSA private key: %v", err) + } + } + fmt.Printf("Wrote private key '%s'\n", filePath) +} + +/* +Commented out because OpenAPITools is configured to use golang 1.8 at build time +x509.MarshalPKCS8PrivateKey is not present. +func writeRandomTestEcdsaPemKey(t *testing.T, filePath string) { + key, err := ecdsa.GenerateKey(elliptic.P521(), rand.Reader) + if err != nil { + t.Fatalf("Error generating ECDSA private key file: %v", err) + } + var outFile *os.File + outFile, err = os.Create(filePath) + if err != nil { + t.Fatalf("Error creating ECDSA private key file: %v", err) + } + defer outFile.Close() + + var keybytes []byte + keybytes, err = x509.MarshalPKCS8PrivateKey(key) + if err != nil { + t.Fatalf("Error marshaling ECDSA private key: %v", err) + } + var privateKey = &pem.Block{ + Type: "PRIVATE KEY", + Bytes: keybytes, + } + + err = pem.Encode(outFile, privateKey) + if err != nil { + t.Fatalf("Error encoding ECDSA private key: %v", err) + } +} +*/ + +// TestHttpSignaturePrivateKeys creates private keys of various sizes, serialization format, +// clear-text and password encrypted. +// Test unmarshaling of the private key. +func TestHttpSignaturePrivateKeys(t *testing.T) { + var err error + var dir string + dir, err = ioutil.TempDir("", "go-http-sign") + if err != nil { + t.Fatalf("Failed to create temporary directory") + } + defer os.RemoveAll(dir) + + pemCiphers := []x509.PEMCipher{ + x509.PEMCipherDES, + x509.PEMCipher3DES, + x509.PEMCipherAES128, + x509.PEMCipherAES192, + x509.PEMCipherAES256, + } + // Test RSA private keys with various key lengths. + for _, bits := range []int{1024, 2048, 3072, 4096} { + + for _, format := range []keyFormat{keyFormatPem, keyFormatPkcs8Pem, keyFormatPkcs8Der} { + // Generate test private key. + var privateKeyPath string + switch format { + case keyFormatPem, keyFormatPkcs8Pem: + privateKeyPath = "privatekey.pem" + case keyFormatPkcs8Der: + privateKeyPath = "privatekey.der" + default: + t.Fatalf("Unsupported private key format: %v", format) + } + privateKeyPath = filepath.Join(dir, privateKeyPath) + // Generate keys in PEM format. + writeRandomTestRsaPemKey(t, privateKeyPath, bits, format, "", nil) + + authConfig := HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: privateKeyPath, + Passphrase: "", + SigningScheme: "hs2019", + SignedHeaders: []string{"Content-Type"}, + } + + // Create a context with the HTTP signature configuration parameters. + _, err = authConfig.ContextWithValue(context.Background()) + if err != nil { + t.Fatalf("Error loading private key '%s': %v", privateKeyPath, err) + } + + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: privateKeyPath, + Passphrase: "my-secret-passphrase", + SigningScheme: "hs2019", + SignedHeaders: []string{"Content-Type"}, + } + switch format { + case keyFormatPem: + // Do nothing. Keys cannot be encrypted when using PKCS#1. + case keyFormatPkcs8Pem: + for _, alg := range pemCiphers { + writeRandomTestRsaPemKey(t, privateKeyPath, bits, format, authConfig.Passphrase, &alg) + _, err := authConfig.ContextWithValue(context.Background()) + if err != nil { + t.Fatalf("Error loading private key '%s': %v", privateKeyPath, err) + } + } + } + } + } + + /* + Unfortunately, currently the build environment for OpenAPITools is using an old version + of golang that does not support ECDSA keys. + { + privateKeyPath := "privatekey.pem" + authConfig := HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: "hs2019", + SignedHeaders: []string{"Content-Type"}, + } + // Generate test private key. + writeRandomTestEcdsaPemKey(t, privateKeyPath) + err := authConfig.LoadPrivateKey(privateKeyPath) + if err != nil { + t.Fatalf("Error loading private key '%s': %v", privateKeyPath, err) + } + } + */ +} + +const testHost = "petstore.swagger.io:80" +const testScheme = "http" + +func executeHttpSignatureAuth(t *testing.T, authConfig *HttpSignatureAuth, expectSuccess bool) string { + var err error + var dir string + dir, err = ioutil.TempDir("", "go-http-sign") + if err != nil { + t.Fatalf("Failed to create temporary directory") + } + defer os.RemoveAll(dir) + + cfg := NewConfiguration() + cfg.AddDefaultHeader("testheader", "testvalue") + cfg.AddDefaultHeader("Content-Type", "application/json") + cfg.Host = testHost + cfg.Scheme = testScheme + apiClient := NewAPIClient(cfg) + + privateKeyPath := filepath.Join(dir, "rsa.pem") + writeTestRsaPemKey(t, privateKeyPath) + authConfig.PrivateKeyPath = privateKeyPath + var authCtx context.Context + authCtx, err = authConfig.ContextWithValue(context.Background()) + if expectSuccess && err != nil { + t.Fatalf("Error validating HTTP signature configuration: %v", err) + } + if !expectSuccess && err != nil { + // Do not continue. Error is expected. + return "" + } + newPet := (Pet{Id: PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, + Status: PtrString("pending"), + Tags: &[]Tag{Tag{Id: PtrInt64(1), Name: PtrString("tag2")}}}) + + fmt.Printf("Request with HTTP signature. Scheme: '%s'. Algorithm: '%s'. MaxValidity: %v. Headers: '%v'\n", + authConfig.SigningScheme, authConfig.SigningAlgorithm, authConfig.SignatureMaxValidity, authConfig.SignedHeaders) + + r, err2 := apiClient.PetApi.AddPet(authCtx).Pet(newPet).Execute() + if expectSuccess && err2 != nil { + t.Fatalf("Error while adding pet: %v", err2) + } + if !expectSuccess { + if err2 == nil { + t.Fatalf("Error was expected, but no error was generated") + } else { + // Do not continue. Error is expected. + return "" + } + } + if r.StatusCode != 200 { + t.Log(r) + } + + _, r, err = apiClient.PetApi.GetPetById(authCtx, 12992).Execute() + if expectSuccess && err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + + // The request should look like this: + // + // GET /v2/pet/12992 HTTP/1.1 + // Host: petstore.swagger.io:80 + // Accept: application/json + // Authorization: Signature keyId="my-key-id",algorithm="hs2019",created=1579033245,headers="(request-target) date host digest content-type",signature="RMJZjVVxzlH02wlxiQgUYDe4QxZaI5IJNIfB2BK8Dhbv3WQ2gw0xyqC+5HiKUmT/cfchhhkUNNsUtiVRnjZmFwtSfYxHfiQvH3KWXlLCMwKGNQC3YzD9lnoWdx0pA5Kxbr0/ygmr3+lTyuN2PJg4IS7Ji/AaKAqIZx7RsHS8Bxw=" + // Date: Tue, 14 Jan 2020 06:41:22 GMT + // Digest: SHA-512=z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg== + // Testheader: testvalue + // User-Agent: OpenAPI-Generator/1.0.0/go + reqb, _ := httputil.DumpRequest(r.Request, true) + reqt := (string)(reqb) + fmt.Printf("REQUEST:\n%v\n", reqt) + var sb bytes.Buffer + fmt.Fprintf(&sb, `Signature keyId="%s",algorithm="%s",`, + authConfig.KeyId, authConfig.SigningScheme) + if len(authConfig.SignedHeaders) == 0 { + fmt.Fprintf(&sb, `created=[0-9]+,`) + } else { + for _, header := range authConfig.SignedHeaders { + header = strings.ToLower(header) + if header == HttpSignatureParameterCreated { + fmt.Fprintf(&sb, `created=[0-9]+,`) + } + if header == HttpSignatureParameterExpires { + fmt.Fprintf(&sb, `expires=[0-9]+\.[0-9]{3},`) + } + } + } + fmt.Fprintf(&sb, `headers="`) + for i, header := range authConfig.SignedHeaders { + header = strings.ToLower(header) + if i > 0 { + fmt.Fprintf(&sb, " ") + } + fmt.Fprintf(&sb, regexp.QuoteMeta(header)) + switch header { + case "date": + if !strings.Contains(reqt, "Date: ") { + t.Errorf("Date header is incorrect") + } + case "digest": + var prefix string + switch authConfig.SigningScheme { + case HttpSigningSchemeRsaSha256: + prefix = "SHA-256=" + default: + prefix = "SHA-512=" + } + if !strings.Contains(reqt, fmt.Sprintf("Digest: %s", prefix)) { + t.Errorf("Digest header is incorrect") + } + } + } + if len(authConfig.SignedHeaders) == 0 { + fmt.Fprintf(&sb, regexp.QuoteMeta(HttpSignatureParameterCreated)) + } + fmt.Fprintf(&sb, `",signature="[a-zA-Z0-9+/]+="`) + re := regexp.MustCompile(sb.String()) + actual := r.Request.Header.Get("Authorization") + if !re.MatchString(actual) { + t.Errorf("Authorization header is incorrect. Expected regex\n'%s'\nbut got\n'%s'", sb.String(), actual) + } + + validateHttpAuthorizationSignature(t, authConfig, r) + return r.Request.Header.Get("Authorization") +} + +var ( + // signatureRe is a regular expression to capture the fields from the signature. + signatureRe = regexp.MustCompile( + `Signature keyId="(?P[^"]+)",algorithm="(?P[^"]+)"` + + `(,created=(?P[0-9]+))?(,expires=(?P[0-9.]+))?,headers="(?P[^"]+)",signature="(?P[^"]+)"`) +) + +// validateHttpAuthorizationSignature validates the HTTP signature in the HTTP request. +// The signature verification would normally be done by the server. +// Note: this is NOT a complete implementation of the HTTP signature validation. This code is for unit test purpose, do not use +// it for server side implementation. +// In particular, this code does not validate the calculation of the HTTP body digest. +func validateHttpAuthorizationSignature(t *testing.T, authConfig *HttpSignatureAuth, r *http.Response) { + authHeader := r.Request.Header.Get("Authorization") + match := signatureRe.FindStringSubmatch(authHeader) + if len(match) < 3 { + t.Fatalf("Unexpected Authorization header: %s", authHeader) + } + result := make(map[string]string) + for i, name := range signatureRe.SubexpNames() { + if i != 0 && name != "" { + result[name] = match[i] + } + } + b64signature := result["signature"] + fmt.Printf("Algorithm: '%s' Headers: '%s' b64signature: '%s'\n", result["algorithm"], result["headers"], b64signature) + var sb bytes.Buffer + fmt.Fprintf(&sb, "%s %s", strings.ToLower(r.Request.Method), r.Request.URL.EscapedPath()) + if r.Request.URL.RawQuery != "" { + // The ":path" pseudo-header field includes the path and query parts + // of the target URI (the "path-absolute" production and optionally a + // '?' character followed by the "query" production (see Sections 3.3 + // and 3.4 of [RFC3986] + fmt.Fprintf(&sb, "?%s", r.Request.URL.RawQuery) + } + requestTarget := sb.String() + + var signedHeaderKvs []string + signedHeaders := strings.Split(result["headers"], " ") + for _, h := range signedHeaders { + var value string + switch h { + case HttpSignatureParameterRequestTarget: + value = requestTarget + case HttpSignatureParameterCreated: + value = result["created"] + case HttpSignatureParameterExpires: + value = result["expires"] + default: + value = r.Request.Header.Get(h) + } + signedHeaderKvs = append(signedHeaderKvs, fmt.Sprintf("%s: %s", h, value)) + } + stringToSign := strings.Join(signedHeaderKvs, "\n") + + var h crypto.Hash + switch result["algorithm"] { + case HttpSigningSchemeHs2019, HttpSigningSchemeRsaSha512: + h = crypto.SHA512 + case HttpSigningSchemeRsaSha256: + h = crypto.SHA256 + default: + t.Fatalf("Unexpected signing algorithm: %s", result["algorithm"]) + } + msgHash := h.New() + if _, err := msgHash.Write([]byte(stringToSign)); err != nil { + t.Fatalf("Unable to compute hash: %v", err) + } + d := msgHash.Sum(nil) + var pub crypto.PublicKey + var err error + if pub, err = authConfig.GetPublicKey(); err != nil { + t.Fatalf("Unable to get public key: %v", err) + } + if pub == nil { + t.Fatalf("Public key is nil") + } + var signature []byte + if signature, err = base64.StdEncoding.DecodeString(b64signature); err != nil { + t.Fatalf("Failed to decode signature: %v", err) + } + switch publicKey := pub.(type) { + case *rsa.PublicKey: + // It could be PKCS1v15 or PSS signature + var errPKCS1v15, errPSS error + // In a server-side implementation, we wouldn't try to validate both signatures. The specific + // signature algorithm would be derived from the key id. But here we just want to validate for unit test purpose. + errPKCS1v15 = rsa.VerifyPKCS1v15(publicKey, h, d, signature) + errPSS = rsa.VerifyPSS(publicKey, h, d, signature, nil) + if errPKCS1v15 != nil && errPSS != nil { + t.Fatalf("RSA Signature verification failed: %v. %v", errPKCS1v15, errPSS) + } + case *ecdsa.PublicKey: + type ecdsaSignature struct { + R, S *big.Int + } + var lEcdsa ecdsaSignature + if _, err = asn1.Unmarshal(signature, &lEcdsa); err != nil { + t.Fatalf("Unable to parse ECDSA signature: %v", err) + } + if !ecdsa.Verify(publicKey, d, lEcdsa.R, lEcdsa.S) { + t.Fatalf("ECDSA Signature verification failed") + } + default: + t.Fatalf("Unsupported public key: %T", pub) + } +} + +func TestHttpSignatureAuth(t *testing.T) { + // Test with 'hs2019' signature scheme, and default signature algorithm (RSA SSA PKCS1.5) + authConfig := HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{ + HttpSignatureParameterRequestTarget, // The special (request-target) parameter expresses the HTTP request target. + HttpSignatureParameterCreated, // Time when request was signed, formatted as a Unix timestamp integer value. + "Host", // The Host request header specifies the domain name of the server, and optionally the TCP port number. + "Date", // The date and time at which the message was originated. + "Content-Type", // The Media type of the body of the request. + "Digest", // A cryptographic digest of the request body. + }, + } + executeHttpSignatureAuth(t, &authConfig, true) + + // Test with duplicate headers. This is invalid and should be rejected. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{"Host", "Date", "Host"}, + } + executeHttpSignatureAuth(t, &authConfig, false) + + // Test with non-existent header. This is invalid and should be rejected. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{"Host", "Date", "Garbage-HeaderDoesNotExist"}, + } + executeHttpSignatureAuth(t, &authConfig, false) + + // Test with 'Authorization' header in the signed headers. This is invalid and should be rejected. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{"Host", "Authorization"}, + } + executeHttpSignatureAuth(t, &authConfig, false) + + // Specify signature max validity, but '(expires)' parameter is missing. This should cause an error. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignatureMaxValidity: 7 * time.Minute, + } + executeHttpSignatureAuth(t, &authConfig, false) + + // Specify invalid signature max validity. This should cause an error. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignatureMaxValidity: -3 * time.Minute, + } + executeHttpSignatureAuth(t, &authConfig, false) + + // Specify signature max validity and '(expires)' parameter. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignatureMaxValidity: time.Minute, + SignedHeaders: []string{ + HttpSignatureParameterRequestTarget, // The special (request-target) parameter expresses the HTTP request target. + HttpSignatureParameterCreated, // Time when request was signed, formatted as a Unix timestamp integer value. + HttpSignatureParameterExpires, // Time when signature expires. + }, + } + executeHttpSignatureAuth(t, &authConfig, true) + + // Specify '(expires)' parameter but no signature max validity. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{ + HttpSignatureParameterRequestTarget, // The special (request-target) parameter expresses the HTTP request target. + HttpSignatureParameterCreated, // Time when request was signed, formatted as a Unix timestamp integer value. + HttpSignatureParameterExpires, // Time when signature expires. + }, + } + executeHttpSignatureAuth(t, &authConfig, false) + + // Test with empty signed headers. The client should automatically add the "(created)" parameter by default. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{}, + } + executeHttpSignatureAuth(t, &authConfig, true) + + // Test with deprecated RSA-SHA512, some servers may still support it. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeRsaSha512, + SignedHeaders: []string{ + HttpSignatureParameterRequestTarget, // The special (request-target) parameter expresses the HTTP request target. + HttpSignatureParameterCreated, // Time when request was signed, formatted as a Unix timestamp integer value. + "Host", // The Host request header specifies the domain name of the server, and optionally the TCP port number. + "Date", // The date and time at which the message was originated. + "Content-Type", // The Media type of the body of the request. + "Digest", // A cryptographic digest of the request body. + }, + } + executeHttpSignatureAuth(t, &authConfig, true) + + // Test with deprecated RSA-SHA256, some servers may still support it. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeRsaSha256, + SignedHeaders: []string{ + HttpSignatureParameterRequestTarget, // The special (request-target) parameter expresses the HTTP request target. + HttpSignatureParameterCreated, // Time when request was signed, formatted as a Unix timestamp integer value. + "Host", // The Host request header specifies the domain name of the server, and optionally the TCP port number. + "Date", // The date and time at which the message was originated. + "Content-Type", // The Media type of the body of the request. + "Digest", // A cryptographic digest of the request body. + }, + } + executeHttpSignatureAuth(t, &authConfig, true) + + // Test with headers without date. This makes it possible to get a fixed signature, used for unit test purpose. + // This should not be used in production code as it could potentially allow replay attacks. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SigningAlgorithm: HttpSigningAlgorithmRsaPKCS1v15, + SignedHeaders: []string{ + HttpSignatureParameterRequestTarget, + "Host", // The Host request header specifies the domain name of the server, and optionally the TCP port number. + "Content-Type", // The Media type of the body of the request. + "Digest", // A cryptographic digest of the request body. + }, + } + authorizationHeaderValue := executeHttpSignatureAuth(t, &authConfig, true) + expectedSignature := "sXE2MDeW8os6ywv1oUWaFEPFcSPCEb/msQ/NZGKNA9Emm/e42axaAPojzfkZ9Hacyw/iS/5nH4YIkczMgXu3z5fAwFjumxtf3OxbqvUcQ80wvw2/7B5aQmsF6ZwrCFHZ+L/cj9/bg7L1EGUGtdyDzoRKti4zf9QF/03OsP7QljI=" + expectedAuthorizationHeader := fmt.Sprintf( + `Signature keyId="my-key-id",`+ + `algorithm="hs2019",headers="(request-target) host content-type digest",`+ + `signature="%s"`, expectedSignature) + if authorizationHeaderValue != expectedAuthorizationHeader { + t.Errorf("Authorization header value is incorrect. Got\n'%s'\nbut expected\n'%s'", authorizationHeaderValue, expectedAuthorizationHeader) + } + + // Test with PSS signature. The PSS signature creates a new signature every time it is invoked. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SigningAlgorithm: HttpSigningAlgorithmRsaPSS, + SignedHeaders: []string{ + HttpSignatureParameterRequestTarget, + "Host", // The Host request header specifies the domain name of the server, and optionally the TCP port number. + "Content-Type", // The Media type of the body of the request. + "Digest", // A cryptographic digest of the request body. + }, + } + authorizationHeaderValue = executeHttpSignatureAuth(t, &authConfig, true) + expectedSignature = `[a-zA-Z0-9+/]+=` + expectedAuthorizationHeader = fmt.Sprintf( + `Signature keyId="my-key-id",`+ + `algorithm="hs2019",headers="\(request-target\) host content-type digest",`+ + `signature="%s"`, expectedSignature) + re := regexp.MustCompile(expectedAuthorizationHeader) + if !re.MatchString(authorizationHeaderValue) { + t.Errorf("Authorization header value is incorrect. Got\n'%s'\nbut expected\n'%s'", authorizationHeaderValue, expectedAuthorizationHeader) + } +} + +func TestInvalidHttpSignatureConfiguration(t *testing.T) { + var err error + var authConfig HttpSignatureAuth + + authConfig = HttpSignatureAuth{ + } + _, err = authConfig.ContextWithValue(context.Background()) + if err == nil || !strings.Contains(err.Error(), "Key ID must be specified") { + t.Fatalf("Invalid configuration: %v", err) + } + + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + } + _, err = authConfig.ContextWithValue(context.Background()) + if err == nil || !strings.Contains(err.Error(), "Private key path must be specified") { + t.Fatalf("Invalid configuration: %v", err) + } + + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: "test.pem", + } + _, err = authConfig.ContextWithValue(context.Background()) + if err == nil || !strings.Contains(err.Error(), "Invalid signing scheme") { + t.Fatalf("Invalid configuration: %v", err) + } + + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: "test.pem", + SigningScheme: "garbage", + } + _, err = authConfig.ContextWithValue(context.Background()) + if err == nil || !strings.Contains(err.Error(), "Invalid signing scheme") { + t.Fatalf("Invalid configuration: %v", err) + } + + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: "test.pem", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{"foo", "bar", "foo"}, + } + _, err = authConfig.ContextWithValue(context.Background()) + if err == nil || !strings.Contains(err.Error(), "cannot have duplicate names") { + t.Fatalf("Invalid configuration: %v", err) + } + + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: "test.pem", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{"foo", "bar", "Authorization"}, + } + _, err = authConfig.ContextWithValue(context.Background()) + if err == nil || !strings.Contains(err.Error(), "Signed headers cannot include the 'Authorization' header") { + t.Fatalf("Invalid configuration: %v", err) + } + + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: "test.pem", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{"foo", "bar"}, + SignatureMaxValidity: -7 * time.Minute, + } + _, err = authConfig.ContextWithValue(context.Background()) + if err == nil || !strings.Contains(err.Error(), "Signature max validity must be a positive value") { + t.Fatalf("Invalid configuration: %v", err) + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/go-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/go-experimental/signing.mustache new file mode 100644 index 00000000000..0dbfd0e5fa4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/go-experimental/signing.mustache @@ -0,0 +1,414 @@ +{{>partial_header}} +package {{packageName}} + +import ( + "bytes" + "context" + "crypto" + "crypto/ecdsa" + "crypto/rand" + "crypto/rsa" + "crypto/x509" + "encoding/base64" + "encoding/pem" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/textproto" + "os" + "strings" + "time" +) + +const ( + // Constants for HTTP signature parameters. + // The '(request-target)' parameter concatenates the lowercased :method, an + // ASCII space, and the :path pseudo-headers. + HttpSignatureParameterRequestTarget string = "(request-target)" + // The '(created)' parameter expresses when the signature was + // created. The value MUST be a Unix timestamp integer value. + HttpSignatureParameterCreated string = "(created)" + // The '(expires)' parameter expresses when the signature ceases to + // be valid. The value MUST be a Unix timestamp integer value. + HttpSignatureParameterExpires string = "(expires)" +) + +const ( + // Constants for HTTP headers. + // The 'Host' header, as defined in RFC 2616, section 14.23. + HttpHeaderHost string = "Host" + // The 'Date' header. + HttpHeaderDate string = "Date" + // The digest header, as defined in RFC 3230, section 4.3.2. + HttpHeaderDigest string = "Digest" + // The HTTP Authorization header, as defined in RFC 7235, section 4.2. + HttpHeaderAuthorization string = "Authorization" +) + +const ( + // Specifies the Digital Signature Algorithm is derived from metadata + // associated with 'keyId'. Supported DSA algorithms are RSASSA-PKCS1-v1_5, + // RSASSA-PSS, and ECDSA. + // The hash is SHA-512. + // This is the default value. + HttpSigningSchemeHs2019 string = "hs2019" + // Use RSASSA-PKCS1-v1_5 with SHA-512 hash. Deprecated. + HttpSigningSchemeRsaSha512 string = "rsa-sha512" + // Use RSASSA-PKCS1-v1_5 with SHA-256 hash. Deprecated. + HttpSigningSchemeRsaSha256 string = "rsa-sha256" + + // RFC 8017 section 7.2 + // Calculate the message signature using RSASSA-PKCS1-V1_5-SIGN from RSA PKCS#1 v1.5. + // PKCSV1_5 is deterministic. The same message and key will produce an identical + // signature value each time. + HttpSigningAlgorithmRsaPKCS1v15 string = "RSASSA-PKCS1-v1_5" + // Calculate the message signature using probabilistic signature scheme RSASSA-PSS. + // PSS is randomized and will produce a different signature value each time. + HttpSigningAlgorithmRsaPSS string = "RSASSA-PSS" +) + +var supportedSigningSchemes = map[string]bool{ + HttpSigningSchemeHs2019: true, + HttpSigningSchemeRsaSha512: true, + HttpSigningSchemeRsaSha256: true, +} + + +// HttpSignatureAuth provides HTTP signature authentication to a request passed +// via context using ContextHttpSignatureAuth. +// An 'Authorization' header is calculated by creating a hash of select headers, +// and optionally the body of the HTTP request, then signing the hash value using +// a private key which is available to the client. +// +// SignedHeaders specifies the list of HTTP headers that are included when generating +// the message signature. +// The two special signature headers '(request-target)' and '(created)' SHOULD be +// included in SignedHeaders. +// The '(created)' header expresses when the signature was created. +// The '(request-target)' header is a concatenation of the lowercased :method, an +// ASCII space, and the :path pseudo-headers. +// +// For example, SignedHeaders can be set to: +// (request-target) (created) date host digest +// +// When SignedHeaders is not specified, the client defaults to a single value, '(created)', +// in the list of HTTP headers. +// When SignedHeaders contains the 'Digest' value, the client performs the following operations: +// 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. +// 2. Set the 'Digest' header in the request body. +// 3. Include the 'Digest' header and value in the HTTP signature. +type HttpSignatureAuth struct { + KeyId string // A key identifier. + PrivateKeyPath string // The path to the private key. + Passphrase string // The passphrase to decrypt the private key, if the key is encrypted. + SigningScheme string // The signature scheme, when signing HTTP requests. Supported value is 'hs2019'. + // The signature algorithm, when signing HTTP requests. + // Supported values are RSASSA-PKCS1-v1_5, RSASSA-PSS. + SigningAlgorithm string + SignedHeaders []string // A list of HTTP headers included when generating the signature for the message. + // SignatureMaxValidity specifies the maximum duration of the signature validity. + // The value is used to set the '(expires)' signature parameter in the HTTP request. + // '(expires)' is set to '(created)' plus the value of the SignatureMaxValidity field. + // To specify the '(expires)' signature parameter, set 'SignatureMaxValidity' and add '(expires)' to 'SignedHeaders'. + SignatureMaxValidity time.Duration + privateKey crypto.PrivateKey // The private key used to sign HTTP requests. +} + +// ContextWithValue validates the HttpSignatureAuth configuration parameters and returns a context +// suitable for HTTP signature. An error is returned if the HttpSignatureAuth configuration parameters +// are invalid. +func (h *HttpSignatureAuth) ContextWithValue(ctx context.Context) (context.Context, error) { + if h.KeyId == "" { + return nil, fmt.Errorf("Key ID must be specified") + } + if h.PrivateKeyPath == "" { + return nil, fmt.Errorf("Private key path must be specified") + } + if _, ok := supportedSigningSchemes[h.SigningScheme]; !ok { + return nil, fmt.Errorf("Invalid signing scheme: '%v'", h.SigningScheme) + } + m := make(map[string]bool) + for _, h := range h.SignedHeaders { + if strings.ToLower(h) == strings.ToLower(HttpHeaderAuthorization) { + return nil, fmt.Errorf("Signed headers cannot include the 'Authorization' header") + } + m[h] = true + } + if len(m) != len(h.SignedHeaders) { + return nil, fmt.Errorf("List of signed headers cannot have duplicate names") + } + if h.SignatureMaxValidity < 0 { + return nil, fmt.Errorf("Signature max validity must be a positive value") + } + if err := h.loadPrivateKey(); err != nil { + return nil, err + } + return context.WithValue(ctx, ContextHttpSignatureAuth, *h), nil +} + +// GetPublicKey returns the public key associated with this HTTP signature configuration. +func (h *HttpSignatureAuth) GetPublicKey() (crypto.PublicKey, error) { + if h.privateKey == nil { + if err := h.loadPrivateKey(); err != nil { + return nil, err + } + } + switch key := h.privateKey.(type) { + case *rsa.PrivateKey: + return key.Public(), nil + case *ecdsa.PrivateKey: + return key.Public(), nil + default: + // Do not change '%T' to anything else such as '%v'! + // The value of the private key must not be returned. + return nil, fmt.Errorf("Unsupported key: %T", h.privateKey) + } +} + +// loadPrivateKey reads the private key from the file specified in the HttpSignatureAuth. +func (h *HttpSignatureAuth) loadPrivateKey() (err error) { + var file *os.File + file, err = os.Open(h.PrivateKeyPath) + if err != nil { + return fmt.Errorf("Cannot load private key '%s'. Error: %v", h.PrivateKeyPath, err) + } + defer func() { + err = file.Close() + }() + var priv []byte + priv, err = ioutil.ReadAll(file) + if err != nil { + return err + } + pemBlock, _ := pem.Decode(priv) + if pemBlock == nil { + // No PEM data has been found. + return fmt.Errorf("File '%s' does not contain PEM data", h.PrivateKeyPath) + } + var privKey []byte + if x509.IsEncryptedPEMBlock(pemBlock) { + // The PEM data is encrypted. + privKey, err = x509.DecryptPEMBlock(pemBlock, []byte(h.Passphrase)) + if err != nil { + // Failed to decrypt PEM block. Because of deficiencies in the encrypted-PEM format, + // it's not always possibleto detect an incorrect password. + return err + } + } else { + privKey = pemBlock.Bytes + } + switch pemBlock.Type { + case "RSA PRIVATE KEY": + if h.privateKey, err = x509.ParsePKCS1PrivateKey(privKey); err != nil { + return err + } + case "EC PRIVATE KEY", "PRIVATE KEY": + // https://tools.ietf.org/html/rfc5915 section 4. + if h.privateKey, err = x509.ParsePKCS8PrivateKey(privKey); err != nil { + return err + } + default: + return fmt.Errorf("Key '%s' is not supported", pemBlock.Type) + } + return nil +} + +// SignRequest signs the request using HTTP signature. +// See https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ +// +// Do not add, remove or change headers that are included in the SignedHeaders +// after SignRequest has been invoked; this is because the header values are +// included in the signature. Any subsequent alteration will cause a signature +// verification failure. +// If there are multiple instances of the same header field, all +// header field values associated with the header field MUST be +// concatenated, separated by a ASCII comma and an ASCII space +// ', ', and used in the order in which they will appear in the +// transmitted HTTP message. +func SignRequest( + ctx context.Context, + r *http.Request, + auth HttpSignatureAuth) error { + + if auth.privateKey == nil { + return fmt.Errorf("Private key is not set") + } + now := time.Now() + date := now.UTC().Format(http.TimeFormat) + // The 'created' field expresses when the signature was created. + // The value MUST be a Unix timestamp integer value. See 'HTTP signature' section 2.1.4. + created := now.Unix() + + var h crypto.Hash + var err error + var prefix string + var expiresUnix float64 + + if auth.SignatureMaxValidity < 0 { + return fmt.Errorf("Signature validity must be a positive value") + } + if auth.SignatureMaxValidity > 0 { + e := now.Add(auth.SignatureMaxValidity) + expiresUnix = float64(e.Unix()) + float64(e.Nanosecond()) / float64(time.Second) + } + // Determine the cryptographic hash to be used for the signature and the body digest. + switch auth.SigningScheme { + case HttpSigningSchemeRsaSha512, HttpSigningSchemeHs2019: + h = crypto.SHA512 + prefix = "SHA-512=" + case HttpSigningSchemeRsaSha256: + // This is deprecated and should no longer be used. + h = crypto.SHA256 + prefix = "SHA-256=" + default: + return fmt.Errorf("Unsupported signature scheme: %v", auth.SigningScheme) + } + if !h.Available() { + return fmt.Errorf("Hash '%v' is not available", h) + } + + // Build the "(request-target)" signature header. + var sb bytes.Buffer + fmt.Fprintf(&sb, "%s %s", strings.ToLower(r.Method), r.URL.EscapedPath()) + if r.URL.RawQuery != "" { + // The ":path" pseudo-header field includes the path and query parts + // of the target URI (the "path-absolute" production and optionally a + // '?' character followed by the "query" production (see Sections 3.3 + // and 3.4 of [RFC3986] + fmt.Fprintf(&sb, "?%s", r.URL.RawQuery) + } + requestTarget := sb.String() + sb.Reset() + + // Build the string to be signed. + signedHeaders := auth.SignedHeaders + if len(signedHeaders) == 0 { + signedHeaders = []string{HttpSignatureParameterCreated} + } + // Validate the list of signed headers has no duplicates. + m := make(map[string]bool) + for _, h := range signedHeaders { + m[h] = true + } + if len(m) != len(signedHeaders) { + return fmt.Errorf("List of signed headers must not have any duplicates") + } + hasCreatedParameter := false + hasExpiresParameter := false + for i, header := range signedHeaders { + header = strings.ToLower(header) + var value string + switch header { + case strings.ToLower(HttpHeaderAuthorization): + return fmt.Errorf("Cannot include the 'Authorization' header as a signed header.") + case HttpSignatureParameterRequestTarget: + value = requestTarget + case HttpSignatureParameterCreated: + value = fmt.Sprintf("%d", created) + hasCreatedParameter = true + case HttpSignatureParameterExpires: + if auth.SignatureMaxValidity.Nanoseconds() == 0 { + return fmt.Errorf("Cannot set '(expires)' signature parameter. SignatureMaxValidity is not configured.") + } + value = fmt.Sprintf("%.3f", expiresUnix) + hasExpiresParameter = true + case "date": + value = date + r.Header.Set(HttpHeaderDate, date) + case "digest": + // Calculate the digest of the HTTP request body. + // Calculate body digest per RFC 3230 section 4.3.2 + bodyHash := h.New() + if r.Body != nil { + // Make a copy of the body io.Reader so that we can read the body to calculate the hash, + // then one more time when marshaling the request. + var body io.Reader + body, err = r.GetBody() + if err != nil { + return err + } + if _, err = io.Copy(bodyHash, body); err != nil { + return err + } + } + d := bodyHash.Sum(nil) + value = prefix + base64.StdEncoding.EncodeToString(d) + r.Header.Set(HttpHeaderDigest, value) + case "host": + value = r.Host + r.Header.Set(HttpHeaderHost, r.Host) + default: + var ok bool + var v []string + canonicalHeader := textproto.CanonicalMIMEHeaderKey(header) + if v, ok = r.Header[canonicalHeader]; !ok { + // If a header specified in the headers parameter cannot be matched with + // a provided header in the message, the implementation MUST produce an error. + return fmt.Errorf("Header '%s' does not exist in the request", canonicalHeader) + } + // If there are multiple instances of the same header field, all + // header field values associated with the header field MUST be + // concatenated, separated by a ASCII comma and an ASCII space + // `, `, and used in the order in which they will appear in the + // transmitted HTTP message. + value = strings.Join(v, ", ") + } + if i > 0 { + fmt.Fprintf(&sb, "\n") + } + fmt.Fprintf(&sb, "%s: %s", header, value) + } + if expiresUnix != 0 && !hasExpiresParameter { + return fmt.Errorf("SignatureMaxValidity is specified, but '(expired)' parameter is not present") + } + msg := []byte(sb.String()) + msgHash := h.New() + if _, err = msgHash.Write(msg); err != nil { + return err + } + d := msgHash.Sum(nil) + + var signature []byte + switch key := auth.privateKey.(type) { + case *rsa.PrivateKey: + switch auth.SigningAlgorithm { + case HttpSigningAlgorithmRsaPKCS1v15: + signature, err = rsa.SignPKCS1v15(rand.Reader, key, h, d) + case "", HttpSigningAlgorithmRsaPSS: + signature, err = rsa.SignPSS(rand.Reader, key, h, d, nil) + default: + return fmt.Errorf("Unsupported signing algorithm: '%s'", auth.SigningAlgorithm) + } + case *ecdsa.PrivateKey: + signature, err = key.Sign(rand.Reader, d, h) + //case ed25519.PrivateKey: requires go 1.13 + // signature, err = key.Sign(rand.Reader, msg, crypto.Hash(0)) + default: + return fmt.Errorf("Unsupported private key") + } + if err != nil { + return err + } + + sb.Reset() + for i, header := range signedHeaders { + if i > 0 { + sb.WriteRune(' ') + } + sb.WriteString(strings.ToLower(header)) + } + headers_list := sb.String() + sb.Reset() + fmt.Fprintf(&sb, `Signature keyId="%s",algorithm="%s",`, auth.KeyId, auth.SigningScheme) + if hasCreatedParameter { + fmt.Fprintf(&sb, "created=%d,", created) + } + if hasExpiresParameter { + fmt.Fprintf(&sb, "expires=%.3f,", expiresUnix) + } + fmt.Fprintf(&sb, `headers="%s",signature="%s"`, headers_list, base64.StdEncoding.EncodeToString(signature)) + authStr := sb.String() + r.Header.Set(HttpHeaderAuthorization, authStr) + return nil +} diff --git a/samples/client/petstore/go-experimental/go-petstore/client.go b/samples/client/petstore/go-experimental/go-petstore/client.go index 4c4ecf168f4..2f97c129ab1 100644 --- a/samples/client/petstore/go-experimental/go-petstore/client.go +++ b/samples/client/petstore/go-experimental/go-petstore/client.go @@ -362,7 +362,6 @@ func (c *APIClient) prepareRequest( for header, value := range c.cfg.DefaultHeader { localVarRequest.Header.Add(header, value) } - return localVarRequest, nil } diff --git a/samples/client/petstore/go-experimental/go-petstore/configuration.go b/samples/client/petstore/go-experimental/go-petstore/configuration.go index 153d3a46ef3..4c503f92637 100644 --- a/samples/client/petstore/go-experimental/go-petstore/configuration.go +++ b/samples/client/petstore/go-experimental/go-petstore/configuration.go @@ -39,6 +39,9 @@ var ( // ContextAPIKeys takes a string apikey as authentication for the request ContextAPIKeys = contextKey("apiKeys") + // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. + ContextHttpSignatureAuth = contextKey("httpsignature") + // ContextServerIndex uses a server configuration from the index. ContextServerIndex = contextKey("serverIndex") diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md index 9c0050a2352..a7fa7830404 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md @@ -189,18 +189,6 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i ### bearer_test -- **Type**: HTTP basic authentication - -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ - UserName: "username", - Password: "password", -}) -r, err := client.Service.Operation(auth, args) -``` - ### http_basic_test @@ -217,6 +205,38 @@ r, err := client.Service.Operation(auth, args) ``` +### http_signature_test + +- **Type**: HTTP signature authentication + +Example + +```golang + authConfig := sw.HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: "rsa.pem", + Passphrase: "my-passphrase", + SigningScheme: sw.HttpSigningSchemeHs2019, + SignedHeaders: []string{ + sw.HttpSignatureParameterRequestTarget, // The special (request-target) parameter expresses the HTTP request target. + sw.HttpSignatureParameterCreated, // Time when request was signed, formatted as a Unix timestamp integer value. + "Host", // The Host request header specifies the domain name of the server, and optionally the TCP port number. + "Date", // The date and time at which the message was originated. + "Content-Type", // The Media type of the body of the request. + "Digest", // A cryptographic digest of the request body. + }, + SigningAlgorithm: sw.HttpSigningAlgorithmRsaPSS, + SignatureMaxValidity: 5 * time.Minute, + } + var authCtx context.Context + var err error + if authCtx, err = authConfig.ContextWithValue(context.Background()); err != nil { + // Process error + } + r, err = client.Service.Operation(auth, args) + +``` + ### petstore_auth diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml index 71d688ccea2..177b761d6b6 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml @@ -57,6 +57,7 @@ paths: "405": description: Invalid input security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -75,6 +76,7 @@ paths: "405": description: Validation exception security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -121,6 +123,7 @@ paths: "400": description: Invalid status value security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -161,6 +164,7 @@ paths: "400": description: Invalid tag value security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -2057,3 +2061,6 @@ components: bearerFormat: JWT scheme: bearer type: http + http_signature_test: + scheme: signature + type: http diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/client.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/client.go index 01ee73b79ec..9da20522a22 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/client.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/client.go @@ -365,7 +365,16 @@ func (c *APIClient) prepareRequest( for header, value := range c.cfg.DefaultHeader { localVarRequest.Header.Add(header, value) } - + if ctx != nil { + // HTTP Signature Authentication. All request headers must be set (including default headers) + // because the headers may be included in the signature. + if auth, ok := ctx.Value(ContextHttpSignatureAuth).(HttpSignatureAuth); ok { + err = SignRequest(ctx, localVarRequest, auth) + if err != nil { + return nil, err + } + } + } return localVarRequest, nil } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/configuration.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/configuration.go index a6bbfbeff96..ddcea71eaf9 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/configuration.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/configuration.go @@ -39,6 +39,9 @@ var ( // ContextAPIKeys takes a string apikey as authentication for the request ContextAPIKeys = contextKey("apiKeys") + // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. + ContextHttpSignatureAuth = contextKey("httpsignature") + // ContextServerIndex uses a server configuration from the index. ContextServerIndex = contextKey("serverIndex") diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/PetApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/PetApi.md index a3c4f945776..f88a802be24 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/PetApi.md +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/PetApi.md @@ -41,7 +41,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -122,7 +122,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -161,7 +161,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -241,7 +241,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/http_signature_test.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/http_signature_test.go new file mode 100644 index 00000000000..f5f08b2ae6e --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/http_signature_test.go @@ -0,0 +1,728 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package petstore + +import ( + "bytes" + "context" + "crypto" + "crypto/ecdsa" + "crypto/rand" + "crypto/rsa" + "crypto/x509" + "encoding/asn1" + "encoding/base64" + "encoding/pem" + "fmt" + "io/ioutil" + "math/big" + "net/http" + "net/http/httputil" + "os" + "path/filepath" + "regexp" + "strings" + "testing" + "time" +) + +// Test RSA private key as published in Appendix C 'Test Values' of +// https://www.ietf.org/id/draft-cavage-http-signatures-12.txt +const rsaTestPrivateKey string = `-----BEGIN RSA PRIVATE KEY----- +MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF +NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F +UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB +AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA +QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK +kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg +f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u +412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc +mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7 +kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA +gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW +G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI +7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA== +-----END RSA PRIVATE KEY-----` + +func writeTestRsaPemKey(t *testing.T, filePath string) { + err := ioutil.WriteFile(filePath, []byte(rsaTestPrivateKey), 0644) + if err != nil { + t.Fatalf("Error writing private key: %v", err) + } +} + +type keyFormat int // The serialization format of the private key. + +const ( + keyFormatPem keyFormat = iota // Private key is serialized in PEM format. + keyFormatPkcs8Pem // Private key is serialized as PKCS#8 encoded in PEM format. + keyFormatPkcs8Der // Private key is serialized as PKCS#8 encoded in DER format. +) + +func writeRandomTestRsaPemKey(t *testing.T, filePath string, bits int, format keyFormat, passphrase string, alg *x509.PEMCipher) { + key, err := rsa.GenerateKey(rand.Reader, bits) + if err != nil { + t.Fatalf("Error generating RSA private key file: %v", err) + } + var outFile *os.File + outFile, err = os.Create(filePath) + if err != nil { + t.Fatalf("Error creating RSA private key file: %v", err) + } + defer outFile.Close() + var privKeyBytes []byte + switch format { + case keyFormatPem: + if passphrase != "" { + t.Fatalf("Encrypting PKCS#1-encoded private key with passphrase is not supported") + } + privKeyBytes = x509.MarshalPKCS1PrivateKey(key) + case keyFormatPkcs8Pem: + privKeyBytes, err = x509.MarshalPKCS8PrivateKey(key) + if err != nil { + t.Fatalf("Error writing private key: %v", err) + } + case keyFormatPkcs8Der: + if passphrase != "" { + t.Fatalf("Encrypting DER-encoded private key with passphrase is not supported") + } + privKeyBytes, err = x509.MarshalPKCS8PrivateKey(key) + if err != nil { + t.Fatalf("Error writing private key: %v", err) + } + _, err = outFile.Write(privKeyBytes) + if err != nil { + t.Fatalf("Error writing DER-encoded private key: %v", err) + } + default: + t.Fatalf("Unsupported key format: %v", format) + } + + switch format { + case keyFormatPem, keyFormatPkcs8Der: + var pemBlock *pem.Block + if passphrase == "" { + pemBlock = &pem.Block{ + Type: "RSA PRIVATE KEY", + Bytes: privKeyBytes, + } + } else { + pemBlock, err = x509.EncryptPEMBlock(rand.Reader, "ENCRYPTED PRIVATE KEY", privKeyBytes, []byte(passphrase), *alg) + if err != nil { + t.Fatalf("Error encoding RSA private key: %v", err) + } + } + err = pem.Encode(outFile, pemBlock) + if err != nil { + t.Fatalf("Error encoding RSA private key: %v", err) + } + } + fmt.Printf("Wrote private key '%s'\n", filePath) +} + +/* +Commented out because OpenAPITools is configured to use golang 1.8 at build time +x509.MarshalPKCS8PrivateKey is not present. +func writeRandomTestEcdsaPemKey(t *testing.T, filePath string) { + key, err := ecdsa.GenerateKey(elliptic.P521(), rand.Reader) + if err != nil { + t.Fatalf("Error generating ECDSA private key file: %v", err) + } + var outFile *os.File + outFile, err = os.Create(filePath) + if err != nil { + t.Fatalf("Error creating ECDSA private key file: %v", err) + } + defer outFile.Close() + + var keybytes []byte + keybytes, err = x509.MarshalPKCS8PrivateKey(key) + if err != nil { + t.Fatalf("Error marshaling ECDSA private key: %v", err) + } + var privateKey = &pem.Block{ + Type: "PRIVATE KEY", + Bytes: keybytes, + } + + err = pem.Encode(outFile, privateKey) + if err != nil { + t.Fatalf("Error encoding ECDSA private key: %v", err) + } +} +*/ + +// TestHttpSignaturePrivateKeys creates private keys of various sizes, serialization format, +// clear-text and password encrypted. +// Test unmarshaling of the private key. +func TestHttpSignaturePrivateKeys(t *testing.T) { + var err error + var dir string + dir, err = ioutil.TempDir("", "go-http-sign") + if err != nil { + t.Fatalf("Failed to create temporary directory") + } + defer os.RemoveAll(dir) + + pemCiphers := []x509.PEMCipher{ + x509.PEMCipherDES, + x509.PEMCipher3DES, + x509.PEMCipherAES128, + x509.PEMCipherAES192, + x509.PEMCipherAES256, + } + // Test RSA private keys with various key lengths. + for _, bits := range []int{1024, 2048, 3072, 4096} { + + for _, format := range []keyFormat{keyFormatPem, keyFormatPkcs8Pem, keyFormatPkcs8Der} { + // Generate test private key. + var privateKeyPath string + switch format { + case keyFormatPem, keyFormatPkcs8Pem: + privateKeyPath = "privatekey.pem" + case keyFormatPkcs8Der: + privateKeyPath = "privatekey.der" + default: + t.Fatalf("Unsupported private key format: %v", format) + } + privateKeyPath = filepath.Join(dir, privateKeyPath) + // Generate keys in PEM format. + writeRandomTestRsaPemKey(t, privateKeyPath, bits, format, "", nil) + + authConfig := HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: privateKeyPath, + Passphrase: "", + SigningScheme: "hs2019", + SignedHeaders: []string{"Content-Type"}, + } + + // Create a context with the HTTP signature configuration parameters. + _, err = authConfig.ContextWithValue(context.Background()) + if err != nil { + t.Fatalf("Error loading private key '%s': %v", privateKeyPath, err) + } + + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: privateKeyPath, + Passphrase: "my-secret-passphrase", + SigningScheme: "hs2019", + SignedHeaders: []string{"Content-Type"}, + } + switch format { + case keyFormatPem: + // Do nothing. Keys cannot be encrypted when using PKCS#1. + case keyFormatPkcs8Pem: + for _, alg := range pemCiphers { + writeRandomTestRsaPemKey(t, privateKeyPath, bits, format, authConfig.Passphrase, &alg) + _, err := authConfig.ContextWithValue(context.Background()) + if err != nil { + t.Fatalf("Error loading private key '%s': %v", privateKeyPath, err) + } + } + } + } + } + + /* + Unfortunately, currently the build environment for OpenAPITools is using an old version + of golang that does not support ECDSA keys. + { + privateKeyPath := "privatekey.pem" + authConfig := HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: "hs2019", + SignedHeaders: []string{"Content-Type"}, + } + // Generate test private key. + writeRandomTestEcdsaPemKey(t, privateKeyPath) + err := authConfig.LoadPrivateKey(privateKeyPath) + if err != nil { + t.Fatalf("Error loading private key '%s': %v", privateKeyPath, err) + } + } + */ +} + +const testHost = "petstore.swagger.io:80" +const testScheme = "http" + +func executeHttpSignatureAuth(t *testing.T, authConfig *HttpSignatureAuth, expectSuccess bool) string { + var err error + var dir string + dir, err = ioutil.TempDir("", "go-http-sign") + if err != nil { + t.Fatalf("Failed to create temporary directory") + } + defer os.RemoveAll(dir) + + cfg := NewConfiguration() + cfg.AddDefaultHeader("testheader", "testvalue") + cfg.AddDefaultHeader("Content-Type", "application/json") + cfg.Host = testHost + cfg.Scheme = testScheme + apiClient := NewAPIClient(cfg) + + privateKeyPath := filepath.Join(dir, "rsa.pem") + writeTestRsaPemKey(t, privateKeyPath) + authConfig.PrivateKeyPath = privateKeyPath + var authCtx context.Context + authCtx, err = authConfig.ContextWithValue(context.Background()) + if expectSuccess && err != nil { + t.Fatalf("Error validating HTTP signature configuration: %v", err) + } + if !expectSuccess && err != nil { + // Do not continue. Error is expected. + return "" + } + newPet := (Pet{Id: PtrInt64(12992), Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, + Status: PtrString("pending"), + Tags: &[]Tag{Tag{Id: PtrInt64(1), Name: PtrString("tag2")}}}) + + fmt.Printf("Request with HTTP signature. Scheme: '%s'. Algorithm: '%s'. MaxValidity: %v. Headers: '%v'\n", + authConfig.SigningScheme, authConfig.SigningAlgorithm, authConfig.SignatureMaxValidity, authConfig.SignedHeaders) + + r, err2 := apiClient.PetApi.AddPet(authCtx).Pet(newPet).Execute() + if expectSuccess && err2 != nil { + t.Fatalf("Error while adding pet: %v", err2) + } + if !expectSuccess { + if err2 == nil { + t.Fatalf("Error was expected, but no error was generated") + } else { + // Do not continue. Error is expected. + return "" + } + } + if r.StatusCode != 200 { + t.Log(r) + } + + _, r, err = apiClient.PetApi.GetPetById(authCtx, 12992).Execute() + if expectSuccess && err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + + // The request should look like this: + // + // GET /v2/pet/12992 HTTP/1.1 + // Host: petstore.swagger.io:80 + // Accept: application/json + // Authorization: Signature keyId="my-key-id",algorithm="hs2019",created=1579033245,headers="(request-target) date host digest content-type",signature="RMJZjVVxzlH02wlxiQgUYDe4QxZaI5IJNIfB2BK8Dhbv3WQ2gw0xyqC+5HiKUmT/cfchhhkUNNsUtiVRnjZmFwtSfYxHfiQvH3KWXlLCMwKGNQC3YzD9lnoWdx0pA5Kxbr0/ygmr3+lTyuN2PJg4IS7Ji/AaKAqIZx7RsHS8Bxw=" + // Date: Tue, 14 Jan 2020 06:41:22 GMT + // Digest: SHA-512=z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg== + // Testheader: testvalue + // User-Agent: OpenAPI-Generator/1.0.0/go + reqb, _ := httputil.DumpRequest(r.Request, true) + reqt := (string)(reqb) + fmt.Printf("REQUEST:\n%v\n", reqt) + var sb bytes.Buffer + fmt.Fprintf(&sb, `Signature keyId="%s",algorithm="%s",`, + authConfig.KeyId, authConfig.SigningScheme) + if len(authConfig.SignedHeaders) == 0 { + fmt.Fprintf(&sb, `created=[0-9]+,`) + } else { + for _, header := range authConfig.SignedHeaders { + header = strings.ToLower(header) + if header == HttpSignatureParameterCreated { + fmt.Fprintf(&sb, `created=[0-9]+,`) + } + if header == HttpSignatureParameterExpires { + fmt.Fprintf(&sb, `expires=[0-9]+\.[0-9]{3},`) + } + } + } + fmt.Fprintf(&sb, `headers="`) + for i, header := range authConfig.SignedHeaders { + header = strings.ToLower(header) + if i > 0 { + fmt.Fprintf(&sb, " ") + } + fmt.Fprintf(&sb, regexp.QuoteMeta(header)) + switch header { + case "date": + if !strings.Contains(reqt, "Date: ") { + t.Errorf("Date header is incorrect") + } + case "digest": + var prefix string + switch authConfig.SigningScheme { + case HttpSigningSchemeRsaSha256: + prefix = "SHA-256=" + default: + prefix = "SHA-512=" + } + if !strings.Contains(reqt, fmt.Sprintf("Digest: %s", prefix)) { + t.Errorf("Digest header is incorrect") + } + } + } + if len(authConfig.SignedHeaders) == 0 { + fmt.Fprintf(&sb, regexp.QuoteMeta(HttpSignatureParameterCreated)) + } + fmt.Fprintf(&sb, `",signature="[a-zA-Z0-9+/]+="`) + re := regexp.MustCompile(sb.String()) + actual := r.Request.Header.Get("Authorization") + if !re.MatchString(actual) { + t.Errorf("Authorization header is incorrect. Expected regex\n'%s'\nbut got\n'%s'", sb.String(), actual) + } + + validateHttpAuthorizationSignature(t, authConfig, r) + return r.Request.Header.Get("Authorization") +} + +var ( + // signatureRe is a regular expression to capture the fields from the signature. + signatureRe = regexp.MustCompile( + `Signature keyId="(?P[^"]+)",algorithm="(?P[^"]+)"` + + `(,created=(?P[0-9]+))?(,expires=(?P[0-9.]+))?,headers="(?P[^"]+)",signature="(?P[^"]+)"`) +) + +// validateHttpAuthorizationSignature validates the HTTP signature in the HTTP request. +// The signature verification would normally be done by the server. +// Note: this is NOT a complete implementation of the HTTP signature validation. This code is for unit test purpose, do not use +// it for server side implementation. +// In particular, this code does not validate the calculation of the HTTP body digest. +func validateHttpAuthorizationSignature(t *testing.T, authConfig *HttpSignatureAuth, r *http.Response) { + authHeader := r.Request.Header.Get("Authorization") + match := signatureRe.FindStringSubmatch(authHeader) + if len(match) < 3 { + t.Fatalf("Unexpected Authorization header: %s", authHeader) + } + result := make(map[string]string) + for i, name := range signatureRe.SubexpNames() { + if i != 0 && name != "" { + result[name] = match[i] + } + } + b64signature := result["signature"] + fmt.Printf("Algorithm: '%s' Headers: '%s' b64signature: '%s'\n", result["algorithm"], result["headers"], b64signature) + var sb bytes.Buffer + fmt.Fprintf(&sb, "%s %s", strings.ToLower(r.Request.Method), r.Request.URL.EscapedPath()) + if r.Request.URL.RawQuery != "" { + // The ":path" pseudo-header field includes the path and query parts + // of the target URI (the "path-absolute" production and optionally a + // '?' character followed by the "query" production (see Sections 3.3 + // and 3.4 of [RFC3986] + fmt.Fprintf(&sb, "?%s", r.Request.URL.RawQuery) + } + requestTarget := sb.String() + + var signedHeaderKvs []string + signedHeaders := strings.Split(result["headers"], " ") + for _, h := range signedHeaders { + var value string + switch h { + case HttpSignatureParameterRequestTarget: + value = requestTarget + case HttpSignatureParameterCreated: + value = result["created"] + case HttpSignatureParameterExpires: + value = result["expires"] + default: + value = r.Request.Header.Get(h) + } + signedHeaderKvs = append(signedHeaderKvs, fmt.Sprintf("%s: %s", h, value)) + } + stringToSign := strings.Join(signedHeaderKvs, "\n") + + var h crypto.Hash + switch result["algorithm"] { + case HttpSigningSchemeHs2019, HttpSigningSchemeRsaSha512: + h = crypto.SHA512 + case HttpSigningSchemeRsaSha256: + h = crypto.SHA256 + default: + t.Fatalf("Unexpected signing algorithm: %s", result["algorithm"]) + } + msgHash := h.New() + if _, err := msgHash.Write([]byte(stringToSign)); err != nil { + t.Fatalf("Unable to compute hash: %v", err) + } + d := msgHash.Sum(nil) + var pub crypto.PublicKey + var err error + if pub, err = authConfig.GetPublicKey(); err != nil { + t.Fatalf("Unable to get public key: %v", err) + } + if pub == nil { + t.Fatalf("Public key is nil") + } + var signature []byte + if signature, err = base64.StdEncoding.DecodeString(b64signature); err != nil { + t.Fatalf("Failed to decode signature: %v", err) + } + switch publicKey := pub.(type) { + case *rsa.PublicKey: + // It could be PKCS1v15 or PSS signature + var errPKCS1v15, errPSS error + // In a server-side implementation, we wouldn't try to validate both signatures. The specific + // signature algorithm would be derived from the key id. But here we just want to validate for unit test purpose. + errPKCS1v15 = rsa.VerifyPKCS1v15(publicKey, h, d, signature) + errPSS = rsa.VerifyPSS(publicKey, h, d, signature, nil) + if errPKCS1v15 != nil && errPSS != nil { + t.Fatalf("RSA Signature verification failed: %v. %v", errPKCS1v15, errPSS) + } + case *ecdsa.PublicKey: + type ecdsaSignature struct { + R, S *big.Int + } + var lEcdsa ecdsaSignature + if _, err = asn1.Unmarshal(signature, &lEcdsa); err != nil { + t.Fatalf("Unable to parse ECDSA signature: %v", err) + } + if !ecdsa.Verify(publicKey, d, lEcdsa.R, lEcdsa.S) { + t.Fatalf("ECDSA Signature verification failed") + } + default: + t.Fatalf("Unsupported public key: %T", pub) + } +} + +func TestHttpSignatureAuth(t *testing.T) { + // Test with 'hs2019' signature scheme, and default signature algorithm (RSA SSA PKCS1.5) + authConfig := HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{ + HttpSignatureParameterRequestTarget, // The special (request-target) parameter expresses the HTTP request target. + HttpSignatureParameterCreated, // Time when request was signed, formatted as a Unix timestamp integer value. + "Host", // The Host request header specifies the domain name of the server, and optionally the TCP port number. + "Date", // The date and time at which the message was originated. + "Content-Type", // The Media type of the body of the request. + "Digest", // A cryptographic digest of the request body. + }, + } + executeHttpSignatureAuth(t, &authConfig, true) + + // Test with duplicate headers. This is invalid and should be rejected. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{"Host", "Date", "Host"}, + } + executeHttpSignatureAuth(t, &authConfig, false) + + // Test with non-existent header. This is invalid and should be rejected. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{"Host", "Date", "Garbage-HeaderDoesNotExist"}, + } + executeHttpSignatureAuth(t, &authConfig, false) + + // Test with 'Authorization' header in the signed headers. This is invalid and should be rejected. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{"Host", "Authorization"}, + } + executeHttpSignatureAuth(t, &authConfig, false) + + // Specify signature max validity, but '(expires)' parameter is missing. This should cause an error. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignatureMaxValidity: 7 * time.Minute, + } + executeHttpSignatureAuth(t, &authConfig, false) + + // Specify invalid signature max validity. This should cause an error. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignatureMaxValidity: -3 * time.Minute, + } + executeHttpSignatureAuth(t, &authConfig, false) + + // Specify signature max validity and '(expires)' parameter. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignatureMaxValidity: time.Minute, + SignedHeaders: []string{ + HttpSignatureParameterRequestTarget, // The special (request-target) parameter expresses the HTTP request target. + HttpSignatureParameterCreated, // Time when request was signed, formatted as a Unix timestamp integer value. + HttpSignatureParameterExpires, // Time when signature expires. + }, + } + executeHttpSignatureAuth(t, &authConfig, true) + + // Specify '(expires)' parameter but no signature max validity. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{ + HttpSignatureParameterRequestTarget, // The special (request-target) parameter expresses the HTTP request target. + HttpSignatureParameterCreated, // Time when request was signed, formatted as a Unix timestamp integer value. + HttpSignatureParameterExpires, // Time when signature expires. + }, + } + executeHttpSignatureAuth(t, &authConfig, false) + + // Test with empty signed headers. The client should automatically add the "(created)" parameter by default. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{}, + } + executeHttpSignatureAuth(t, &authConfig, true) + + // Test with deprecated RSA-SHA512, some servers may still support it. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeRsaSha512, + SignedHeaders: []string{ + HttpSignatureParameterRequestTarget, // The special (request-target) parameter expresses the HTTP request target. + HttpSignatureParameterCreated, // Time when request was signed, formatted as a Unix timestamp integer value. + "Host", // The Host request header specifies the domain name of the server, and optionally the TCP port number. + "Date", // The date and time at which the message was originated. + "Content-Type", // The Media type of the body of the request. + "Digest", // A cryptographic digest of the request body. + }, + } + executeHttpSignatureAuth(t, &authConfig, true) + + // Test with deprecated RSA-SHA256, some servers may still support it. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeRsaSha256, + SignedHeaders: []string{ + HttpSignatureParameterRequestTarget, // The special (request-target) parameter expresses the HTTP request target. + HttpSignatureParameterCreated, // Time when request was signed, formatted as a Unix timestamp integer value. + "Host", // The Host request header specifies the domain name of the server, and optionally the TCP port number. + "Date", // The date and time at which the message was originated. + "Content-Type", // The Media type of the body of the request. + "Digest", // A cryptographic digest of the request body. + }, + } + executeHttpSignatureAuth(t, &authConfig, true) + + // Test with headers without date. This makes it possible to get a fixed signature, used for unit test purpose. + // This should not be used in production code as it could potentially allow replay attacks. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SigningAlgorithm: HttpSigningAlgorithmRsaPKCS1v15, + SignedHeaders: []string{ + HttpSignatureParameterRequestTarget, + "Host", // The Host request header specifies the domain name of the server, and optionally the TCP port number. + "Content-Type", // The Media type of the body of the request. + "Digest", // A cryptographic digest of the request body. + }, + } + authorizationHeaderValue := executeHttpSignatureAuth(t, &authConfig, true) + expectedSignature := "sXE2MDeW8os6ywv1oUWaFEPFcSPCEb/msQ/NZGKNA9Emm/e42axaAPojzfkZ9Hacyw/iS/5nH4YIkczMgXu3z5fAwFjumxtf3OxbqvUcQ80wvw2/7B5aQmsF6ZwrCFHZ+L/cj9/bg7L1EGUGtdyDzoRKti4zf9QF/03OsP7QljI=" + expectedAuthorizationHeader := fmt.Sprintf( + `Signature keyId="my-key-id",`+ + `algorithm="hs2019",headers="(request-target) host content-type digest",`+ + `signature="%s"`, expectedSignature) + if authorizationHeaderValue != expectedAuthorizationHeader { + t.Errorf("Authorization header value is incorrect. Got\n'%s'\nbut expected\n'%s'", authorizationHeaderValue, expectedAuthorizationHeader) + } + + // Test with PSS signature. The PSS signature creates a new signature every time it is invoked. + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + SigningScheme: HttpSigningSchemeHs2019, + SigningAlgorithm: HttpSigningAlgorithmRsaPSS, + SignedHeaders: []string{ + HttpSignatureParameterRequestTarget, + "Host", // The Host request header specifies the domain name of the server, and optionally the TCP port number. + "Content-Type", // The Media type of the body of the request. + "Digest", // A cryptographic digest of the request body. + }, + } + authorizationHeaderValue = executeHttpSignatureAuth(t, &authConfig, true) + expectedSignature = `[a-zA-Z0-9+/]+=` + expectedAuthorizationHeader = fmt.Sprintf( + `Signature keyId="my-key-id",`+ + `algorithm="hs2019",headers="\(request-target\) host content-type digest",`+ + `signature="%s"`, expectedSignature) + re := regexp.MustCompile(expectedAuthorizationHeader) + if !re.MatchString(authorizationHeaderValue) { + t.Errorf("Authorization header value is incorrect. Got\n'%s'\nbut expected\n'%s'", authorizationHeaderValue, expectedAuthorizationHeader) + } +} + +func TestInvalidHttpSignatureConfiguration(t *testing.T) { + var err error + var authConfig HttpSignatureAuth + + authConfig = HttpSignatureAuth{ + } + _, err = authConfig.ContextWithValue(context.Background()) + if err == nil || !strings.Contains(err.Error(), "Key ID must be specified") { + t.Fatalf("Invalid configuration: %v", err) + } + + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + } + _, err = authConfig.ContextWithValue(context.Background()) + if err == nil || !strings.Contains(err.Error(), "Private key path must be specified") { + t.Fatalf("Invalid configuration: %v", err) + } + + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: "test.pem", + } + _, err = authConfig.ContextWithValue(context.Background()) + if err == nil || !strings.Contains(err.Error(), "Invalid signing scheme") { + t.Fatalf("Invalid configuration: %v", err) + } + + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: "test.pem", + SigningScheme: "garbage", + } + _, err = authConfig.ContextWithValue(context.Background()) + if err == nil || !strings.Contains(err.Error(), "Invalid signing scheme") { + t.Fatalf("Invalid configuration: %v", err) + } + + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: "test.pem", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{"foo", "bar", "foo"}, + } + _, err = authConfig.ContextWithValue(context.Background()) + if err == nil || !strings.Contains(err.Error(), "cannot have duplicate names") { + t.Fatalf("Invalid configuration: %v", err) + } + + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: "test.pem", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{"foo", "bar", "Authorization"}, + } + _, err = authConfig.ContextWithValue(context.Background()) + if err == nil || !strings.Contains(err.Error(), "Signed headers cannot include the 'Authorization' header") { + t.Fatalf("Invalid configuration: %v", err) + } + + authConfig = HttpSignatureAuth{ + KeyId: "my-key-id", + PrivateKeyPath: "test.pem", + SigningScheme: HttpSigningSchemeHs2019, + SignedHeaders: []string{"foo", "bar"}, + SignatureMaxValidity: -7 * time.Minute, + } + _, err = authConfig.ContextWithValue(context.Background()) + if err == nil || !strings.Contains(err.Error(), "Signature max validity must be a positive value") { + t.Fatalf("Invalid configuration: %v", err) + } +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/signing.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/signing.go new file mode 100644 index 00000000000..d28fd6a379e --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/signing.go @@ -0,0 +1,422 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * API version: 1.0.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package petstore + +import ( + "bytes" + "context" + "crypto" + "crypto/ecdsa" + "crypto/rand" + "crypto/rsa" + "crypto/x509" + "encoding/base64" + "encoding/pem" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/textproto" + "os" + "strings" + "time" +) + +const ( + // Constants for HTTP signature parameters. + // The '(request-target)' parameter concatenates the lowercased :method, an + // ASCII space, and the :path pseudo-headers. + HttpSignatureParameterRequestTarget string = "(request-target)" + // The '(created)' parameter expresses when the signature was + // created. The value MUST be a Unix timestamp integer value. + HttpSignatureParameterCreated string = "(created)" + // The '(expires)' parameter expresses when the signature ceases to + // be valid. The value MUST be a Unix timestamp integer value. + HttpSignatureParameterExpires string = "(expires)" +) + +const ( + // Constants for HTTP headers. + // The 'Host' header, as defined in RFC 2616, section 14.23. + HttpHeaderHost string = "Host" + // The 'Date' header. + HttpHeaderDate string = "Date" + // The digest header, as defined in RFC 3230, section 4.3.2. + HttpHeaderDigest string = "Digest" + // The HTTP Authorization header, as defined in RFC 7235, section 4.2. + HttpHeaderAuthorization string = "Authorization" +) + +const ( + // Specifies the Digital Signature Algorithm is derived from metadata + // associated with 'keyId'. Supported DSA algorithms are RSASSA-PKCS1-v1_5, + // RSASSA-PSS, and ECDSA. + // The hash is SHA-512. + // This is the default value. + HttpSigningSchemeHs2019 string = "hs2019" + // Use RSASSA-PKCS1-v1_5 with SHA-512 hash. Deprecated. + HttpSigningSchemeRsaSha512 string = "rsa-sha512" + // Use RSASSA-PKCS1-v1_5 with SHA-256 hash. Deprecated. + HttpSigningSchemeRsaSha256 string = "rsa-sha256" + + // RFC 8017 section 7.2 + // Calculate the message signature using RSASSA-PKCS1-V1_5-SIGN from RSA PKCS#1 v1.5. + // PKCSV1_5 is deterministic. The same message and key will produce an identical + // signature value each time. + HttpSigningAlgorithmRsaPKCS1v15 string = "RSASSA-PKCS1-v1_5" + // Calculate the message signature using probabilistic signature scheme RSASSA-PSS. + // PSS is randomized and will produce a different signature value each time. + HttpSigningAlgorithmRsaPSS string = "RSASSA-PSS" +) + +var supportedSigningSchemes = map[string]bool{ + HttpSigningSchemeHs2019: true, + HttpSigningSchemeRsaSha512: true, + HttpSigningSchemeRsaSha256: true, +} + + +// HttpSignatureAuth provides HTTP signature authentication to a request passed +// via context using ContextHttpSignatureAuth. +// An 'Authorization' header is calculated by creating a hash of select headers, +// and optionally the body of the HTTP request, then signing the hash value using +// a private key which is available to the client. +// +// SignedHeaders specifies the list of HTTP headers that are included when generating +// the message signature. +// The two special signature headers '(request-target)' and '(created)' SHOULD be +// included in SignedHeaders. +// The '(created)' header expresses when the signature was created. +// The '(request-target)' header is a concatenation of the lowercased :method, an +// ASCII space, and the :path pseudo-headers. +// +// For example, SignedHeaders can be set to: +// (request-target) (created) date host digest +// +// When SignedHeaders is not specified, the client defaults to a single value, '(created)', +// in the list of HTTP headers. +// When SignedHeaders contains the 'Digest' value, the client performs the following operations: +// 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. +// 2. Set the 'Digest' header in the request body. +// 3. Include the 'Digest' header and value in the HTTP signature. +type HttpSignatureAuth struct { + KeyId string // A key identifier. + PrivateKeyPath string // The path to the private key. + Passphrase string // The passphrase to decrypt the private key, if the key is encrypted. + SigningScheme string // The signature scheme, when signing HTTP requests. Supported value is 'hs2019'. + // The signature algorithm, when signing HTTP requests. + // Supported values are RSASSA-PKCS1-v1_5, RSASSA-PSS. + SigningAlgorithm string + SignedHeaders []string // A list of HTTP headers included when generating the signature for the message. + // SignatureMaxValidity specifies the maximum duration of the signature validity. + // The value is used to set the '(expires)' signature parameter in the HTTP request. + // '(expires)' is set to '(created)' plus the value of the SignatureMaxValidity field. + // To specify the '(expires)' signature parameter, set 'SignatureMaxValidity' and add '(expires)' to 'SignedHeaders'. + SignatureMaxValidity time.Duration + privateKey crypto.PrivateKey // The private key used to sign HTTP requests. +} + +// ContextWithValue validates the HttpSignatureAuth configuration parameters and returns a context +// suitable for HTTP signature. An error is returned if the HttpSignatureAuth configuration parameters +// are invalid. +func (h *HttpSignatureAuth) ContextWithValue(ctx context.Context) (context.Context, error) { + if h.KeyId == "" { + return nil, fmt.Errorf("Key ID must be specified") + } + if h.PrivateKeyPath == "" { + return nil, fmt.Errorf("Private key path must be specified") + } + if _, ok := supportedSigningSchemes[h.SigningScheme]; !ok { + return nil, fmt.Errorf("Invalid signing scheme: '%v'", h.SigningScheme) + } + m := make(map[string]bool) + for _, h := range h.SignedHeaders { + if strings.ToLower(h) == strings.ToLower(HttpHeaderAuthorization) { + return nil, fmt.Errorf("Signed headers cannot include the 'Authorization' header") + } + m[h] = true + } + if len(m) != len(h.SignedHeaders) { + return nil, fmt.Errorf("List of signed headers cannot have duplicate names") + } + if h.SignatureMaxValidity < 0 { + return nil, fmt.Errorf("Signature max validity must be a positive value") + } + if err := h.loadPrivateKey(); err != nil { + return nil, err + } + return context.WithValue(ctx, ContextHttpSignatureAuth, *h), nil +} + +// GetPublicKey returns the public key associated with this HTTP signature configuration. +func (h *HttpSignatureAuth) GetPublicKey() (crypto.PublicKey, error) { + if h.privateKey == nil { + if err := h.loadPrivateKey(); err != nil { + return nil, err + } + } + switch key := h.privateKey.(type) { + case *rsa.PrivateKey: + return key.Public(), nil + case *ecdsa.PrivateKey: + return key.Public(), nil + default: + // Do not change '%T' to anything else such as '%v'! + // The value of the private key must not be returned. + return nil, fmt.Errorf("Unsupported key: %T", h.privateKey) + } +} + +// loadPrivateKey reads the private key from the file specified in the HttpSignatureAuth. +func (h *HttpSignatureAuth) loadPrivateKey() (err error) { + var file *os.File + file, err = os.Open(h.PrivateKeyPath) + if err != nil { + return fmt.Errorf("Cannot load private key '%s'. Error: %v", h.PrivateKeyPath, err) + } + defer func() { + err = file.Close() + }() + var priv []byte + priv, err = ioutil.ReadAll(file) + if err != nil { + return err + } + pemBlock, _ := pem.Decode(priv) + if pemBlock == nil { + // No PEM data has been found. + return fmt.Errorf("File '%s' does not contain PEM data", h.PrivateKeyPath) + } + var privKey []byte + if x509.IsEncryptedPEMBlock(pemBlock) { + // The PEM data is encrypted. + privKey, err = x509.DecryptPEMBlock(pemBlock, []byte(h.Passphrase)) + if err != nil { + // Failed to decrypt PEM block. Because of deficiencies in the encrypted-PEM format, + // it's not always possibleto detect an incorrect password. + return err + } + } else { + privKey = pemBlock.Bytes + } + switch pemBlock.Type { + case "RSA PRIVATE KEY": + if h.privateKey, err = x509.ParsePKCS1PrivateKey(privKey); err != nil { + return err + } + case "EC PRIVATE KEY", "PRIVATE KEY": + // https://tools.ietf.org/html/rfc5915 section 4. + if h.privateKey, err = x509.ParsePKCS8PrivateKey(privKey); err != nil { + return err + } + default: + return fmt.Errorf("Key '%s' is not supported", pemBlock.Type) + } + return nil +} + +// SignRequest signs the request using HTTP signature. +// See https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ +// +// Do not add, remove or change headers that are included in the SignedHeaders +// after SignRequest has been invoked; this is because the header values are +// included in the signature. Any subsequent alteration will cause a signature +// verification failure. +// If there are multiple instances of the same header field, all +// header field values associated with the header field MUST be +// concatenated, separated by a ASCII comma and an ASCII space +// ', ', and used in the order in which they will appear in the +// transmitted HTTP message. +func SignRequest( + ctx context.Context, + r *http.Request, + auth HttpSignatureAuth) error { + + if auth.privateKey == nil { + return fmt.Errorf("Private key is not set") + } + now := time.Now() + date := now.UTC().Format(http.TimeFormat) + // The 'created' field expresses when the signature was created. + // The value MUST be a Unix timestamp integer value. See 'HTTP signature' section 2.1.4. + created := now.Unix() + + var h crypto.Hash + var err error + var prefix string + var expiresUnix float64 + + if auth.SignatureMaxValidity < 0 { + return fmt.Errorf("Signature validity must be a positive value") + } + if auth.SignatureMaxValidity > 0 { + e := now.Add(auth.SignatureMaxValidity) + expiresUnix = float64(e.Unix()) + float64(e.Nanosecond()) / float64(time.Second) + } + // Determine the cryptographic hash to be used for the signature and the body digest. + switch auth.SigningScheme { + case HttpSigningSchemeRsaSha512, HttpSigningSchemeHs2019: + h = crypto.SHA512 + prefix = "SHA-512=" + case HttpSigningSchemeRsaSha256: + // This is deprecated and should no longer be used. + h = crypto.SHA256 + prefix = "SHA-256=" + default: + return fmt.Errorf("Unsupported signature scheme: %v", auth.SigningScheme) + } + if !h.Available() { + return fmt.Errorf("Hash '%v' is not available", h) + } + + // Build the "(request-target)" signature header. + var sb bytes.Buffer + fmt.Fprintf(&sb, "%s %s", strings.ToLower(r.Method), r.URL.EscapedPath()) + if r.URL.RawQuery != "" { + // The ":path" pseudo-header field includes the path and query parts + // of the target URI (the "path-absolute" production and optionally a + // '?' character followed by the "query" production (see Sections 3.3 + // and 3.4 of [RFC3986] + fmt.Fprintf(&sb, "?%s", r.URL.RawQuery) + } + requestTarget := sb.String() + sb.Reset() + + // Build the string to be signed. + signedHeaders := auth.SignedHeaders + if len(signedHeaders) == 0 { + signedHeaders = []string{HttpSignatureParameterCreated} + } + // Validate the list of signed headers has no duplicates. + m := make(map[string]bool) + for _, h := range signedHeaders { + m[h] = true + } + if len(m) != len(signedHeaders) { + return fmt.Errorf("List of signed headers must not have any duplicates") + } + hasCreatedParameter := false + hasExpiresParameter := false + for i, header := range signedHeaders { + header = strings.ToLower(header) + var value string + switch header { + case strings.ToLower(HttpHeaderAuthorization): + return fmt.Errorf("Cannot include the 'Authorization' header as a signed header.") + case HttpSignatureParameterRequestTarget: + value = requestTarget + case HttpSignatureParameterCreated: + value = fmt.Sprintf("%d", created) + hasCreatedParameter = true + case HttpSignatureParameterExpires: + if auth.SignatureMaxValidity.Nanoseconds() == 0 { + return fmt.Errorf("Cannot set '(expires)' signature parameter. SignatureMaxValidity is not configured.") + } + value = fmt.Sprintf("%.3f", expiresUnix) + hasExpiresParameter = true + case "date": + value = date + r.Header.Set(HttpHeaderDate, date) + case "digest": + // Calculate the digest of the HTTP request body. + // Calculate body digest per RFC 3230 section 4.3.2 + bodyHash := h.New() + if r.Body != nil { + // Make a copy of the body io.Reader so that we can read the body to calculate the hash, + // then one more time when marshaling the request. + var body io.Reader + body, err = r.GetBody() + if err != nil { + return err + } + if _, err = io.Copy(bodyHash, body); err != nil { + return err + } + } + d := bodyHash.Sum(nil) + value = prefix + base64.StdEncoding.EncodeToString(d) + r.Header.Set(HttpHeaderDigest, value) + case "host": + value = r.Host + r.Header.Set(HttpHeaderHost, r.Host) + default: + var ok bool + var v []string + canonicalHeader := textproto.CanonicalMIMEHeaderKey(header) + if v, ok = r.Header[canonicalHeader]; !ok { + // If a header specified in the headers parameter cannot be matched with + // a provided header in the message, the implementation MUST produce an error. + return fmt.Errorf("Header '%s' does not exist in the request", canonicalHeader) + } + // If there are multiple instances of the same header field, all + // header field values associated with the header field MUST be + // concatenated, separated by a ASCII comma and an ASCII space + // `, `, and used in the order in which they will appear in the + // transmitted HTTP message. + value = strings.Join(v, ", ") + } + if i > 0 { + fmt.Fprintf(&sb, "\n") + } + fmt.Fprintf(&sb, "%s: %s", header, value) + } + if expiresUnix != 0 && !hasExpiresParameter { + return fmt.Errorf("SignatureMaxValidity is specified, but '(expired)' parameter is not present") + } + msg := []byte(sb.String()) + msgHash := h.New() + if _, err = msgHash.Write(msg); err != nil { + return err + } + d := msgHash.Sum(nil) + + var signature []byte + switch key := auth.privateKey.(type) { + case *rsa.PrivateKey: + switch auth.SigningAlgorithm { + case HttpSigningAlgorithmRsaPKCS1v15: + signature, err = rsa.SignPKCS1v15(rand.Reader, key, h, d) + case "", HttpSigningAlgorithmRsaPSS: + signature, err = rsa.SignPSS(rand.Reader, key, h, d, nil) + default: + return fmt.Errorf("Unsupported signing algorithm: '%s'", auth.SigningAlgorithm) + } + case *ecdsa.PrivateKey: + signature, err = key.Sign(rand.Reader, d, h) + //case ed25519.PrivateKey: requires go 1.13 + // signature, err = key.Sign(rand.Reader, msg, crypto.Hash(0)) + default: + return fmt.Errorf("Unsupported private key") + } + if err != nil { + return err + } + + sb.Reset() + for i, header := range signedHeaders { + if i > 0 { + sb.WriteRune(' ') + } + sb.WriteString(strings.ToLower(header)) + } + headers_list := sb.String() + sb.Reset() + fmt.Fprintf(&sb, `Signature keyId="%s",algorithm="%s",`, auth.KeyId, auth.SigningScheme) + if hasCreatedParameter { + fmt.Fprintf(&sb, "created=%d,", created) + } + if hasExpiresParameter { + fmt.Fprintf(&sb, "expires=%.3f,", expiresUnix) + } + fmt.Fprintf(&sb, `headers="%s",signature="%s"`, headers_list, base64.StdEncoding.EncodeToString(signature)) + authStr := sb.String() + r.Header.Set(HttpHeaderAuthorization, authStr) + return nil +} From a496c2011f7b8a1ca71f40841be4271f2db2a3ef Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Sat, 1 Feb 2020 20:51:55 -0500 Subject: [PATCH 73/85] [docs] Initial FeatureSet generator documentation (#5188) * Flatten feature sets for display * [cli] Add feature set output to config-help This includes markdown and plain text outputs for config-help. * [docs] FeatureSet on generator docs --- docs/generators/ada-server.md | 108 +++++++++++ docs/generators/ada.md | 108 +++++++++++ docs/generators/android.md | 108 +++++++++++ docs/generators/apache2.md | 108 +++++++++++ docs/generators/apex.md | 108 +++++++++++ docs/generators/asciidoc.md | 108 +++++++++++ docs/generators/aspnetcore.md | 108 +++++++++++ docs/generators/avro-schema.md | 108 +++++++++++ docs/generators/bash.md | 108 +++++++++++ docs/generators/c.md | 108 +++++++++++ docs/generators/clojure.md | 108 +++++++++++ docs/generators/cpp-pistache-server.md | 108 +++++++++++ docs/generators/cpp-qt5-client.md | 108 +++++++++++ docs/generators/cpp-qt5-qhttpengine-server.md | 108 +++++++++++ docs/generators/cpp-restbed-server.md | 108 +++++++++++ docs/generators/cpp-restsdk.md | 108 +++++++++++ docs/generators/cpp-tizen.md | 108 +++++++++++ docs/generators/csharp-dotnet2.md | 108 +++++++++++ docs/generators/csharp-nancyfx.md | 108 +++++++++++ docs/generators/csharp-netcore.md | 108 +++++++++++ docs/generators/csharp.md | 108 +++++++++++ docs/generators/cwiki.md | 108 +++++++++++ docs/generators/dart-dio.md | 108 +++++++++++ docs/generators/dart-jaguar.md | 108 +++++++++++ docs/generators/dart.md | 108 +++++++++++ docs/generators/dynamic-html.md | 108 +++++++++++ docs/generators/eiffel.md | 108 +++++++++++ docs/generators/elixir.md | 108 +++++++++++ docs/generators/elm.md | 108 +++++++++++ docs/generators/erlang-client.md | 108 +++++++++++ docs/generators/erlang-proper.md | 108 +++++++++++ docs/generators/erlang-server.md | 108 +++++++++++ docs/generators/flash.md | 108 +++++++++++ docs/generators/fsharp-functions.md | 108 +++++++++++ docs/generators/fsharp-giraffe-server.md | 108 +++++++++++ docs/generators/go-experimental.md | 108 +++++++++++ docs/generators/go-gin-server.md | 108 +++++++++++ docs/generators/go-server.md | 108 +++++++++++ docs/generators/go.md | 108 +++++++++++ .../graphql-nodejs-express-server.md | 108 +++++++++++ docs/generators/graphql-schema.md | 108 +++++++++++ docs/generators/groovy.md | 108 +++++++++++ docs/generators/haskell-http-client.md | 108 +++++++++++ docs/generators/haskell.md | 108 +++++++++++ docs/generators/html.md | 108 +++++++++++ docs/generators/html2.md | 108 +++++++++++ docs/generators/java-inflector.md | 108 +++++++++++ docs/generators/java-msf4j.md | 108 +++++++++++ docs/generators/java-pkmst.md | 108 +++++++++++ docs/generators/java-play-framework.md | 108 +++++++++++ docs/generators/java-undertow-server.md | 108 +++++++++++ docs/generators/java-vertx-web.md | 108 +++++++++++ docs/generators/java-vertx.md | 108 +++++++++++ docs/generators/java.md | 108 +++++++++++ docs/generators/javascript-closure-angular.md | 108 +++++++++++ docs/generators/javascript-flowtyped.md | 108 +++++++++++ docs/generators/javascript.md | 108 +++++++++++ docs/generators/jaxrs-cxf-cdi.md | 108 +++++++++++ docs/generators/jaxrs-cxf-client.md | 108 +++++++++++ docs/generators/jaxrs-cxf-extended.md | 108 +++++++++++ docs/generators/jaxrs-cxf.md | 108 +++++++++++ docs/generators/jaxrs-jersey.md | 108 +++++++++++ docs/generators/jaxrs-resteasy-eap.md | 108 +++++++++++ docs/generators/jaxrs-resteasy.md | 108 +++++++++++ docs/generators/jaxrs-spec.md | 108 +++++++++++ docs/generators/jmeter.md | 108 +++++++++++ docs/generators/kotlin-server.md | 108 +++++++++++ docs/generators/kotlin-spring.md | 108 +++++++++++ docs/generators/kotlin-vertx.md | 108 +++++++++++ docs/generators/kotlin.md | 108 +++++++++++ docs/generators/lua.md | 108 +++++++++++ docs/generators/markdown.md | 108 +++++++++++ docs/generators/mysql-schema.md | 108 +++++++++++ docs/generators/nim.md | 108 +++++++++++ docs/generators/nodejs-express-server.md | 108 +++++++++++ docs/generators/nodejs-server-deprecated.md | 108 +++++++++++ docs/generators/objc.md | 108 +++++++++++ docs/generators/ocaml.md | 108 +++++++++++ docs/generators/openapi-yaml.md | 108 +++++++++++ docs/generators/openapi.md | 108 +++++++++++ docs/generators/perl.md | 108 +++++++++++ docs/generators/php-laravel.md | 108 +++++++++++ docs/generators/php-lumen.md | 108 +++++++++++ docs/generators/php-silex.md | 108 +++++++++++ docs/generators/php-slim-deprecated.md | 108 +++++++++++ docs/generators/php-slim4.md | 108 +++++++++++ docs/generators/php-symfony.md | 108 +++++++++++ docs/generators/php-ze-ph.md | 108 +++++++++++ docs/generators/php.md | 108 +++++++++++ docs/generators/powershell.md | 108 +++++++++++ docs/generators/protobuf-schema.md | 108 +++++++++++ docs/generators/python-aiohttp.md | 108 +++++++++++ docs/generators/python-blueplanet.md | 108 +++++++++++ docs/generators/python-experimental.md | 108 +++++++++++ docs/generators/python-flask.md | 108 +++++++++++ docs/generators/python.md | 108 +++++++++++ docs/generators/r.md | 108 +++++++++++ docs/generators/ruby-on-rails.md | 108 +++++++++++ docs/generators/ruby-sinatra.md | 108 +++++++++++ docs/generators/ruby.md | 108 +++++++++++ docs/generators/rust-server.md | 108 +++++++++++ docs/generators/rust.md | 108 +++++++++++ docs/generators/scala-akka.md | 108 +++++++++++ docs/generators/scala-finch.md | 108 +++++++++++ docs/generators/scala-gatling.md | 108 +++++++++++ .../generators/scala-httpclient-deprecated.md | 108 +++++++++++ docs/generators/scala-lagom-server.md | 108 +++++++++++ docs/generators/scala-play-server.md | 108 +++++++++++ docs/generators/scalatra.md | 108 +++++++++++ docs/generators/scalaz.md | 108 +++++++++++ docs/generators/spring.md | 108 +++++++++++ docs/generators/swift2-deprecated.md | 108 +++++++++++ docs/generators/swift3-deprecated.md | 108 +++++++++++ docs/generators/swift4.md | 108 +++++++++++ docs/generators/swift5.md | 108 +++++++++++ docs/generators/typescript-angular.md | 108 +++++++++++ docs/generators/typescript-angularjs.md | 108 +++++++++++ docs/generators/typescript-aurelia.md | 108 +++++++++++ docs/generators/typescript-axios.md | 108 +++++++++++ docs/generators/typescript-fetch.md | 108 +++++++++++ docs/generators/typescript-inversify.md | 108 +++++++++++ docs/generators/typescript-jquery.md | 108 +++++++++++ docs/generators/typescript-node.md | 108 +++++++++++ docs/generators/typescript-redux-query.md | 108 +++++++++++ docs/generators/typescript-rxjs.md | 108 +++++++++++ .../openapitools/codegen/cmd/ConfigHelp.java | 135 ++++++++------ .../openapitools/codegen/meta/FeatureSet.java | 167 +++++++++++++++++- .../features/annotations/AnnotationType.java | 12 ++ .../codegen/meta/FeatureSetTest.java | 136 ++++++++++++++ 129 files changed, 13898 insertions(+), 52 deletions(-) create mode 100644 modules/openapi-generator-core/src/main/java/org/openapitools/codegen/meta/features/annotations/AnnotationType.java create mode 100644 modules/openapi-generator-core/src/test/java/org/openapitools/codegen/meta/FeatureSetTest.java diff --git a/docs/generators/ada-server.md b/docs/generators/ada-server.md index 61f5b1c53e2..d87f699e24c 100644 --- a/docs/generators/ada-server.md +++ b/docs/generators/ada-server.md @@ -111,3 +111,111 @@ sidebar_label: ada-server
  • with
  • xor
  • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/ada.md b/docs/generators/ada.md index 60d6a74739d..f92b7f055bc 100644 --- a/docs/generators/ada.md +++ b/docs/generators/ada.md @@ -111,3 +111,111 @@ sidebar_label: ada
  • with
  • xor
  • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/android.md b/docs/generators/android.md index 8bcc419aa7a..0c13f292bf6 100644 --- a/docs/generators/android.md +++ b/docs/generators/android.md @@ -134,3 +134,111 @@ sidebar_label: android
  • volatile
  • while
  • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/apache2.md b/docs/generators/apache2.md index 80dbcb60ff3..33b5a50f1a1 100644 --- a/docs/generators/apache2.md +++ b/docs/generators/apache2.md @@ -47,3 +47,111 @@ sidebar_label: apache2 ## RESERVED WORDS
      + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/apex.md b/docs/generators/apex.md index d80fb0f3fe4..d2cca318810 100644 --- a/docs/generators/apex.md +++ b/docs/generators/apex.md @@ -184,3 +184,111 @@ sidebar_label: apex
    • while
    • yesterday
    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/asciidoc.md b/docs/generators/asciidoc.md index 9243aafaceb..7cee688c39e 100644 --- a/docs/generators/asciidoc.md +++ b/docs/generators/asciidoc.md @@ -43,3 +43,111 @@ sidebar_label: asciidoc ## RESERVED WORDS
        + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/aspnetcore.md b/docs/generators/aspnetcore.md index eda0e8a9f26..d580ee1e882 100644 --- a/docs/generators/aspnetcore.md +++ b/docs/generators/aspnetcore.md @@ -189,3 +189,111 @@ sidebar_label: aspnetcore
      • while
      • yield
      • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/avro-schema.md b/docs/generators/avro-schema.md index 45256f48950..633728ae8b1 100644 --- a/docs/generators/avro-schema.md +++ b/docs/generators/avro-schema.md @@ -48,3 +48,111 @@ sidebar_label: avro-schema ## RESERVED WORDS
          + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/bash.md b/docs/generators/bash.md index c56cbd4047a..77647aa0698 100644 --- a/docs/generators/bash.md +++ b/docs/generators/bash.md @@ -77,3 +77,111 @@ sidebar_label: bash
        • until
        • while
        • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/c.md b/docs/generators/c.md index 400db5b79a3..7f8e047a95d 100644 --- a/docs/generators/c.md +++ b/docs/generators/c.md @@ -86,3 +86,111 @@ sidebar_label: c
        • volatile
        • while
        • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/clojure.md b/docs/generators/clojure.md index ce497694042..dadd327272d 100644 --- a/docs/generators/clojure.md +++ b/docs/generators/clojure.md @@ -53,3 +53,111 @@ sidebar_label: clojure ## RESERVED WORDS
            + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/cpp-pistache-server.md b/docs/generators/cpp-pistache-server.md index fde4459144b..1de625d4500 100644 --- a/docs/generators/cpp-pistache-server.md +++ b/docs/generators/cpp-pistache-server.md @@ -40,3 +40,111 @@ sidebar_label: cpp-pistache-server ## RESERVED WORDS
              + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/cpp-qt5-client.md b/docs/generators/cpp-qt5-client.md index 5677ef13d08..2d510c95849 100644 --- a/docs/generators/cpp-qt5-client.md +++ b/docs/generators/cpp-qt5-client.md @@ -131,3 +131,111 @@ sidebar_label: cpp-qt5-client
            • xor
            • xor_eq
            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/cpp-qt5-qhttpengine-server.md b/docs/generators/cpp-qt5-qhttpengine-server.md index 4d9518c2bea..2b4ca0653f6 100644 --- a/docs/generators/cpp-qt5-qhttpengine-server.md +++ b/docs/generators/cpp-qt5-qhttpengine-server.md @@ -130,3 +130,111 @@ sidebar_label: cpp-qt5-qhttpengine-server
            • xor
            • xor_eq
            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/cpp-restbed-server.md b/docs/generators/cpp-restbed-server.md index 4c59be6e67a..7758938f201 100644 --- a/docs/generators/cpp-restbed-server.md +++ b/docs/generators/cpp-restbed-server.md @@ -130,3 +130,111 @@ sidebar_label: cpp-restbed-server
            • xor
            • xor_eq
            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/cpp-restsdk.md b/docs/generators/cpp-restsdk.md index 6bf209af796..9a368d34bdc 100644 --- a/docs/generators/cpp-restsdk.md +++ b/docs/generators/cpp-restsdk.md @@ -133,3 +133,111 @@ sidebar_label: cpp-restsdk
            • xor
            • xor_eq
            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/cpp-tizen.md b/docs/generators/cpp-tizen.md index 4cabf3db443..58bc494e67b 100644 --- a/docs/generators/cpp-tizen.md +++ b/docs/generators/cpp-tizen.md @@ -128,3 +128,111 @@ sidebar_label: cpp-tizen
            • xor
            • xor_eq
            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/csharp-dotnet2.md b/docs/generators/csharp-dotnet2.md index adf5841d42f..09d34f5b3e2 100644 --- a/docs/generators/csharp-dotnet2.md +++ b/docs/generators/csharp-dotnet2.md @@ -156,3 +156,111 @@ sidebar_label: csharp-dotnet2
            • volatile
            • while
            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/csharp-nancyfx.md b/docs/generators/csharp-nancyfx.md index 48913347f59..693cd51a16f 100644 --- a/docs/generators/csharp-nancyfx.md +++ b/docs/generators/csharp-nancyfx.md @@ -82,3 +82,111 @@ sidebar_label: csharp-nancyfx
            • var
            • yield
            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/csharp-netcore.md b/docs/generators/csharp-netcore.md index 8cf2d0ee54a..9010fd0b26c 100644 --- a/docs/generators/csharp-netcore.md +++ b/docs/generators/csharp-netcore.md @@ -177,3 +177,111 @@ sidebar_label: csharp-netcore
            • volatile
            • while
            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✓|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/generators/csharp.md b/docs/generators/csharp.md index 4ec890a4e8b..f17d0426b90 100644 --- a/docs/generators/csharp.md +++ b/docs/generators/csharp.md @@ -176,3 +176,111 @@ sidebar_label: csharp
            • volatile
            • while
            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✓|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/generators/cwiki.md b/docs/generators/cwiki.md index 9765e1cc584..76c23788360 100644 --- a/docs/generators/cwiki.md +++ b/docs/generators/cwiki.md @@ -40,3 +40,111 @@ sidebar_label: cwiki ## RESERVED WORDS
                + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/dart-dio.md b/docs/generators/dart-dio.md index 3445c7e1658..f774dc65956 100644 --- a/docs/generators/dart-dio.md +++ b/docs/generators/dart-dio.md @@ -122,3 +122,111 @@ sidebar_label: dart-dio
              • with
              • yield
              • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/dart-jaguar.md b/docs/generators/dart-jaguar.md index 78f1eac7d5d..c8775bb8a8c 100644 --- a/docs/generators/dart-jaguar.md +++ b/docs/generators/dart-jaguar.md @@ -118,3 +118,111 @@ sidebar_label: dart-jaguar
              • with
              • yield
              • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/dart.md b/docs/generators/dart.md index 8b1bd158c30..73f968a0fb9 100644 --- a/docs/generators/dart.md +++ b/docs/generators/dart.md @@ -116,3 +116,111 @@ sidebar_label: dart
              • with
              • yield
              • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/dynamic-html.md b/docs/generators/dynamic-html.md index 1fa63d34348..6061921eac2 100644 --- a/docs/generators/dynamic-html.md +++ b/docs/generators/dynamic-html.md @@ -36,3 +36,111 @@ sidebar_label: dynamic-html ## RESERVED WORDS
                  + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/eiffel.md b/docs/generators/eiffel.md index 2f239b7c407..01cf9b7af96 100644 --- a/docs/generators/eiffel.md +++ b/docs/generators/eiffel.md @@ -118,3 +118,111 @@ sidebar_label: eiffel
                • when
                • xor
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✓|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/generators/elixir.md b/docs/generators/elixir.md index fae1d80bd37..f7ae13337cf 100644 --- a/docs/generators/elixir.md +++ b/docs/generators/elixir.md @@ -67,3 +67,111 @@ sidebar_label: elixir
                • nil
                • true
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/elm.md b/docs/generators/elm.md index aa3fe4f49bd..c276f43c855 100644 --- a/docs/generators/elm.md +++ b/docs/generators/elm.md @@ -51,3 +51,111 @@ sidebar_label: elm
                • type
                • where
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/erlang-client.md b/docs/generators/erlang-client.md index 72e4df60613..4186a3f6ecb 100644 --- a/docs/generators/erlang-client.md +++ b/docs/generators/erlang-client.md @@ -70,3 +70,111 @@ sidebar_label: erlang-client
                • when
                • xor
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/erlang-proper.md b/docs/generators/erlang-proper.md index 6d48712bdc6..0f5c8e46ea1 100644 --- a/docs/generators/erlang-proper.md +++ b/docs/generators/erlang-proper.md @@ -70,3 +70,111 @@ sidebar_label: erlang-proper
                • when
                • xor
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/erlang-server.md b/docs/generators/erlang-server.md index 8db2184f0d9..490943d88c6 100644 --- a/docs/generators/erlang-server.md +++ b/docs/generators/erlang-server.md @@ -70,3 +70,111 @@ sidebar_label: erlang-server
                • when
                • xor
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/flash.md b/docs/generators/flash.md index 5d6fd829b16..7d4295ab25f 100644 --- a/docs/generators/flash.md +++ b/docs/generators/flash.md @@ -67,3 +67,111 @@ sidebar_label: flash
                • while
                • with
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/fsharp-functions.md b/docs/generators/fsharp-functions.md index 389c94b1338..87396205994 100644 --- a/docs/generators/fsharp-functions.md +++ b/docs/generators/fsharp-functions.md @@ -185,3 +185,111 @@ sidebar_label: fsharp-functions
                • yield
                • yield!
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/fsharp-giraffe-server.md b/docs/generators/fsharp-giraffe-server.md index d05383c75de..23d6fb0ae2a 100644 --- a/docs/generators/fsharp-giraffe-server.md +++ b/docs/generators/fsharp-giraffe-server.md @@ -187,3 +187,111 @@ sidebar_label: fsharp-giraffe-server
                • yield
                • yield!
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/go-experimental.md b/docs/generators/go-experimental.md index 6099220d652..9db534703cf 100644 --- a/docs/generators/go-experimental.md +++ b/docs/generators/go-experimental.md @@ -95,3 +95,111 @@ sidebar_label: go-experimental
                • uintptr
                • var
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✓|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/generators/go-gin-server.md b/docs/generators/go-gin-server.md index 189705f0920..3e57af97856 100644 --- a/docs/generators/go-gin-server.md +++ b/docs/generators/go-gin-server.md @@ -88,3 +88,111 @@ sidebar_label: go-gin-server
                • uintptr
                • var
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/go-server.md b/docs/generators/go-server.md index 0125db11e99..563c10319d6 100644 --- a/docs/generators/go-server.md +++ b/docs/generators/go-server.md @@ -91,3 +91,111 @@ sidebar_label: go-server
                • uintptr
                • var
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/go.md b/docs/generators/go.md index 1d8909bbfcd..8d860da0f90 100644 --- a/docs/generators/go.md +++ b/docs/generators/go.md @@ -95,3 +95,111 @@ sidebar_label: go
                • uintptr
                • var
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✓|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/generators/graphql-nodejs-express-server.md b/docs/generators/graphql-nodejs-express-server.md index 8200c47531f..c3585363a07 100644 --- a/docs/generators/graphql-nodejs-express-server.md +++ b/docs/generators/graphql-nodejs-express-server.md @@ -61,3 +61,111 @@ sidebar_label: graphql-nodejs-express-server
                • type
                • union
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/graphql-schema.md b/docs/generators/graphql-schema.md index 5cc481fa24e..9efd9611caf 100644 --- a/docs/generators/graphql-schema.md +++ b/docs/generators/graphql-schema.md @@ -61,3 +61,111 @@ sidebar_label: graphql-schema
                • type
                • union
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/groovy.md b/docs/generators/groovy.md index 13e9a1a6193..c502298ba71 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -161,3 +161,111 @@ sidebar_label: groovy
                • volatile
                • while
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/haskell-http-client.md b/docs/generators/haskell-http-client.md index 3a68e2276a6..4a60d794fa3 100644 --- a/docs/generators/haskell-http-client.md +++ b/docs/generators/haskell-http-client.md @@ -95,3 +95,111 @@ sidebar_label: haskell-http-client
                • type
                • where
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✓|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/generators/haskell.md b/docs/generators/haskell.md index 3e0cb77314d..ad7ac2d1993 100644 --- a/docs/generators/haskell.md +++ b/docs/generators/haskell.md @@ -73,3 +73,111 @@ sidebar_label: haskell
                • type
                • where
                • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/html.md b/docs/generators/html.md index d538d0f91d6..433cf84bbb2 100644 --- a/docs/generators/html.md +++ b/docs/generators/html.md @@ -40,3 +40,111 @@ sidebar_label: html ## RESERVED WORDS
                    + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/html2.md b/docs/generators/html2.md index 82374353c40..9e05e5661c8 100644 --- a/docs/generators/html2.md +++ b/docs/generators/html2.md @@ -44,3 +44,111 @@ sidebar_label: html2 ## RESERVED WORDS
                      + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/java-inflector.md b/docs/generators/java-inflector.md index 9a0da4b39a1..44630e5f05c 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -159,3 +159,111 @@ sidebar_label: java-inflector
                    • volatile
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/java-msf4j.md b/docs/generators/java-msf4j.md index d0ecb290ff8..a0d46e7c1d9 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -164,3 +164,111 @@ sidebar_label: java-msf4j
                    • volatile
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/java-pkmst.md b/docs/generators/java-pkmst.md index 8ab96c097dd..a03b3c70960 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -166,3 +166,111 @@ sidebar_label: java-pkmst
                    • volatile
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/java-play-framework.md b/docs/generators/java-play-framework.md index c0875184092..875c423a6a1 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -168,3 +168,111 @@ sidebar_label: java-play-framework
                    • volatile
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index 3e13225d8d4..5b41e7baa70 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -159,3 +159,111 @@ sidebar_label: java-undertow-server
                    • volatile
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index 584fae2dc24..eb5cd669a3a 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -159,3 +159,111 @@ sidebar_label: java-vertx-web
                    • volatile
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/java-vertx.md b/docs/generators/java-vertx.md index ea93520b0be..1eba9c6c636 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -162,3 +162,111 @@ sidebar_label: java-vertx
                    • volatile
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/java.md b/docs/generators/java.md index fddd7ba9ff9..8127246b92f 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -174,3 +174,111 @@ sidebar_label: java
                    • volatile
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/javascript-closure-angular.md b/docs/generators/javascript-closure-angular.md index 0308a0a824c..e81aced2cb2 100644 --- a/docs/generators/javascript-closure-angular.md +++ b/docs/generators/javascript-closure-angular.md @@ -83,3 +83,111 @@ sidebar_label: javascript-closure-angular
                    • void
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/javascript-flowtyped.md b/docs/generators/javascript-flowtyped.md index 8cf943fa317..125b0778a84 100644 --- a/docs/generators/javascript-flowtyped.md +++ b/docs/generators/javascript-flowtyped.md @@ -135,3 +135,111 @@ sidebar_label: javascript-flowtyped
                    • with
                    • yield
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/javascript.md b/docs/generators/javascript.md index 7064b4a2870..492a2f13abe 100644 --- a/docs/generators/javascript.md +++ b/docs/generators/javascript.md @@ -137,3 +137,111 @@ sidebar_label: javascript
                    • with
                    • yield
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index 0842a00ccef..6d8abb15dad 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -169,3 +169,111 @@ sidebar_label: jaxrs-cxf-cdi
                    • volatile
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index 713ef854781..0206dc3138a 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -163,3 +163,111 @@ sidebar_label: jaxrs-cxf-client
                    • volatile
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index 14e89951415..e3d41581852 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -185,3 +185,111 @@ sidebar_label: jaxrs-cxf-extended
                    • volatile
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index 1fc41f7b179..f80d3b8efb4 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -180,3 +180,111 @@ sidebar_label: jaxrs-cxf
                    • volatile
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index d1851341f62..359c80709be 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -166,3 +166,111 @@ sidebar_label: jaxrs-jersey
                    • volatile
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index 378769bd75f..1e38e58691a 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -165,3 +165,111 @@ sidebar_label: jaxrs-resteasy-eap
                    • volatile
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index 9b85ad5e172..e37467c74bc 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -164,3 +164,111 @@ sidebar_label: jaxrs-resteasy
                    • volatile
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index d9c32ce88ab..697c33c7de5 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -169,3 +169,111 @@ sidebar_label: jaxrs-spec
                    • volatile
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/jmeter.md b/docs/generators/jmeter.md index 2aff0efbb2b..ebb69073c58 100644 --- a/docs/generators/jmeter.md +++ b/docs/generators/jmeter.md @@ -48,3 +48,111 @@ sidebar_label: jmeter
                      • sample1
                      • sample2
                      + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/kotlin-server.md b/docs/generators/kotlin-server.md index cffcda881f8..0b3dfa2cdca 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -99,3 +99,111 @@ sidebar_label: kotlin-server
                    • when
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index 11d7a924b2d..b177c896877 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -111,3 +111,111 @@ sidebar_label: kotlin-spring
                    • when
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/kotlin-vertx.md b/docs/generators/kotlin-vertx.md index 20a85045d08..43c1d6c46d6 100644 --- a/docs/generators/kotlin-vertx.md +++ b/docs/generators/kotlin-vertx.md @@ -93,3 +93,111 @@ sidebar_label: kotlin-vertx
                    • when
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/kotlin.md b/docs/generators/kotlin.md index cdd75b89277..dc24c813027 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -97,3 +97,111 @@ sidebar_label: kotlin
                    • when
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/lua.md b/docs/generators/lua.md index 40622703341..b7eab0cfa5b 100644 --- a/docs/generators/lua.md +++ b/docs/generators/lua.md @@ -62,3 +62,111 @@ sidebar_label: lua
                    • userdata
                    • while
                    • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/markdown.md b/docs/generators/markdown.md index 3c7777b2a90..8d8a2a90780 100644 --- a/docs/generators/markdown.md +++ b/docs/generators/markdown.md @@ -46,3 +46,111 @@ sidebar_label: markdown ## RESERVED WORDS
                        + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/mysql-schema.md b/docs/generators/mysql-schema.md index 67e235168b3..d0510c33303 100644 --- a/docs/generators/mysql-schema.md +++ b/docs/generators/mysql-schema.md @@ -314,3 +314,111 @@ sidebar_label: mysql-schema
                      • year_month
                      • zerofill
                      • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/nim.md b/docs/generators/nim.md index 946669ccbe5..306329177da 100644 --- a/docs/generators/nim.md +++ b/docs/generators/nim.md @@ -130,3 +130,111 @@ sidebar_label: nim
                      • xor
                      • yield
                      • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✓|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/generators/nodejs-express-server.md b/docs/generators/nodejs-express-server.md index b0a8db1c497..9a9bd5e7e74 100644 --- a/docs/generators/nodejs-express-server.md +++ b/docs/generators/nodejs-express-server.md @@ -81,3 +81,111 @@ sidebar_label: nodejs-express-server
                      • with
                      • yield
                      • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/nodejs-server-deprecated.md b/docs/generators/nodejs-server-deprecated.md index 0967505e683..c3e70b7e84b 100644 --- a/docs/generators/nodejs-server-deprecated.md +++ b/docs/generators/nodejs-server-deprecated.md @@ -83,3 +83,111 @@ sidebar_label: nodejs-server-deprecated
                      • with
                      • yield
                      • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/objc.md b/docs/generators/objc.md index 49148761b66..115bd252803 100644 --- a/docs/generators/objc.md +++ b/docs/generators/objc.md @@ -104,3 +104,111 @@ sidebar_label: objc
                      • weak
                      • while
                      • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✓|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/generators/ocaml.md b/docs/generators/ocaml.md index 87721f59841..6a87a5358ab 100644 --- a/docs/generators/ocaml.md +++ b/docs/generators/ocaml.md @@ -112,3 +112,111 @@ sidebar_label: ocaml
                      • while
                      • with
                      • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/openapi-yaml.md b/docs/generators/openapi-yaml.md index 96021a3a3e7..cb5a6459bd9 100644 --- a/docs/generators/openapi-yaml.md +++ b/docs/generators/openapi-yaml.md @@ -47,3 +47,111 @@ sidebar_label: openapi-yaml ## RESERVED WORDS
                          + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/openapi.md b/docs/generators/openapi.md index 95b8fd6ace0..7a396ad773d 100644 --- a/docs/generators/openapi.md +++ b/docs/generators/openapi.md @@ -46,3 +46,111 @@ sidebar_label: openapi ## RESERVED WORDS
                            + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/perl.md b/docs/generators/perl.md index 3a65f291a45..bc59a014b63 100644 --- a/docs/generators/perl.md +++ b/docs/generators/perl.md @@ -79,3 +79,111 @@ sidebar_label: perl
                          • xor
                          • y
                          • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✓|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/generators/php-laravel.md b/docs/generators/php-laravel.md index a0b7443d871..b8caa87b553 100644 --- a/docs/generators/php-laravel.md +++ b/docs/generators/php-laravel.md @@ -140,3 +140,111 @@ sidebar_label: php-laravel
                          • while
                          • xor
                          • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/php-lumen.md b/docs/generators/php-lumen.md index 4a33196eca3..92f185a4bc6 100644 --- a/docs/generators/php-lumen.md +++ b/docs/generators/php-lumen.md @@ -140,3 +140,111 @@ sidebar_label: php-lumen
                          • while
                          • xor
                          • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/php-silex.md b/docs/generators/php-silex.md index 7c515f135ed..2a5ea38682c 100644 --- a/docs/generators/php-silex.md +++ b/docs/generators/php-silex.md @@ -123,3 +123,111 @@ sidebar_label: php-silex
                          • while
                          • xor
                          • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/php-slim-deprecated.md b/docs/generators/php-slim-deprecated.md index 7e6cd21fdbc..f2c282695ef 100644 --- a/docs/generators/php-slim-deprecated.md +++ b/docs/generators/php-slim-deprecated.md @@ -124,3 +124,111 @@ sidebar_label: php-slim-deprecated
                          • while
                          • xor
                          • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/php-slim4.md b/docs/generators/php-slim4.md index 1e96ca09b3a..6174cdde007 100644 --- a/docs/generators/php-slim4.md +++ b/docs/generators/php-slim4.md @@ -125,3 +125,111 @@ sidebar_label: php-slim4
                          • while
                          • xor
                          • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/php-symfony.md b/docs/generators/php-symfony.md index a6fbd33e456..365daa034fa 100644 --- a/docs/generators/php-symfony.md +++ b/docs/generators/php-symfony.md @@ -128,3 +128,111 @@ sidebar_label: php-symfony
                          • while
                          • xor
                          • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/php-ze-ph.md b/docs/generators/php-ze-ph.md index 99bf251414d..f58ace643c1 100644 --- a/docs/generators/php-ze-ph.md +++ b/docs/generators/php-ze-ph.md @@ -140,3 +140,111 @@ sidebar_label: php-ze-ph
                          • while
                          • xor
                          • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/php.md b/docs/generators/php.md index b8de32ff810..d833e419d54 100644 --- a/docs/generators/php.md +++ b/docs/generators/php.md @@ -125,3 +125,111 @@ sidebar_label: php
                          • while
                          • xor
                          • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/powershell.md b/docs/generators/powershell.md index e8fcfaf8af3..e15091f8761 100644 --- a/docs/generators/powershell.md +++ b/docs/generators/powershell.md @@ -98,3 +98,111 @@ sidebar_label: powershell
                          • Where
                          • While
                          • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/protobuf-schema.md b/docs/generators/protobuf-schema.md index 71b97282c3b..74cb62355be 100644 --- a/docs/generators/protobuf-schema.md +++ b/docs/generators/protobuf-schema.md @@ -43,3 +43,111 @@ sidebar_label: protobuf-schema ## RESERVED WORDS
                              + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/python-aiohttp.md b/docs/generators/python-aiohttp.md index 3fa24defa31..bfc590021cb 100644 --- a/docs/generators/python-aiohttp.md +++ b/docs/generators/python-aiohttp.md @@ -102,3 +102,111 @@ sidebar_label: python-aiohttp
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/python-blueplanet.md b/docs/generators/python-blueplanet.md index 6acfe091007..a1400e199a9 100644 --- a/docs/generators/python-blueplanet.md +++ b/docs/generators/python-blueplanet.md @@ -102,3 +102,111 @@ sidebar_label: python-blueplanet
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/python-experimental.md b/docs/generators/python-experimental.md index 483060b622f..870162d940c 100644 --- a/docs/generators/python-experimental.md +++ b/docs/generators/python-experimental.md @@ -94,3 +94,111 @@ sidebar_label: python-experimental
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/python-flask.md b/docs/generators/python-flask.md index 1f76e434668..59eb4d75a80 100644 --- a/docs/generators/python-flask.md +++ b/docs/generators/python-flask.md @@ -102,3 +102,111 @@ sidebar_label: python-flask
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/python.md b/docs/generators/python.md index 19e268b90dd..dc78e52ed0c 100644 --- a/docs/generators/python.md +++ b/docs/generators/python.md @@ -92,3 +92,111 @@ sidebar_label: python
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/r.md b/docs/generators/r.md index 8d71a39a69e..5e03a8a86fe 100644 --- a/docs/generators/r.md +++ b/docs/generators/r.md @@ -55,3 +55,111 @@ sidebar_label: r
                            • true
                            • while
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✓|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/generators/ruby-on-rails.md b/docs/generators/ruby-on-rails.md index 82d9f33bb34..94a9d1d37a7 100644 --- a/docs/generators/ruby-on-rails.md +++ b/docs/generators/ruby-on-rails.md @@ -90,3 +90,111 @@ sidebar_label: ruby-on-rails
                            • while
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/ruby-sinatra.md b/docs/generators/ruby-sinatra.md index b759489632c..b831c8b7182 100644 --- a/docs/generators/ruby-sinatra.md +++ b/docs/generators/ruby-sinatra.md @@ -89,3 +89,111 @@ sidebar_label: ruby-sinatra
                            • while
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/ruby.md b/docs/generators/ruby.md index f749fa96677..63c7d3fc48a 100644 --- a/docs/generators/ruby.md +++ b/docs/generators/ruby.md @@ -104,3 +104,111 @@ sidebar_label: ruby
                            • while
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✓|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/generators/rust-server.md b/docs/generators/rust-server.md index 50551fa841c..46f33f4cbb3 100644 --- a/docs/generators/rust-server.md +++ b/docs/generators/rust-server.md @@ -96,3 +96,111 @@ sidebar_label: rust-server
                            • while
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/rust.md b/docs/generators/rust.md index 9dfff407df9..0fd4e880aa4 100644 --- a/docs/generators/rust.md +++ b/docs/generators/rust.md @@ -111,3 +111,111 @@ sidebar_label: rust
                            • while
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✓|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/generators/scala-akka.md b/docs/generators/scala-akka.md index 3ad7d16a08d..9ffaf33e713 100644 --- a/docs/generators/scala-akka.md +++ b/docs/generators/scala-akka.md @@ -104,3 +104,111 @@ sidebar_label: scala-akka
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✓|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/generators/scala-finch.md b/docs/generators/scala-finch.md index 764ea5fd718..24f1b8cbd94 100644 --- a/docs/generators/scala-finch.md +++ b/docs/generators/scala-finch.md @@ -122,3 +122,111 @@ sidebar_label: scala-finch
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/scala-gatling.md b/docs/generators/scala-gatling.md index 33542992272..072d887e01d 100644 --- a/docs/generators/scala-gatling.md +++ b/docs/generators/scala-gatling.md @@ -114,3 +114,111 @@ sidebar_label: scala-gatling
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/scala-httpclient-deprecated.md b/docs/generators/scala-httpclient-deprecated.md index 4fa157bcd7a..a42a703fd2e 100644 --- a/docs/generators/scala-httpclient-deprecated.md +++ b/docs/generators/scala-httpclient-deprecated.md @@ -115,3 +115,111 @@ sidebar_label: scala-httpclient-deprecated
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/scala-lagom-server.md b/docs/generators/scala-lagom-server.md index 0608d6cfa2d..c43b6a82ec6 100644 --- a/docs/generators/scala-lagom-server.md +++ b/docs/generators/scala-lagom-server.md @@ -115,3 +115,111 @@ sidebar_label: scala-lagom-server
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/scala-play-server.md b/docs/generators/scala-play-server.md index 48d5cc9d55a..01eabec5849 100644 --- a/docs/generators/scala-play-server.md +++ b/docs/generators/scala-play-server.md @@ -114,3 +114,111 @@ sidebar_label: scala-play-server
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/scalatra.md b/docs/generators/scalatra.md index f420e051996..16c58bd9976 100644 --- a/docs/generators/scalatra.md +++ b/docs/generators/scalatra.md @@ -116,3 +116,111 @@ sidebar_label: scalatra
                            • volatile
                            • while
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/scalaz.md b/docs/generators/scalaz.md index e6050ab3f19..a5c62a788fb 100644 --- a/docs/generators/scalaz.md +++ b/docs/generators/scalaz.md @@ -115,3 +115,111 @@ sidebar_label: scalaz
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/spring.md b/docs/generators/spring.md index 7ba4dca43d0..600e2228966 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -181,3 +181,111 @@ sidebar_label: spring
                            • volatile
                            • while
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/swift2-deprecated.md b/docs/generators/swift2-deprecated.md index 776a950d697..8686174b4cc 100644 --- a/docs/generators/swift2-deprecated.md +++ b/docs/generators/swift2-deprecated.md @@ -152,3 +152,111 @@ sidebar_label: swift2-deprecated
                            • while
                            • willSet
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/swift3-deprecated.md b/docs/generators/swift3-deprecated.md index d605fb9d767..a9fadef3838 100644 --- a/docs/generators/swift3-deprecated.md +++ b/docs/generators/swift3-deprecated.md @@ -146,3 +146,111 @@ sidebar_label: swift3-deprecated
                            • where
                            • while
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/swift4.md b/docs/generators/swift4.md index dfd34277fcc..5e7bd630a81 100644 --- a/docs/generators/swift4.md +++ b/docs/generators/swift4.md @@ -204,3 +204,111 @@ sidebar_label: swift4
                            • while
                            • willSet
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/swift5.md b/docs/generators/swift5.md index b5295c90758..9ca15a3f202 100644 --- a/docs/generators/swift5.md +++ b/docs/generators/swift5.md @@ -203,3 +203,111 @@ sidebar_label: swift5
                            • while
                            • willSet
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/typescript-angular.md b/docs/generators/typescript-angular.md index 13c700448a0..654963adc7f 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -137,3 +137,111 @@ sidebar_label: typescript-angular
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/typescript-angularjs.md b/docs/generators/typescript-angularjs.md index ac3aaf63d60..2fcbf81476e 100644 --- a/docs/generators/typescript-angularjs.md +++ b/docs/generators/typescript-angularjs.md @@ -120,3 +120,111 @@ sidebar_label: typescript-angularjs
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/typescript-aurelia.md b/docs/generators/typescript-aurelia.md index 7f934105a89..e12293e9562 100644 --- a/docs/generators/typescript-aurelia.md +++ b/docs/generators/typescript-aurelia.md @@ -123,3 +123,111 @@ sidebar_label: typescript-aurelia
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/typescript-axios.md b/docs/generators/typescript-axios.md index f34971518b6..961fa500dd3 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -127,3 +127,111 @@ sidebar_label: typescript-axios
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index 695c85c033e..933dce1f141 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -153,3 +153,111 @@ sidebar_label: typescript-fetch
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/typescript-inversify.md b/docs/generators/typescript-inversify.md index 62170b6117c..e4daf3bb9e8 100644 --- a/docs/generators/typescript-inversify.md +++ b/docs/generators/typescript-inversify.md @@ -130,3 +130,111 @@ sidebar_label: typescript-inversify
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/typescript-jquery.md b/docs/generators/typescript-jquery.md index 8a00cf0d97b..3f28481c3e2 100644 --- a/docs/generators/typescript-jquery.md +++ b/docs/generators/typescript-jquery.md @@ -125,3 +125,111 @@ sidebar_label: typescript-jquery
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/typescript-node.md b/docs/generators/typescript-node.md index 7baeb924014..54eee1ac863 100644 --- a/docs/generators/typescript-node.md +++ b/docs/generators/typescript-node.md @@ -128,3 +128,111 @@ sidebar_label: typescript-node
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/typescript-redux-query.md b/docs/generators/typescript-redux-query.md index e888c68f49f..b46f0fafe58 100644 --- a/docs/generators/typescript-redux-query.md +++ b/docs/generators/typescript-redux-query.md @@ -149,3 +149,111 @@ sidebar_label: typescript-redux-query
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/generators/typescript-rxjs.md b/docs/generators/typescript-rxjs.md index 41811e3d1ff..7cbfaf70210 100644 --- a/docs/generators/typescript-rxjs.md +++ b/docs/generators/typescript-rxjs.md @@ -141,3 +141,111 @@ sidebar_label: typescript-rxjs
                            • with
                            • yield
                            • + +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|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/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java index 8e55421c7bd..da7e69eeeff 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java @@ -24,15 +24,15 @@ import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenConfigLoader; import org.openapitools.codegen.GeneratorNotFoundException; +import org.openapitools.codegen.meta.FeatureSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.*; import java.nio.charset.StandardCharsets; import java.nio.file.Paths; -import java.util.Locale; -import java.util.Map; -import java.util.TreeMap; +import java.util.*; +import java.util.concurrent.atomic.AtomicReference; import java.util.function.Function; import java.util.stream.Collectors; @@ -78,6 +78,9 @@ public class ConfigHelp implements Runnable { @Option(name = {"--instantiation-types"}, title = "instantiation types", description = "displays types used to instantiate simple type/alias names") private Boolean instantiationTypes; + @Option(name = {"--feature-set"}, title = "feature set", description = "displays feature set as supported by the generator") + private Boolean featureSets; + @Option(name = { "--markdown-header"}, title = "markdown header", description = "When format=markdown, include this option to write out markdown headers (e.g. for docusaurus).") private Boolean markdownHeader; @@ -99,6 +102,7 @@ public class ConfigHelp implements Runnable { reservedWords = Boolean.TRUE; languageSpecificPrimitives = Boolean.TRUE; importMappings = Boolean.TRUE; + featureSets = Boolean.TRUE; } try { @@ -199,17 +203,12 @@ public class ConfigHelp implements Runnable { sb.append("|"); // default - sb.append(escapeHtml4(langCliOption.getDefault())).append("|"); - - sb.append(newline); + sb.append(escapeHtml4(langCliOption.getDefault())).append("|").append(newline); }); if (Boolean.TRUE.equals(importMappings)) { - sb.append(newline); - sb.append("## IMPORT MAPPING"); - sb.append(newline); - sb.append(newline); + sb.append(newline).append("## IMPORT MAPPING").append(newline).append(newline); sb.append("| Type/Alias | Imports |").append(newline); sb.append("| ---------- | ------- |").append(newline); @@ -227,10 +226,7 @@ public class ConfigHelp implements Runnable { } if (Boolean.TRUE.equals(instantiationTypes)) { - sb.append(newline); - sb.append("## INSTANTIATION TYPES"); - sb.append(newline); - sb.append(newline); + sb.append(newline).append("## INSTANTIATION TYPES").append(newline).append(newline); sb.append("| Type/Alias | Instantiated By |").append(newline); sb.append("| ---------- | --------------- |").append(newline); @@ -248,31 +244,51 @@ public class ConfigHelp implements Runnable { } if (Boolean.TRUE.equals(languageSpecificPrimitives)) { - sb.append(newline); - sb.append("## LANGUAGE PRIMITIVES"); - sb.append(newline); - sb.append(newline); + sb.append(newline).append("## LANGUAGE PRIMITIVES").append(newline).append(newline); + sb.append("
                                "); config.languageSpecificPrimitives() .stream() .sorted(String::compareTo) .forEach(s -> sb.append("
                              • ").append(escapeHtml4(s)).append("
                              • ").append(newline)); - sb.append("
                              "); - sb.append(newline); + sb.append("").append(newline); } if (Boolean.TRUE.equals(reservedWords)) { - sb.append(newline); - sb.append("## RESERVED WORDS"); - sb.append(newline); - sb.append(newline); + sb.append(newline).append("## RESERVED WORDS").append(newline).append(newline); + sb.append("
                                "); config.reservedWords() .stream() .sorted(String::compareTo) .forEach(s -> sb.append("
                              • ").append(escapeHtml4(s)).append("
                              • ").append(newline)); - sb.append("
                              "); - sb.append(newline); + sb.append("").append(newline); + } + + if (Boolean.TRUE.equals(featureSets)) { + sb.append(newline).append("## FEATURE SET").append(newline).append(newline); + + List flattened = config.getFeatureSet().flatten(); + flattened.sort(Comparator.comparing(FeatureSet.FeatureSetFlattened::getFeatureCategory)); + + AtomicReference lastCategory = new AtomicReference<>(); + flattened.forEach(featureSet -> { + if (!featureSet.getFeatureCategory().equals(lastCategory.get())) { + lastCategory.set(featureSet.getFeatureCategory()); + + String[] header = StringUtils.splitByCharacterTypeCamelCase(featureSet.getFeatureCategory()); + sb.append(newline).append("### ").append(StringUtils.join(header, " ")).append(newline); + + sb.append("| Name | Supported | Defined By |").append(newline); + sb.append("| ---- | --------- | ---------- |").append(newline); + } + + // Appends a ✓ or ✗ for support + sb.append("|").append(featureSet.getFeatureName()) + .append("|").append(featureSet.isSupported() ? "✓" : "✗") + .append("|").append(StringUtils.join(featureSet.getSource(), ",")) + .append(newline); + }); } } @@ -305,14 +321,12 @@ public class ConfigHelp implements Runnable { } private void generatePlainTextHelp(StringBuilder sb, CodegenConfig config) { - sb.append(newline); - sb.append("CONFIG OPTIONS"); + sb.append(newline).append("CONFIG OPTIONS"); if (Boolean.TRUE.equals(namedHeader)) { sb.append(" for ").append(generatorName).append(newline); } - sb.append(newline); - sb.append(newline); + sb.append(newline).append(newline); String optIndent = "\t"; String optNestedIndent = "\t "; @@ -324,19 +338,14 @@ public class ConfigHelp implements Runnable { }, TreeMap::new)); langCliOptions.forEach((key, langCliOption) -> { - sb.append(optIndent).append(key); - sb.append(newline); + sb.append(optIndent).append(key).append(newline); sb.append(optNestedIndent).append(langCliOption.getOptionHelp() .replaceAll("\n", System.lineSeparator() + optNestedIndent)); - sb.append(newline); - sb.append(newline); + sb.append(newline).append(newline); }); if (Boolean.TRUE.equals(importMappings)) { - sb.append(newline); - sb.append("IMPORT MAPPING"); - sb.append(newline); - sb.append(newline); + sb.append(newline).append("IMPORT MAPPING").append(newline).append(newline); Map map = config.importMapping() .entrySet() .stream() @@ -348,10 +357,7 @@ public class ConfigHelp implements Runnable { } if (Boolean.TRUE.equals(instantiationTypes)) { - sb.append(newline); - sb.append("INSTANTIATION TYPES"); - sb.append(newline); - sb.append(newline); + sb.append(newline).append("INSTANTIATION TYPES").append(newline).append(newline); Map map = config.instantiationTypes() .entrySet() .stream() @@ -363,24 +369,53 @@ public class ConfigHelp implements Runnable { } if (Boolean.TRUE.equals(languageSpecificPrimitives)) { - sb.append(newline); - sb.append("LANGUAGE PRIMITIVES"); - sb.append(newline); - sb.append(newline); + sb.append(newline).append("LANGUAGE PRIMITIVES").append(newline).append(newline); String[] arr = config.languageSpecificPrimitives().stream().sorted().toArray(String[]::new); writePlainTextFromArray(sb, arr, optIndent); sb.append(newline); } if (Boolean.TRUE.equals(reservedWords)) { - sb.append(newline); - sb.append("RESERVED WORDS"); - sb.append(newline); - sb.append(newline); + sb.append(newline).append("RESERVED WORDS").append(newline).append(newline); String[] arr = config.reservedWords().stream().sorted().toArray(String[]::new); writePlainTextFromArray(sb, arr, optIndent); sb.append(newline); } + + if (Boolean.TRUE.equals(featureSets)) { + sb.append(newline).append("FEATURE SET").append(newline); + + List flattened = config.getFeatureSet().flatten(); + flattened.sort(Comparator.comparing(FeatureSet.FeatureSetFlattened::getFeatureCategory)); + + AtomicReference lastCategory = new AtomicReference<>(); + + String nameKey = "Name"; + String supportedKey = "Supported"; + String definedByKey = "Defined By"; + int maxNameLength = flattened.stream().map(FeatureSet.FeatureSetFlattened::getFeatureName).mapToInt(String::length).max().orElse(nameKey.length()); + int maxSupportedLength = supportedKey.length(); + int definedInLength = 20; + String format = "%-" + maxNameLength + "s\t%-" + maxSupportedLength + "s\t%-" + definedInLength + "s"; + + flattened.forEach(featureSet -> { + if (!featureSet.getFeatureCategory().equals(lastCategory.get())) { + lastCategory.set(featureSet.getFeatureCategory()); + sb.append(newline).append(newline).append(" ").append(featureSet.getFeatureCategory()).append(":"); + sb.append(newline).append(newline); + sb.append(optIndent).append(String.format(Locale.ROOT, format, nameKey, supportedKey, definedByKey)).append(newline); + sb.append(optIndent).append(String.format(Locale.ROOT, format, + StringUtils.repeat("-", maxNameLength), + StringUtils.repeat("-", maxSupportedLength), + StringUtils.repeat("-", definedInLength))); + } + + String mark = featureSet.isSupported() ? "✓" : "x"; + String centeredMark = StringUtils.center(mark, maxSupportedLength); + String definedByCsv = StringUtils.join(featureSet.getSource(), ","); + sb.append(newline).append(optIndent).append(String.format(Locale.ROOT, format, featureSet.getFeatureName(), centeredMark, definedByCsv)); + }); + } } private void writePlainTextFromMap( diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/meta/FeatureSet.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/meta/FeatureSet.java index 3d93eefd936..3ff23a51a39 100644 --- a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/meta/FeatureSet.java +++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/meta/FeatureSet.java @@ -16,10 +16,12 @@ package org.openapitools.codegen.meta; +import com.google.common.collect.ImmutableList; import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.meta.features.annotations.AnnotationType; -import java.util.Arrays; -import java.util.EnumSet; +import java.lang.annotation.Annotation; +import java.util.*; import java.util.stream.Collectors; /** @@ -178,6 +180,167 @@ public class FeatureSet { } } + /** + * Displays a flattened or "normalized" view of the featureSet. This is for simplifying user-facing display only. + */ + public static class FeatureSetFlattened { + String featureCategory; + String featureName; + boolean isSupported; + + List source = new ArrayList<>(3); + + public String getFeatureCategory() { + return featureCategory; + } + + public String getFeatureName() { + return featureName; + } + + public boolean isSupported() { + return isSupported; + } + + public List getSource() { + return ImmutableList.copyOf(source); + } + } + + public List flatten() { + // TODO: Look at making this method function more generically. + List states = new ArrayList<>(); + EnumSet.allOf(ClientModificationFeature.class).forEach(feat -> { + FeatureSetFlattened state = new FeatureSetFlattened(); + state.featureCategory = ClientModificationFeature.class.getSimpleName(); + state.featureName = feat.name(); + state.isSupported = this.clientModificationFeatures.contains(feat); + + try { + for (Annotation an : ClientModificationFeature.class.getField(feat.name()).getAnnotations()) { + state.source.add(AnnotationType.fromAnnotation(an.annotationType())); + } + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + states.add(state); + }); + EnumSet.allOf(DataTypeFeature.class).forEach(feat -> { + FeatureSetFlattened state = new FeatureSetFlattened(); + state.featureCategory = DataTypeFeature.class.getSimpleName(); + state.featureName = feat.name(); + state.isSupported = this.dataTypeFeatures.contains(feat); + + try { + for (Annotation an : DataTypeFeature.class.getField(feat.name()).getAnnotations()) { + state.source.add(AnnotationType.fromAnnotation(an.annotationType())); + } + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + + states.add(state); + }); + EnumSet.allOf(DocumentationFeature.class).forEach(feat -> { + FeatureSetFlattened state = new FeatureSetFlattened(); + state.featureCategory = DocumentationFeature.class.getSimpleName(); + state.featureName = feat.name(); + state.isSupported = this.documentationFeatures.contains(feat); + + try { + for (Annotation an : DocumentationFeature.class.getField(feat.name()).getAnnotations()) { + state.source.add(AnnotationType.fromAnnotation(an.annotationType())); + } + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + + states.add(state); + }); + EnumSet.allOf(SchemaSupportFeature.class).forEach(feat -> { + FeatureSetFlattened state = new FeatureSetFlattened(); + state.featureCategory = SchemaSupportFeature.class.getSimpleName(); + state.featureName = feat.name(); + state.isSupported = this.schemaSupportFeatures.contains(feat); + + try { + for (Annotation an : SchemaSupportFeature.class.getField(feat.name()).getAnnotations()) { + state.source.add(AnnotationType.fromAnnotation(an.annotationType())); + } + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + + states.add(state); + }); + EnumSet.allOf(GlobalFeature.class).forEach(feat -> { + FeatureSetFlattened state = new FeatureSetFlattened(); + state.featureCategory = GlobalFeature.class.getSimpleName(); + state.featureName = feat.name(); + state.isSupported = this.globalFeatures.contains(feat); + + try { + for (Annotation an : GlobalFeature.class.getField(feat.name()).getAnnotations()) { + state.source.add(AnnotationType.fromAnnotation(an.annotationType())); + } + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + + states.add(state); + }); + EnumSet.allOf(ParameterFeature.class).forEach(feat -> { + FeatureSetFlattened state = new FeatureSetFlattened(); + state.featureCategory = ParameterFeature.class.getSimpleName(); + state.featureName = feat.name(); + state.isSupported = this.parameterFeatures.contains(feat); + + try { + for (Annotation an : ParameterFeature.class.getField(feat.name()).getAnnotations()) { + state.source.add(AnnotationType.fromAnnotation(an.annotationType())); + } + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + + states.add(state); + }); + EnumSet.allOf(SecurityFeature.class).forEach(feat -> { + FeatureSetFlattened state = new FeatureSetFlattened(); + state.featureCategory = SecurityFeature.class.getSimpleName(); + state.featureName = feat.name(); + state.isSupported = this.securityFeatures.contains(feat); + + try { + for (Annotation an : SecurityFeature.class.getField(feat.name()).getAnnotations()) { + state.source.add(AnnotationType.fromAnnotation(an.annotationType())); + } + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + + states.add(state); + }); + EnumSet.allOf(WireFormatFeature.class).forEach(feat -> { + FeatureSetFlattened state = new FeatureSetFlattened(); + state.featureCategory = WireFormatFeature.class.getSimpleName(); + state.featureName = feat.name(); + state.isSupported = this.wireFormatFeatures.contains(feat); + + try { + for (Annotation an : WireFormatFeature.class.getField(feat.name()).getAnnotations()) { + state.source.add(AnnotationType.fromAnnotation(an.annotationType())); + } + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + + states.add(state); + }); + + return states; + } + /** * {@code FeatureSet} builder static inner class. */ diff --git a/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/meta/features/annotations/AnnotationType.java b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/meta/features/annotations/AnnotationType.java new file mode 100644 index 00000000000..82e3886d6be --- /dev/null +++ b/modules/openapi-generator-core/src/main/java/org/openapitools/codegen/meta/features/annotations/AnnotationType.java @@ -0,0 +1,12 @@ +package org.openapitools.codegen.meta.features.annotations; + +public enum AnnotationType { + OAS2, OAS3, ToolingExtension; + + public static AnnotationType fromAnnotation(Class input) { + if(input == OAS2.class) return AnnotationType.OAS2; + if(input == OAS3.class) return AnnotationType.OAS3; + if(input == ToolingExtension.class) return AnnotationType.ToolingExtension; + return null; + } +} diff --git a/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/meta/FeatureSetTest.java b/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/meta/FeatureSetTest.java new file mode 100644 index 00000000000..7378903d471 --- /dev/null +++ b/modules/openapi-generator-core/src/test/java/org/openapitools/codegen/meta/FeatureSetTest.java @@ -0,0 +1,136 @@ +package org.openapitools.codegen.meta; + +import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.meta.features.annotations.AnnotationType; +import org.testng.annotations.Test; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import static org.testng.Assert.*; + +public class FeatureSetTest { + + @Test + public void flattOnUnspecified() { + List flattened = FeatureSet.UNSPECIFIED.flatten(); + // There are 73 features at the time of writing this test. This makes sure we get a "Full" flat representation. + int knownFeatureCount = 73; + int checkedCount = 0; + assertTrue(flattened.size() >= knownFeatureCount); + + for (FeatureSet.FeatureSetFlattened f : flattened) { + checkedCount += 1; + assertFalse(f.isSupported); + } + + assertTrue(checkedCount >= knownFeatureCount); + } + + @Test + public void flattenOnMultipleFeatures() { + FeatureSet featureSet = FeatureSet.newBuilder() + .includeClientModificationFeatures(ClientModificationFeature.BasePath) + .includeDataTypeFeatures(DataTypeFeature.Int32, DataTypeFeature.Array) + .includeGlobalFeatures(GlobalFeature.Consumes, GlobalFeature.Examples) + .includeParameterFeatures(ParameterFeature.Body, ParameterFeature.Query) + .includeSecurityFeatures(SecurityFeature.BearerToken, SecurityFeature.BasicAuth, SecurityFeature.OAuth2_Implicit) + .includeDocumentationFeatures(DocumentationFeature.Model) + .includeSchemaSupportFeatures(SchemaSupportFeature.Composite) + .build(); + + List flattened = featureSet.flatten(); + List supported = new ArrayList<>(); + flattened.forEach(f -> { + if (f.isSupported) { + supported.add(f); + } + }); + + // note that the order of these checks is deterministic, but unrelated to feature inclusion order in this test. + assertEquals(supported.size(), 12); + + Set toolingOnly = new HashSet() {{ + add(AnnotationType.ToolingExtension); + }}; + Set oas2Only = new HashSet() {{ + add(AnnotationType.OAS2); + }}; + Set oas3Only = new HashSet() {{ + add(AnnotationType.OAS3); + }}; + Set bothSpecs = new HashSet() {{ + add(AnnotationType.OAS2); + add(AnnotationType.OAS3); + }}; + + assertEquals(supported.get(0).featureCategory, ClientModificationFeature.class.getSimpleName()); + assertEquals(supported.get(0).featureName, ClientModificationFeature.BasePath.name()); + assertEquals(new HashSet<>(supported.get(0).source), toolingOnly); + + assertEquals(supported.get(1).featureCategory, DataTypeFeature.class.getSimpleName()); + assertEquals(supported.get(1).featureName, DataTypeFeature.Int32.name()); + assertEquals(new HashSet<>(supported.get(1).source), bothSpecs); + + assertEquals(supported.get(2).featureCategory, DataTypeFeature.class.getSimpleName()); + assertEquals(supported.get(2).featureName, DataTypeFeature.Array.name()); + assertEquals(new HashSet<>(supported.get(2).source), bothSpecs); + + assertEquals(supported.get(3).featureCategory, DocumentationFeature.class.getSimpleName()); + assertEquals(supported.get(3).featureName, DocumentationFeature.Model.name()); + assertEquals(new HashSet<>(supported.get(3).source), toolingOnly); + + assertEquals(supported.get(4).featureCategory, SchemaSupportFeature.class.getSimpleName()); + assertEquals(supported.get(4).featureName, SchemaSupportFeature.Composite.name()); + assertEquals(new HashSet<>(supported.get(4).source), bothSpecs); + + assertEquals(supported.get(5).featureCategory, GlobalFeature.class.getSimpleName()); + assertEquals(supported.get(5).featureName, GlobalFeature.Consumes.name()); + assertEquals(new HashSet<>(supported.get(5).source), oas2Only); + + assertEquals(supported.get(6).featureCategory, GlobalFeature.class.getSimpleName()); + assertEquals(supported.get(6).featureName, GlobalFeature.Examples.name()); + assertEquals(new HashSet<>(supported.get(6).source), bothSpecs); + + assertEquals(supported.get(7).featureCategory, ParameterFeature.class.getSimpleName()); + assertEquals(supported.get(7).featureName, ParameterFeature.Query.name()); + assertEquals(new HashSet<>(supported.get(7).source), bothSpecs); + + assertEquals(supported.get(8).featureCategory, ParameterFeature.class.getSimpleName()); + assertEquals(supported.get(8).featureName, ParameterFeature.Body.name()); + assertEquals(new HashSet<>(supported.get(8).source), oas2Only); + + assertEquals(supported.get(9).featureCategory, SecurityFeature.class.getSimpleName()); + assertEquals(supported.get(9).featureName, SecurityFeature.BasicAuth.name()); + assertEquals(new HashSet<>(supported.get(9).source), bothSpecs); + + assertEquals(supported.get(10).featureCategory, SecurityFeature.class.getSimpleName()); + assertEquals(supported.get(10).featureName, SecurityFeature.BearerToken.name()); + assertEquals(new HashSet<>(supported.get(10).source), oas3Only); + + assertEquals(supported.get(11).featureCategory, SecurityFeature.class.getSimpleName()); + assertEquals(supported.get(11).featureName, SecurityFeature.OAuth2_Implicit.name()); + assertEquals(new HashSet<>(supported.get(11).source), bothSpecs); + } + + @Test + public void flattenOnSingleFeatures() { + FeatureSet featureSet = FeatureSet.newBuilder().includeClientModificationFeatures(ClientModificationFeature.BasePath).build(); + List flattened = featureSet.flatten(); + List supported = new ArrayList<>(); + flattened.forEach(f -> { + if (f.isSupported) { + supported.add(f); + } + }); + + assertEquals(supported.size(), 1); + assertEquals(supported.get(0).featureCategory, ClientModificationFeature.class.getSimpleName()); + assertEquals(supported.get(0).featureName, ClientModificationFeature.BasePath.name()); + assertEquals(new HashSet<>(supported.get(0).source), new HashSet() {{ + add(AnnotationType.ToolingExtension); + }}); + } +} \ No newline at end of file From 26c9c64634d30b9003da0758c230d5393607d89e Mon Sep 17 00:00:00 2001 From: Matt Traynham Date: Sat, 1 Feb 2020 22:12:11 -0500 Subject: [PATCH 74/85] [kotlin][client] Add inheritance to Kotlin Client templates (#4453) * Add inheritance to Kotlin Client templates * Correct white spacing issues * Rebuild kotlin client samples --- .../languages/AbstractKotlinCodegen.java | 4 ++++ .../kotlin-client/data_class.mustache | 19 ++++++++++--------- .../kotlin-client/data_class_opt_var.mustache | 2 +- .../kotlin-client/data_class_req_var.mustache | 2 +- .../kotlin-client/interface_opt_var.mustache | 12 ++++++++++++ .../kotlin-client/interface_req_var.mustache | 12 ++++++++++++ .../openapitools/client/models/ApiResponse.kt | 4 +--- .../openapitools/client/models/Category.kt | 4 +--- .../org/openapitools/client/models/Order.kt | 4 +--- .../org/openapitools/client/models/Pet.kt | 4 +--- .../org/openapitools/client/models/Tag.kt | 4 +--- .../org/openapitools/client/models/User.kt | 4 +--- .../openapitools/client/models/ApiResponse.kt | 4 +--- .../openapitools/client/models/Category.kt | 4 +--- .../org/openapitools/client/models/Order.kt | 4 +--- .../org/openapitools/client/models/Pet.kt | 4 +--- .../org/openapitools/client/models/Tag.kt | 4 +--- .../org/openapitools/client/models/User.kt | 4 +--- .../openapitools/client/models/ApiResponse.kt | 4 +--- .../openapitools/client/models/Category.kt | 4 +--- .../org/openapitools/client/models/Order.kt | 4 +--- .../org/openapitools/client/models/Pet.kt | 4 +--- .../org/openapitools/client/models/Tag.kt | 4 +--- .../org/openapitools/client/models/User.kt | 4 +--- .../openapitools/client/models/ApiResponse.kt | 4 +--- .../openapitools/client/models/Category.kt | 4 +--- .../org/openapitools/client/models/Order.kt | 4 +--- .../org/openapitools/client/models/Pet.kt | 4 +--- .../org/openapitools/client/models/Tag.kt | 4 +--- .../org/openapitools/client/models/User.kt | 4 +--- .../openapitools/client/models/ApiResponse.kt | 4 +--- .../openapitools/client/models/Category.kt | 4 +--- .../org/openapitools/client/models/Order.kt | 4 +--- .../org/openapitools/client/models/Pet.kt | 4 +--- .../org/openapitools/client/models/Tag.kt | 4 +--- .../org/openapitools/client/models/User.kt | 4 +--- .../openapitools/client/models/ApiResponse.kt | 6 ++---- .../openapitools/client/models/Category.kt | 6 ++---- .../org/openapitools/client/models/Order.kt | 6 ++---- .../org/openapitools/client/models/Pet.kt | 6 ++---- .../org/openapitools/client/models/Tag.kt | 6 ++---- .../org/openapitools/client/models/User.kt | 6 ++---- .../openapitools/client/models/ApiResponse.kt | 4 +--- .../openapitools/client/models/Category.kt | 4 +--- .../org/openapitools/client/models/Order.kt | 4 +--- .../org/openapitools/client/models/Pet.kt | 4 +--- .../org/openapitools/client/models/Tag.kt | 4 +--- .../org/openapitools/client/models/User.kt | 4 +--- .../openapitools/client/models/ApiResponse.kt | 4 +--- .../openapitools/client/models/Category.kt | 4 +--- .../org/openapitools/client/models/Order.kt | 4 +--- .../org/openapitools/client/models/Pet.kt | 4 +--- .../org/openapitools/client/models/Tag.kt | 4 +--- .../org/openapitools/client/models/User.kt | 4 +--- .../openapitools/client/models/ApiResponse.kt | 6 ++---- .../openapitools/client/models/Category.kt | 6 ++---- .../org/openapitools/client/models/Order.kt | 6 ++---- .../org/openapitools/client/models/Pet.kt | 14 ++++++-------- .../org/openapitools/client/models/Tag.kt | 6 ++---- .../org/openapitools/client/models/User.kt | 6 ++---- .../openapitools/client/models/ApiResponse.kt | 4 +--- .../openapitools/client/models/Category.kt | 4 +--- .../org/openapitools/client/models/Order.kt | 4 +--- .../org/openapitools/client/models/Pet.kt | 4 +--- .../org/openapitools/client/models/Tag.kt | 4 +--- .../org/openapitools/client/models/User.kt | 4 +--- .../openapitools/client/models/ApiResponse.kt | 6 ++---- .../openapitools/client/models/Category.kt | 6 ++---- .../org/openapitools/client/models/Order.kt | 6 ++---- .../org/openapitools/client/models/Pet.kt | 6 ++---- .../org/openapitools/client/models/Tag.kt | 6 ++---- .../org/openapitools/client/models/User.kt | 6 ++---- 72 files changed, 128 insertions(+), 231 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/interface_opt_var.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/interface_req_var.mustache 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 0c935ed9ff3..40e9f2e68b5 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 @@ -335,6 +335,10 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co for (Object _mo : models) { Map mo = (Map) _mo; CodegenModel cm = (CodegenModel) mo.get("model"); + if (cm.getDiscriminator() != null) { + cm.vendorExtensions.put("x-has-data-class-body", true); + break; + } for (CodegenProperty var : cm.vars) { if (var.isEnum || isSerializableModel()) { diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache index 47d2d5e9d28..fc43540f4e4 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache @@ -31,21 +31,22 @@ import java.io.Serializable @Parcelize {{/parcelizeModels}} {{#multiplatform}}@Serializable{{/multiplatform}}{{#moshi}}{{#moshiCodeGen}}@JsonClass(generateAdapter = true){{/moshiCodeGen}}{{/moshi}} -{{#nonPublicApi}}internal {{/nonPublicApi}}data class {{classname}} ( -{{#vars}} -{{#required}}{{>data_class_req_var}}{{/required}}{{^required}}{{>data_class_opt_var}}{{/required}}{{^-last}},{{/-last}} -{{/vars}} -) {{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}} -{{^parcelizeModels}}{{#serializableModel}}: Serializable {{/serializableModel}}{{/parcelizeModels}} -{{#parcelizeModels}}{{#serializableModel}} : Parcelable, Serializable {{/serializableModel}}{{/parcelizeModels}} -{{#vendorExtensions.x-has-data-class-body}} -{ +{{#nonPublicApi}}internal {{/nonPublicApi}}{{#discriminator}}interface{{/discriminator}}{{^discriminator}}data class{{/discriminator}} {{classname}}{{^discriminator}} ( +{{#requiredVars}} +{{>data_class_req_var}}{{^-last}}, +{{/-last}}{{/requiredVars}}{{#hasRequired}}{{#hasOptional}}, +{{/hasOptional}}{{/hasRequired}}{{#optionalVars}}{{>data_class_opt_var}}{{^-last}}, +{{/-last}}{{/optionalVars}} +){{/discriminator}}{{#parent}}{{^serializableModel}}{{^parcelizeModels}} : {{parent}}{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{^parcelizeModels}} : {{parent}}, Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{^serializableModel}}{{#parcelizeModels}} : {{parent}}, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{#parcelizeModels}} : {{parent}}, Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{^parcelizeModels}} : Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{#parcelizeModels}} : Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#vendorExtensions.x-has-data-class-body}} { {{/vendorExtensions.x-has-data-class-body}} {{#serializableModel}} {{#nonPublicApi}}internal {{/nonPublicApi}}companion object { private const val serialVersionUID: Long = 123 } {{/serializableModel}} +{{#discriminator}}{{#requiredVars}} +{{>interface_req_var}}{{/requiredVars}}{{#optionalVars}} +{{>interface_opt_var}}{{/optionalVars}}{{/discriminator}} {{#hasEnums}} {{#vars}} {{#isEnum}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache index 3a8d2871db6..f8c93c5fdd5 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache @@ -9,4 +9,4 @@ @SerializedName("{{{vendorExtensions.x-base-name-literal}}}") {{/gson}} {{/multiplatform}} - {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}} \ No newline at end of file + {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache index ca645e26c85..9fdca570a59 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache @@ -9,4 +9,4 @@ @SerializedName("{{{vendorExtensions.x-base-name-literal}}}") {{/gson}} {{/multiplatform}} - {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}} \ No newline at end of file + {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/interface_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/interface_opt_var.mustache new file mode 100644 index 00000000000..fa8f1c310c2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/interface_opt_var.mustache @@ -0,0 +1,12 @@ +{{#description}} + /* {{{description}}} */ +{{/description}} + {{^multiplatform}} + {{#moshi}} + @Json(name = "{{{vendorExtensions.x-base-name-literal}}}") + {{/moshi}} + {{#gson}} + @SerializedName("{{{vendorExtensions.x-base-name-literal}}}") + {{/gson}} + {{/multiplatform}} + {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/interface_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/interface_req_var.mustache new file mode 100644 index 00000000000..ca645e26c85 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/interface_req_var.mustache @@ -0,0 +1,12 @@ +{{#description}} + /* {{{description}}} */ +{{/description}} + {{^multiplatform}} + {{#moshi}} + @Json(name = "{{{vendorExtensions.x-base-name-literal}}}") + {{/moshi}} + {{#gson}} + @SerializedName("{{{vendorExtensions.x-base-name-literal}}}") + {{/gson}} + {{/multiplatform}} + {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 96b24b0b2b2..51a090c496e 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -27,7 +27,5 @@ data class ApiResponse ( val type: kotlin.String? = null, @SerializedName("message") val message: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt index d0af4fb050b..0e978e11fd6 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -24,7 +24,5 @@ data class Category ( val id: kotlin.Long? = null, @SerializedName("name") val name: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt index 5a33789128b..ae3a28a775e 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -37,10 +37,8 @@ data class Order ( val status: Order.Status? = null, @SerializedName("complete") val complete: kotlin.Boolean? = null -) +) { - -{ /** * Order Status * Values: placed,approved,delivered diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt index 9a500cc7037..4a5187302bd 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -39,10 +39,8 @@ data class Pet ( /* pet status in the store */ @SerializedName("status") val status: Pet.Status? = null -) +) { - -{ /** * pet status in the store * Values: available,pending,sold diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt index 484f3db87cd..71d9cb767be 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -24,7 +24,5 @@ data class Tag ( val id: kotlin.Long? = null, @SerializedName("name") val name: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt index 4a660298d73..c2158935c59 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/User.kt @@ -43,7 +43,5 @@ data class User ( /* User Status */ @SerializedName("userStatus") val userStatus: kotlin.Int? = null -) - - +) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 47766821f18..ada15fee7a1 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -27,7 +27,5 @@ data class ApiResponse ( val type: kotlin.String? = null, @Json(name = "message") val message: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Category.kt index edb16cc1270..426a0e51592 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -24,7 +24,5 @@ data class Category ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Order.kt index 6bf55feb4ea..3cfa5ca9626 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -37,10 +37,8 @@ data class Order ( val status: Order.Status? = null, @Json(name = "complete") val complete: kotlin.Boolean? = null -) +) { - -{ /** * Order Status * Values: placed,approved,delivered diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Pet.kt index ad4623a4ad1..a94bb811c3b 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -39,10 +39,8 @@ data class Pet ( /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null -) +) { - -{ /** * pet status in the store * Values: available,pending,sold diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Tag.kt index 05dc7c9afef..f9ef87e13fb 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -24,7 +24,5 @@ data class Tag ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/User.kt index 537b01d3c27..dfd63806da9 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/User.kt @@ -43,7 +43,5 @@ data class User ( /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) - - +) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 7db8d675141..25f8ffdf473 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -28,7 +28,5 @@ data class ApiResponse ( val type: kotlin.String? = null, @Json(name = "message") val message: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Category.kt index e7a69536f8e..e7229ac4384 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -25,7 +25,5 @@ data class Category ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Order.kt index dd01d68e3f0..c408adac995 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -38,10 +38,8 @@ data class Order ( val status: Order.Status? = null, @Json(name = "complete") val complete: kotlin.Boolean? = null -) +) { - -{ /** * Order Status * Values: placed,approved,delivered diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Pet.kt index d139610db01..abba68a0646 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -40,10 +40,8 @@ data class Pet ( /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null -) +) { - -{ /** * pet status in the store * Values: available,pending,sold diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Tag.kt index 3fd7bf14b7e..c1da1f74c35 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -25,7 +25,5 @@ data class Tag ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/User.kt index f91f96df6ac..3d9ab220849 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/User.kt @@ -44,7 +44,5 @@ data class User ( /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) - - +) diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt index 3f05f17779e..51ab6ed9398 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -25,7 +25,5 @@ data class ApiResponse ( @SerialName(value = "code") val code: kotlin.Int? = null, @SerialName(value = "type") val type: kotlin.String? = null, @SerialName(value = "message") val message: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt index eff7d12a4ab..96432c658ad 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt @@ -23,7 +23,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer data class Category ( @SerialName(value = "id") val id: kotlin.Long? = null, @SerialName(value = "name") val name: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt index e6cdd21a006..ec1a0d28e31 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt @@ -32,10 +32,8 @@ data class Order ( /* Order Status */ @SerialName(value = "status") val status: Order.Status? = null, @SerialName(value = "complete") val complete: kotlin.Boolean? = null -) +) { - -{ /** * Order Status * Values: placed,approved,delivered diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt index 583826a79a1..5e33d005670 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt @@ -34,10 +34,8 @@ data class Pet ( @SerialName(value = "tags") val tags: kotlin.Array? = null, /* pet status in the store */ @SerialName(value = "status") val status: Pet.Status? = null -) +) { - -{ /** * pet status in the store * Values: available,pending,sold diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt index 6c5ce642e78..b21e51bf8d3 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt @@ -23,7 +23,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer data class Tag ( @SerialName(value = "id") val id: kotlin.Long? = null, @SerialName(value = "name") val name: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt index dd092dfd707..7d52e737d49 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt @@ -36,7 +36,5 @@ data class User ( @SerialName(value = "phone") val phone: kotlin.String? = null, /* User Status */ @SerialName(value = "userStatus") val userStatus: kotlin.Int? = null -) - - +) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index a5bb4448914..4a2f8b137cc 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -27,7 +27,5 @@ internal data class ApiResponse ( val type: kotlin.String? = null, @Json(name = "message") val message: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Category.kt index 70ed6b25e57..10d567d3c3c 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -24,7 +24,5 @@ internal data class Category ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Order.kt index fcec740e09e..8a44803771b 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -37,10 +37,8 @@ internal data class Order ( val status: Order.Status? = null, @Json(name = "complete") val complete: kotlin.Boolean? = null -) +) { - -{ /** * Order Status * Values: placed,approved,delivered diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Pet.kt index aedb57e436d..fe63282fa21 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -39,10 +39,8 @@ internal data class Pet ( /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null -) +) { - -{ /** * pet status in the store * Values: available,pending,sold diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Tag.kt index 0c36f402fda..2a130c6cd1d 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -24,7 +24,5 @@ internal data class Tag ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/User.kt index 2070fe6d80b..afac563f29c 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/User.kt @@ -43,7 +43,5 @@ internal data class User ( /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) - - +) diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 8d5c8448f04..eed5027e801 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -28,12 +28,10 @@ data class ApiResponse ( val type: kotlin.String? = null, @Json(name = "message") val message: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt index 7895d7627ab..f29e6833057 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -25,12 +25,10 @@ data class Category ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt index 452a176c120..2b92b4375d1 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -38,13 +38,11 @@ data class Order ( val status: Order.Status? = null, @Json(name = "complete") val complete: kotlin.Boolean? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + /** * Order Status * Values: placed,approved,delivered diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt index eb78e6d7140..bb0a5df6e19 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -40,13 +40,11 @@ data class Pet ( /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + /** * pet status in the store * Values: available,pending,sold diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt index 7fb74357125..aa93e435695 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -25,12 +25,10 @@ data class Tag ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt index e66f3cf09fe..7487ed927d1 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/User.kt @@ -44,12 +44,10 @@ data class User ( /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 47766821f18..ada15fee7a1 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -27,7 +27,5 @@ data class ApiResponse ( val type: kotlin.String? = null, @Json(name = "message") val message: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Category.kt index edb16cc1270..426a0e51592 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -24,7 +24,5 @@ data class Category ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt index 6bf55feb4ea..3cfa5ca9626 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -37,10 +37,8 @@ data class Order ( val status: Order.Status? = null, @Json(name = "complete") val complete: kotlin.Boolean? = null -) +) { - -{ /** * Order Status * Values: placed,approved,delivered diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt index ad4623a4ad1..a94bb811c3b 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -39,10 +39,8 @@ data class Pet ( /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null -) +) { - -{ /** * pet status in the store * Values: available,pending,sold diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Tag.kt index 05dc7c9afef..f9ef87e13fb 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -24,7 +24,5 @@ data class Tag ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/User.kt index 537b01d3c27..dfd63806da9 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/User.kt @@ -43,7 +43,5 @@ data class User ( /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) - - +) diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 47766821f18..ada15fee7a1 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -27,7 +27,5 @@ data class ApiResponse ( val type: kotlin.String? = null, @Json(name = "message") val message: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Category.kt index edb16cc1270..426a0e51592 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -24,7 +24,5 @@ data class Category ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Order.kt index 6bf55feb4ea..3cfa5ca9626 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -37,10 +37,8 @@ data class Order ( val status: Order.Status? = null, @Json(name = "complete") val complete: kotlin.Boolean? = null -) +) { - -{ /** * Order Status * Values: placed,approved,delivered diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Pet.kt index ad4623a4ad1..a94bb811c3b 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -39,10 +39,8 @@ data class Pet ( /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null -) +) { - -{ /** * pet status in the store * Values: available,pending,sold diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Tag.kt index 05dc7c9afef..f9ef87e13fb 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -24,7 +24,5 @@ data class Tag ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/User.kt index 537b01d3c27..dfd63806da9 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/User.kt @@ -43,7 +43,5 @@ data class User ( /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) - - +) diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 8d5c8448f04..eed5027e801 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -28,12 +28,10 @@ data class ApiResponse ( val type: kotlin.String? = null, @Json(name = "message") val message: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt index 7895d7627ab..f29e6833057 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -25,12 +25,10 @@ data class Category ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt index cb75cf72b89..847b3ff5e28 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -38,13 +38,11 @@ data class Order ( val status: Order.Status? = null, @Json(name = "complete") val complete: kotlin.Boolean? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + /** * Order Status * Values: placed,approved,delivered diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt index c6a47fdc0c4..f978ea477ea 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -27,26 +27,24 @@ import java.io.Serializable */ 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.Array, + @Json(name = "id") + val id: kotlin.Long? = null, + @Json(name = "category") + val category: Category? = null, @Json(name = "tags") val tags: kotlin.Array? = null, /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + /** * pet status in the store * Values: available,pending,sold diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt index 7fb74357125..aa93e435695 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -25,12 +25,10 @@ data class Tag ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt index e66f3cf09fe..7487ed927d1 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt @@ -44,12 +44,10 @@ data class User ( /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 47766821f18..ada15fee7a1 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -27,7 +27,5 @@ data class ApiResponse ( val type: kotlin.String? = null, @Json(name = "message") val message: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt index edb16cc1270..426a0e51592 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -24,7 +24,5 @@ data class Category ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt index cb25060ae82..8f947e96651 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -37,10 +37,8 @@ data class Order ( val status: Order.Status? = null, @Json(name = "complete") val complete: kotlin.Boolean? = null -) +) { - -{ /** * Order Status * Values: placed,approved,delivered diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt index ad4623a4ad1..a94bb811c3b 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -39,10 +39,8 @@ data class Pet ( /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null -) +) { - -{ /** * pet status in the store * Values: available,pending,sold diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt index 05dc7c9afef..f9ef87e13fb 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -24,7 +24,5 @@ data class Tag ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) - - +) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt index 537b01d3c27..dfd63806da9 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt @@ -43,7 +43,5 @@ data class User ( /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) - - +) diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 8d5c8448f04..eed5027e801 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -28,12 +28,10 @@ data class ApiResponse ( val type: kotlin.String? = null, @Json(name = "message") val message: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt index 7895d7627ab..f29e6833057 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -25,12 +25,10 @@ data class Category ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt index 452a176c120..2b92b4375d1 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -38,13 +38,11 @@ data class Order ( val status: Order.Status? = null, @Json(name = "complete") val complete: kotlin.Boolean? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + /** * Order Status * Values: placed,approved,delivered diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt index eb78e6d7140..bb0a5df6e19 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -40,13 +40,11 @@ data class Pet ( /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + /** * pet status in the store * Values: available,pending,sold diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt index 7fb74357125..aa93e435695 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -25,12 +25,10 @@ data class Tag ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt index e66f3cf09fe..7487ed927d1 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt @@ -44,12 +44,10 @@ data class User ( /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } From f356de606b367aee34aac57da34108827aa6b139 Mon Sep 17 00:00:00 2001 From: Tatsuro Shibamura Date: Mon, 3 Feb 2020 01:15:33 +0900 Subject: [PATCH 75/85] [csharp-netcore] Improved `Multimap` and `ClientUtils` implementation (#5122) * Improvement Multimap impl * Fixed missing semi-colon * Fixed compile error using .NET Standard 2.0 * Fixed compile error using .NET Standard 2.0 * Update sample projects * Apply modifications to additional code flows --- .../csharp-netcore/ClientUtils.mustache | 69 ++---- .../csharp-netcore/Multimap.mustache | 129 ++++------ .../resources/csharp-netcore/api.mustache | 48 +--- .../src/Org.OpenAPITools/Api/FakeApi.cs | 224 +++--------------- .../Api/FakeClassnameTags123Api.cs | 16 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 32 +-- .../src/Org.OpenAPITools/Api/UserApi.cs | 32 +-- .../Org.OpenAPITools/Client/ClientUtils.cs | 69 ++---- .../src/Org.OpenAPITools/Client/Multimap.cs | 120 +++++----- .../src/Org.OpenAPITools/Api/FakeApi.cs | 224 +++--------------- .../Api/FakeClassnameTags123Api.cs | 16 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 32 +-- .../src/Org.OpenAPITools/Api/UserApi.cs | 32 +-- .../Org.OpenAPITools/Client/ClientUtils.cs | 69 ++---- .../src/Org.OpenAPITools/Client/Multimap.cs | 120 +++++----- 15 files changed, 289 insertions(+), 943 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache index 4528441a5ab..8601b2e9c34 100755 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/ClientUtils.mustache @@ -2,13 +2,10 @@ using System; using System.Collections; -using System.Collections.Generic; using System.IO; using System.Linq; -using System.Net; using System.Text; using System.Text.RegularExpressions; -using System.Threading.Tasks; {{#useCompareNetObjects}} using KellermanSoftware.CompareNetObjects; {{/useCompareNetObjects}} @@ -58,15 +55,11 @@ namespace {{packageName}}.Client { var parameters = new Multimap(); - if (IsCollection(value) && collectionFormat == "multi") + if (value is ICollection collection && collectionFormat == "multi") { - var valueCollection = value as IEnumerable; - if (valueCollection != null) + foreach (var item in collection) { - foreach (var item in valueCollection) - { - parameters.Add(name, ParameterToString(item)); - } + parameters.Add(name, ParameterToString(item)); } } else @@ -87,49 +80,26 @@ namespace {{packageName}}.Client /// Formatted string. public static string ParameterToString(object obj, IReadableConfiguration configuration = null) { - if (obj is DateTime) + if (obj is DateTime dateTime) // Return a formatted date string - Can be customized with Configuration.DateTimeFormat // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 - return ((DateTime)obj).ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); - else if (obj is DateTimeOffset) + return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is DateTimeOffset dateTimeOffset) // Return a formatted date string - Can be customized with Configuration.DateTimeFormat // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 - return ((DateTimeOffset)obj).ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); - else if (obj is bool) - return (bool)obj ? "true" : "false"; - else - { - if (obj is IList) - { - var list = obj as IList; - var flattenedString = new StringBuilder(); - foreach (var param in list) - { - if (flattenedString.Length > 0) - flattenedString.Append(","); - flattenedString.Append(param); - } - return flattenedString.ToString(); - } - - return Convert.ToString (obj); - } + return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is bool boolean) + return boolean ? "true" : "false"; + if (obj is ICollection collection) + return string.Join(",", collection.Cast()); + + return Convert.ToString(obj); } - - /// - /// Check if generic object is a collection. - /// - /// - /// True if object is a collection type - private static bool IsCollection(object value) - { - return value is IList || value is ICollection; - } - + /// /// URL encode a string /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 @@ -172,7 +142,7 @@ namespace {{packageName}}.Client /// Encoded string. public static string Base64Encode(string text) { - return System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); } /// @@ -182,14 +152,9 @@ namespace {{packageName}}.Client /// Byte array public static byte[] ReadAsBytes(Stream inputStream) { - byte[] buf = new byte[16*1024]; - using (MemoryStream ms = new MemoryStream()) + using (var ms = new MemoryStream()) { - int count; - while ((count = inputStream.Read(buf, 0, buf.Length)) > 0) - { - ms.Write(buf, 0, count); - } + inputStream.CopyTo(ms); return ms.ToArray(); } } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/Multimap.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/Multimap.mustache index 7e8c97a8324..8624af00924 100755 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/Multimap.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/Multimap.mustache @@ -2,7 +2,6 @@ using System; using System.Collections; -{{^net35}}using System.Collections.Concurrent;{{/net35}} using System.Collections.Generic; namespace {{packageName}}.Client @@ -10,13 +9,13 @@ namespace {{packageName}}.Client /// /// A dictionary in which one key has many associated values. /// - /// The type of the key + /// The type of the key /// The type of the value associated with the key. - public class Multimap : IDictionary> + public class Multimap : IDictionary> { #region Private Fields - private readonly {{^net35}}Concurrent{{/net35}}Dictionary> _dictionary; + private readonly Dictionary> _dictionary; #endregion Private Fields @@ -27,16 +26,16 @@ namespace {{packageName}}.Client /// public Multimap() { - _dictionary = new {{^net35}}Concurrent{{/net35}}Dictionary>(); + _dictionary = new Dictionary>(); } /// /// Constructor with comparer. /// /// - public Multimap(IEqualityComparer comparer) + public Multimap(IEqualityComparer comparer) { - _dictionary = new {{^net35}}Concurrent{{/net35}}Dictionary>(comparer); + _dictionary = new Dictionary>(comparer); } #endregion Constructors @@ -47,7 +46,7 @@ namespace {{packageName}}.Client /// To get the enumerator. /// /// Enumerator - public IEnumerator>> GetEnumerator() + public IEnumerator>> GetEnumerator() { return _dictionary.GetEnumerator(); } @@ -68,12 +67,25 @@ namespace {{packageName}}.Client /// Add values to Multimap /// /// Key value pair - public void Add(KeyValuePair> item) + public void Add(KeyValuePair> item) { if (!TryAdd(item.Key, item.Value)) throw new InvalidOperationException("Could not add values to Multimap."); } + /// + /// Add Multimap to Multimap + /// + /// Multimap + public void Add(Multimap multimap) + { + foreach (var item in multimap) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + /// /// Clear Multimap /// @@ -88,7 +100,7 @@ namespace {{packageName}}.Client /// Key value pair /// Method needs to be implemented /// true if the Multimap contains the item; otherwise, false. - public bool Contains(KeyValuePair> item) + public bool Contains(KeyValuePair> item) { throw new NotImplementedException(); } @@ -101,7 +113,7 @@ namespace {{packageName}}.Client /// from Multimap. The array must have zero-based indexing. /// The zero-based index in array at which copying begins. /// Method needs to be implemented - public void CopyTo(KeyValuePair>[] array, int arrayIndex) + public void CopyTo(KeyValuePair>[] array, int arrayIndex) { throw new NotImplementedException(); } @@ -112,7 +124,7 @@ namespace {{packageName}}.Client /// Key value pair /// true if the item is successfully removed; otherwise, false. /// Method needs to be implemented - public bool Remove(KeyValuePair> item) + public bool Remove(KeyValuePair> item) { throw new NotImplementedException(); } @@ -120,24 +132,12 @@ namespace {{packageName}}.Client /// /// Gets the number of items contained in the Multimap. /// - public int Count - { - get - { - return _dictionary.Count; - } - } + public int Count => _dictionary.Count; /// /// Gets a value indicating whether the Multimap is read-only. /// - public bool IsReadOnly - { - get - { - return false; - } - } + public bool IsReadOnly => false; /// /// Adds an item with the provided key and value to the Multimap. @@ -145,12 +145,11 @@ namespace {{packageName}}.Client /// The object to use as the key of the item to add. /// The object to use as the value of the item to add. /// Thrown when couldn't add the value to Multimap. - public void Add(T key, IList value) + public void Add(TKey key, IList value) { if (value != null && value.Count > 0) { - IList list; - if (_dictionary.TryGetValue(key, out list)) + if (_dictionary.TryGetValue(key, out var list)) { foreach (var k in value) list.Add(k); } @@ -169,7 +168,7 @@ namespace {{packageName}}.Client /// The key to locate in the Multimap. /// true if the Multimap contains an item with /// the key; otherwise, false. - public bool ContainsKey(T key) + public bool ContainsKey(TKey key) { return _dictionary.ContainsKey(key); } @@ -179,10 +178,9 @@ namespace {{packageName}}.Client /// /// The key to locate in the Multimap. /// true if the item is successfully removed; otherwise, false. - public bool Remove(T key) + public bool Remove(TKey key) { - IList list; - return TryRemove(key, out list); + return TryRemove(key, out var _); } /// @@ -194,7 +192,7 @@ namespace {{packageName}}.Client /// This parameter is passed uninitialized. /// true if the object that implements Multimap contains /// an item with the specified key; otherwise, false. - public bool TryGetValue(T key, out IList value) + public bool TryGetValue(TKey key, out IList value) { return _dictionary.TryGetValue(key, out value); } @@ -204,36 +202,21 @@ namespace {{packageName}}.Client /// /// The key of the item to get or set. /// The value of the specified key. - public IList this[T key] + public IList this[TKey key] { - get - { - return _dictionary[key]; - } - set { _dictionary[key] = value; } + get => _dictionary[key]; + set => _dictionary[key] = value; } /// /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. /// - public ICollection Keys - { - get - { - return _dictionary.Keys; - } - } + public ICollection Keys => _dictionary.Keys; /// /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. /// - public ICollection> Values - { - get - { - return _dictionary.Values; - } - } + public ICollection> Values => _dictionary.Values; /// /// Copy the items of the Multimap to an System.Array, @@ -244,7 +227,7 @@ namespace {{packageName}}.Client /// The zero-based index in array at which copying begins. public void CopyTo(Array array, int index) { - ((ICollection) _dictionary).CopyTo(array, index); + ((ICollection)_dictionary).CopyTo(array, index); } /// @@ -253,19 +236,17 @@ namespace {{packageName}}.Client /// The object to use as the key of the item to add. /// The object to use as the value of the item to add. /// Thrown when couldn't add value to Multimap. - public void Add(T key, TValue value) + public void Add(TKey key, TValue value) { if (value != null) { - IList list; - if (_dictionary.TryGetValue(key, out list)) + if (_dictionary.TryGetValue(key, out var list)) { list.Add(value); } else { - list = new List(); - list.Add(value); + list = new List { value }; if (!TryAdd(key, list)) throw new InvalidOperationException("Could not add value to Multimap."); } @@ -279,45 +260,27 @@ namespace {{packageName}}.Client /** * Helper method to encapsulate generator differences between dictionary types. */ - private bool TryRemove(T key, out IList value) + private bool TryRemove(TKey key, out IList value) { - {{^net35}}return _dictionary.TryRemove(key, out value);{{/net35}} - {{#net35}}try - { - _dictionary.TryGetValue(key, out value); - _dictionary.Remove(key); - } -#pragma warning disable 168 - catch (ArgumentException e) -#pragma warning restore 168 - { - value = null; - return false; - } - - return true;{{/net35}} + _dictionary.TryGetValue(key, out value); + return _dictionary.Remove(key); } /** * Helper method to encapsulate generator differences between dictionary types. */ - private bool TryAdd(T key, IList value) + private bool TryAdd(TKey key, IList value) { - {{^net35}}return _dictionary.TryAdd(key, value);{{/net35}} - {{#net35}} try { _dictionary.Add(key, value); } -#pragma warning disable 168 - catch (ArgumentException e) -#pragma warning restore 168 + catch (ArgumentException) { return false; } return true; - {{/net35}} } #endregion Private Members } diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache index e8a32d382a8..f149f196b39 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache @@ -268,23 +268,11 @@ namespace {{packageName}}.{{apiPackage}} {{^vendorExtensions.x-csharp-value-type}} if ({{paramName}} != null) { - foreach (var _kvp in {{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); } {{/vendorExtensions.x-csharp-value-type}} {{#vendorExtensions.x-csharp-value-type}} - foreach (var _kvp in {{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); {{/vendorExtensions.x-csharp-value-type}} {{/queryParams}} {{#headerParams}} @@ -333,13 +321,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isKeyInQuery}} if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) { - foreach (var _kvp in {{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); } {{/isKeyInQuery}} {{/isApiKey}} @@ -438,23 +420,11 @@ namespace {{packageName}}.{{apiPackage}} {{^vendorExtensions.x-csharp-value-type}} if ({{paramName}} != null) { - foreach (var _kvp in {{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); } {{/vendorExtensions.x-csharp-value-type}} {{#vendorExtensions.x-csharp-value-type}} - foreach (var _kvp in {{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); {{/vendorExtensions.x-csharp-value-type}} {{/queryParams}} {{#headerParams}} @@ -503,13 +473,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isKeyInQuery}} if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) { - foreach (var _kvp in {{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("", "{{keyParamName}}", this.Configuration.GetApiKeyWithPrefix("{{keyParamName}}"))); } {{/isKeyInQuery}} {{/isApiKey}} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index 6c0797b7ffe..a4ab49f4424 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1567,13 +1567,7 @@ namespace Org.OpenAPITools.Api if (query != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); } localVarRequestOptions.Data = body; @@ -1639,13 +1633,7 @@ namespace Org.OpenAPITools.Api if (query != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); } localVarRequestOptions.Data = body; @@ -2110,43 +2098,19 @@ namespace Org.OpenAPITools.Api if (enumQueryStringArray != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "enum_query_string_array", enumQueryStringArray)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "enum_query_string_array", enumQueryStringArray)); } if (enumQueryString != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString)); } if (enumQueryInteger != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger)); } if (enumQueryDouble != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble)); } if (enumHeaderStringArray != null) localVarRequestOptions.HeaderParameters.Add("enum_header_string_array", Org.OpenAPITools.Client.ClientUtils.ParameterToString(enumHeaderStringArray)); // header parameter @@ -2227,43 +2191,19 @@ namespace Org.OpenAPITools.Api if (enumQueryStringArray != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "enum_query_string_array", enumQueryStringArray)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "enum_query_string_array", enumQueryStringArray)); } if (enumQueryString != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString)); } if (enumQueryInteger != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger)); } if (enumQueryDouble != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble)); } if (enumHeaderStringArray != null) localVarRequestOptions.HeaderParameters.Add("enum_header_string_array", Org.OpenAPITools.Client.ClientUtils.ParameterToString(enumHeaderStringArray)); // header parameter @@ -2336,39 +2276,15 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); if (stringGroup != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup)); } if (int64Group != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group)); } localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter if (booleanGroup != null) @@ -2433,39 +2349,15 @@ namespace Org.OpenAPITools.Api foreach (var _accept in _accepts) localVarRequestOptions.HeaderParameters.Add("Accept", _accept); - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); if (stringGroup != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup)); } if (int64Group != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group)); } localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter if (booleanGroup != null) @@ -2797,53 +2689,23 @@ namespace Org.OpenAPITools.Api if (pipe != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe)); } if (ioutil != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); } if (http != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); } if (url != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url)); } if (context != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context)); } @@ -2925,53 +2787,23 @@ namespace Org.OpenAPITools.Api if (pipe != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe)); } if (ioutil != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); } if (http != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); } if (url != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url)); } if (context != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context)); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index ebf022334c8..492bae795c4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -244,13 +244,7 @@ namespace Org.OpenAPITools.Api // authentication (api_key_query) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query"))) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query"))) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query"))); } // make the HTTP request @@ -313,13 +307,7 @@ namespace Org.OpenAPITools.Api // authentication (api_key_query) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query"))) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query"))) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query"))); } // make the HTTP request diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs index 5c4a624d26a..0fe84290ce2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs @@ -851,13 +851,7 @@ namespace Org.OpenAPITools.Api if (status != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); } // authentication (petstore_auth) required @@ -924,13 +918,7 @@ namespace Org.OpenAPITools.Api if (status != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); } // authentication (petstore_auth) required @@ -996,13 +984,7 @@ namespace Org.OpenAPITools.Api if (tags != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); } // authentication (petstore_auth) required @@ -1069,13 +1051,7 @@ namespace Org.OpenAPITools.Api if (tags != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); } // authentication (petstore_auth) required diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs index 3f1585ce46e..57e4e369cc5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs @@ -1100,23 +1100,11 @@ namespace Org.OpenAPITools.Api if (username != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); } if (password != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); } @@ -1183,23 +1171,11 @@ namespace Org.OpenAPITools.Api if (username != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); } if (password != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs index dde50ca71de..764ea009ef9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -11,13 +11,10 @@ using System; using System.Collections; -using System.Collections.Generic; using System.IO; using System.Linq; -using System.Net; using System.Text; using System.Text.RegularExpressions; -using System.Threading.Tasks; using KellermanSoftware.CompareNetObjects; namespace Org.OpenAPITools.Client @@ -63,15 +60,11 @@ namespace Org.OpenAPITools.Client { var parameters = new Multimap(); - if (IsCollection(value) && collectionFormat == "multi") + if (value is ICollection collection && collectionFormat == "multi") { - var valueCollection = value as IEnumerable; - if (valueCollection != null) + foreach (var item in collection) { - foreach (var item in valueCollection) - { - parameters.Add(name, ParameterToString(item)); - } + parameters.Add(name, ParameterToString(item)); } } else @@ -92,49 +85,26 @@ namespace Org.OpenAPITools.Client /// Formatted string. public static string ParameterToString(object obj, IReadableConfiguration configuration = null) { - if (obj is DateTime) + if (obj is DateTime dateTime) // Return a formatted date string - Can be customized with Configuration.DateTimeFormat // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 - return ((DateTime)obj).ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); - else if (obj is DateTimeOffset) + return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is DateTimeOffset dateTimeOffset) // Return a formatted date string - Can be customized with Configuration.DateTimeFormat // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 - return ((DateTimeOffset)obj).ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); - else if (obj is bool) - return (bool)obj ? "true" : "false"; - else - { - if (obj is IList) - { - var list = obj as IList; - var flattenedString = new StringBuilder(); - foreach (var param in list) - { - if (flattenedString.Length > 0) - flattenedString.Append(","); - flattenedString.Append(param); - } - return flattenedString.ToString(); - } - - return Convert.ToString (obj); - } + return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is bool boolean) + return boolean ? "true" : "false"; + if (obj is ICollection collection) + return string.Join(",", collection.Cast()); + + return Convert.ToString(obj); } - - /// - /// Check if generic object is a collection. - /// - /// - /// True if object is a collection type - private static bool IsCollection(object value) - { - return value is IList || value is ICollection; - } - + /// /// URL encode a string /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 @@ -177,7 +147,7 @@ namespace Org.OpenAPITools.Client /// Encoded string. public static string Base64Encode(string text) { - return System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); } /// @@ -187,14 +157,9 @@ namespace Org.OpenAPITools.Client /// Byte array public static byte[] ReadAsBytes(Stream inputStream) { - byte[] buf = new byte[16*1024]; - using (MemoryStream ms = new MemoryStream()) + using (var ms = new MemoryStream()) { - int count; - while ((count = inputStream.Read(buf, 0, buf.Length)) > 0) - { - ms.Write(buf, 0, count); - } + inputStream.CopyTo(ms); return ms.ToArray(); } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Multimap.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Multimap.cs index 4bde7f7ffe4..b0449fb764d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Multimap.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Multimap.cs @@ -11,7 +11,6 @@ using System; using System.Collections; -using System.Collections.Concurrent; using System.Collections.Generic; namespace Org.OpenAPITools.Client @@ -19,13 +18,13 @@ namespace Org.OpenAPITools.Client /// /// A dictionary in which one key has many associated values. /// - /// The type of the key + /// The type of the key /// The type of the value associated with the key. - public class Multimap : IDictionary> + public class Multimap : IDictionary> { #region Private Fields - private readonly ConcurrentDictionary> _dictionary; + private readonly Dictionary> _dictionary; #endregion Private Fields @@ -36,16 +35,16 @@ namespace Org.OpenAPITools.Client /// public Multimap() { - _dictionary = new ConcurrentDictionary>(); + _dictionary = new Dictionary>(); } /// /// Constructor with comparer. /// /// - public Multimap(IEqualityComparer comparer) + public Multimap(IEqualityComparer comparer) { - _dictionary = new ConcurrentDictionary>(comparer); + _dictionary = new Dictionary>(comparer); } #endregion Constructors @@ -56,7 +55,7 @@ namespace Org.OpenAPITools.Client /// To get the enumerator. /// /// Enumerator - public IEnumerator>> GetEnumerator() + public IEnumerator>> GetEnumerator() { return _dictionary.GetEnumerator(); } @@ -77,12 +76,25 @@ namespace Org.OpenAPITools.Client /// Add values to Multimap /// /// Key value pair - public void Add(KeyValuePair> item) + public void Add(KeyValuePair> item) { if (!TryAdd(item.Key, item.Value)) throw new InvalidOperationException("Could not add values to Multimap."); } + /// + /// Add Multimap to Multimap + /// + /// Multimap + public void Add(Multimap multimap) + { + foreach (var item in multimap) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + /// /// Clear Multimap /// @@ -97,7 +109,7 @@ namespace Org.OpenAPITools.Client /// Key value pair /// Method needs to be implemented /// true if the Multimap contains the item; otherwise, false. - public bool Contains(KeyValuePair> item) + public bool Contains(KeyValuePair> item) { throw new NotImplementedException(); } @@ -110,7 +122,7 @@ namespace Org.OpenAPITools.Client /// from Multimap. The array must have zero-based indexing. /// The zero-based index in array at which copying begins. /// Method needs to be implemented - public void CopyTo(KeyValuePair>[] array, int arrayIndex) + public void CopyTo(KeyValuePair>[] array, int arrayIndex) { throw new NotImplementedException(); } @@ -121,7 +133,7 @@ namespace Org.OpenAPITools.Client /// Key value pair /// true if the item is successfully removed; otherwise, false. /// Method needs to be implemented - public bool Remove(KeyValuePair> item) + public bool Remove(KeyValuePair> item) { throw new NotImplementedException(); } @@ -129,24 +141,12 @@ namespace Org.OpenAPITools.Client /// /// Gets the number of items contained in the Multimap. /// - public int Count - { - get - { - return _dictionary.Count; - } - } + public int Count => _dictionary.Count; /// /// Gets a value indicating whether the Multimap is read-only. /// - public bool IsReadOnly - { - get - { - return false; - } - } + public bool IsReadOnly => false; /// /// Adds an item with the provided key and value to the Multimap. @@ -154,12 +154,11 @@ namespace Org.OpenAPITools.Client /// The object to use as the key of the item to add. /// The object to use as the value of the item to add. /// Thrown when couldn't add the value to Multimap. - public void Add(T key, IList value) + public void Add(TKey key, IList value) { if (value != null && value.Count > 0) { - IList list; - if (_dictionary.TryGetValue(key, out list)) + if (_dictionary.TryGetValue(key, out var list)) { foreach (var k in value) list.Add(k); } @@ -178,7 +177,7 @@ namespace Org.OpenAPITools.Client /// The key to locate in the Multimap. /// true if the Multimap contains an item with /// the key; otherwise, false. - public bool ContainsKey(T key) + public bool ContainsKey(TKey key) { return _dictionary.ContainsKey(key); } @@ -188,10 +187,9 @@ namespace Org.OpenAPITools.Client /// /// The key to locate in the Multimap. /// true if the item is successfully removed; otherwise, false. - public bool Remove(T key) + public bool Remove(TKey key) { - IList list; - return TryRemove(key, out list); + return TryRemove(key, out var _); } /// @@ -203,7 +201,7 @@ namespace Org.OpenAPITools.Client /// This parameter is passed uninitialized. /// true if the object that implements Multimap contains /// an item with the specified key; otherwise, false. - public bool TryGetValue(T key, out IList value) + public bool TryGetValue(TKey key, out IList value) { return _dictionary.TryGetValue(key, out value); } @@ -213,36 +211,21 @@ namespace Org.OpenAPITools.Client /// /// The key of the item to get or set. /// The value of the specified key. - public IList this[T key] + public IList this[TKey key] { - get - { - return _dictionary[key]; - } - set { _dictionary[key] = value; } + get => _dictionary[key]; + set => _dictionary[key] = value; } /// /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. /// - public ICollection Keys - { - get - { - return _dictionary.Keys; - } - } + public ICollection Keys => _dictionary.Keys; /// /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. /// - public ICollection> Values - { - get - { - return _dictionary.Values; - } - } + public ICollection> Values => _dictionary.Values; /// /// Copy the items of the Multimap to an System.Array, @@ -253,7 +236,7 @@ namespace Org.OpenAPITools.Client /// The zero-based index in array at which copying begins. public void CopyTo(Array array, int index) { - ((ICollection) _dictionary).CopyTo(array, index); + ((ICollection)_dictionary).CopyTo(array, index); } /// @@ -262,19 +245,17 @@ namespace Org.OpenAPITools.Client /// The object to use as the key of the item to add. /// The object to use as the value of the item to add. /// Thrown when couldn't add value to Multimap. - public void Add(T key, TValue value) + public void Add(TKey key, TValue value) { if (value != null) { - IList list; - if (_dictionary.TryGetValue(key, out list)) + if (_dictionary.TryGetValue(key, out var list)) { list.Add(value); } else { - list = new List(); - list.Add(value); + list = new List { value }; if (!TryAdd(key, list)) throw new InvalidOperationException("Could not add value to Multimap."); } @@ -288,18 +269,27 @@ namespace Org.OpenAPITools.Client /** * Helper method to encapsulate generator differences between dictionary types. */ - private bool TryRemove(T key, out IList value) + private bool TryRemove(TKey key, out IList value) { - return _dictionary.TryRemove(key, out value); - + _dictionary.TryGetValue(key, out value); + return _dictionary.Remove(key); } /** * Helper method to encapsulate generator differences between dictionary types. */ - private bool TryAdd(T key, IList value) + private bool TryAdd(TKey key, IList value) { - return _dictionary.TryAdd(key, value); + try + { + _dictionary.Add(key, value); + } + catch (ArgumentException) + { + return false; + } + + return true; } #endregion Private Members } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs index 6c0797b7ffe..a4ab49f4424 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -1567,13 +1567,7 @@ namespace Org.OpenAPITools.Api if (query != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); } localVarRequestOptions.Data = body; @@ -1639,13 +1633,7 @@ namespace Org.OpenAPITools.Api if (query != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query)); } localVarRequestOptions.Data = body; @@ -2110,43 +2098,19 @@ namespace Org.OpenAPITools.Api if (enumQueryStringArray != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "enum_query_string_array", enumQueryStringArray)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "enum_query_string_array", enumQueryStringArray)); } if (enumQueryString != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString)); } if (enumQueryInteger != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger)); } if (enumQueryDouble != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble)); } if (enumHeaderStringArray != null) localVarRequestOptions.HeaderParameters.Add("enum_header_string_array", Org.OpenAPITools.Client.ClientUtils.ParameterToString(enumHeaderStringArray)); // header parameter @@ -2227,43 +2191,19 @@ namespace Org.OpenAPITools.Api if (enumQueryStringArray != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "enum_query_string_array", enumQueryStringArray)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "enum_query_string_array", enumQueryStringArray)); } if (enumQueryString != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString)); } if (enumQueryInteger != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger)); } if (enumQueryDouble != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble)); } if (enumHeaderStringArray != null) localVarRequestOptions.HeaderParameters.Add("enum_header_string_array", Org.OpenAPITools.Client.ClientUtils.ParameterToString(enumHeaderStringArray)); // header parameter @@ -2336,39 +2276,15 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); if (stringGroup != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup)); } if (int64Group != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group)); } localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter if (booleanGroup != null) @@ -2433,39 +2349,15 @@ namespace Org.OpenAPITools.Api foreach (var _accept in _accepts) localVarRequestOptions.HeaderParameters.Add("Accept", _accept); - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup)); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group)); if (stringGroup != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup)); } if (int64Group != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group)); } localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter if (booleanGroup != null) @@ -2797,53 +2689,23 @@ namespace Org.OpenAPITools.Api if (pipe != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe)); } if (ioutil != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); } if (http != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); } if (url != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url)); } if (context != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context)); } @@ -2925,53 +2787,23 @@ namespace Org.OpenAPITools.Api if (pipe != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe)); } if (ioutil != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil)); } if (http != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http)); } if (url != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url)); } if (context != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context)); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index ebf022334c8..492bae795c4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -244,13 +244,7 @@ namespace Org.OpenAPITools.Api // authentication (api_key_query) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query"))) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query"))) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query"))); } // make the HTTP request @@ -313,13 +307,7 @@ namespace Org.OpenAPITools.Api // authentication (api_key_query) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query"))) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query"))) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query"))); } // make the HTTP request diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs index 5c4a624d26a..0fe84290ce2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/PetApi.cs @@ -851,13 +851,7 @@ namespace Org.OpenAPITools.Api if (status != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); } // authentication (petstore_auth) required @@ -924,13 +918,7 @@ namespace Org.OpenAPITools.Api if (status != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status)); } // authentication (petstore_auth) required @@ -996,13 +984,7 @@ namespace Org.OpenAPITools.Api if (tags != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); } // authentication (petstore_auth) required @@ -1069,13 +1051,7 @@ namespace Org.OpenAPITools.Api if (tags != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags)); } // authentication (petstore_auth) required diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs index 3f1585ce46e..57e4e369cc5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/UserApi.cs @@ -1100,23 +1100,11 @@ namespace Org.OpenAPITools.Api if (username != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); } if (password != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); } @@ -1183,23 +1171,11 @@ namespace Org.OpenAPITools.Api if (username != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username)); } if (password != null) { - foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)) - { - foreach (var _kvpValue in _kvp.Value) - { - localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue); - } - } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password)); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ClientUtils.cs index dde50ca71de..764ea009ef9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -11,13 +11,10 @@ using System; using System.Collections; -using System.Collections.Generic; using System.IO; using System.Linq; -using System.Net; using System.Text; using System.Text.RegularExpressions; -using System.Threading.Tasks; using KellermanSoftware.CompareNetObjects; namespace Org.OpenAPITools.Client @@ -63,15 +60,11 @@ namespace Org.OpenAPITools.Client { var parameters = new Multimap(); - if (IsCollection(value) && collectionFormat == "multi") + if (value is ICollection collection && collectionFormat == "multi") { - var valueCollection = value as IEnumerable; - if (valueCollection != null) + foreach (var item in collection) { - foreach (var item in valueCollection) - { - parameters.Add(name, ParameterToString(item)); - } + parameters.Add(name, ParameterToString(item)); } } else @@ -92,49 +85,26 @@ namespace Org.OpenAPITools.Client /// Formatted string. public static string ParameterToString(object obj, IReadableConfiguration configuration = null) { - if (obj is DateTime) + if (obj is DateTime dateTime) // Return a formatted date string - Can be customized with Configuration.DateTimeFormat // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 - return ((DateTime)obj).ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); - else if (obj is DateTimeOffset) + return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is DateTimeOffset dateTimeOffset) // Return a formatted date string - Can be customized with Configuration.DateTimeFormat // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000 - return ((DateTimeOffset)obj).ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); - else if (obj is bool) - return (bool)obj ? "true" : "false"; - else - { - if (obj is IList) - { - var list = obj as IList; - var flattenedString = new StringBuilder(); - foreach (var param in list) - { - if (flattenedString.Length > 0) - flattenedString.Append(","); - flattenedString.Append(param); - } - return flattenedString.ToString(); - } - - return Convert.ToString (obj); - } + return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat); + if (obj is bool boolean) + return boolean ? "true" : "false"; + if (obj is ICollection collection) + return string.Join(",", collection.Cast()); + + return Convert.ToString(obj); } - - /// - /// Check if generic object is a collection. - /// - /// - /// True if object is a collection type - private static bool IsCollection(object value) - { - return value is IList || value is ICollection; - } - + /// /// URL encode a string /// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50 @@ -177,7 +147,7 @@ namespace Org.OpenAPITools.Client /// Encoded string. public static string Base64Encode(string text) { - return System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); + return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text)); } /// @@ -187,14 +157,9 @@ namespace Org.OpenAPITools.Client /// Byte array public static byte[] ReadAsBytes(Stream inputStream) { - byte[] buf = new byte[16*1024]; - using (MemoryStream ms = new MemoryStream()) + using (var ms = new MemoryStream()) { - int count; - while ((count = inputStream.Read(buf, 0, buf.Length)) > 0) - { - ms.Write(buf, 0, count); - } + inputStream.CopyTo(ms); return ms.ToArray(); } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Multimap.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Multimap.cs index 4bde7f7ffe4..b0449fb764d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Multimap.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Multimap.cs @@ -11,7 +11,6 @@ using System; using System.Collections; -using System.Collections.Concurrent; using System.Collections.Generic; namespace Org.OpenAPITools.Client @@ -19,13 +18,13 @@ namespace Org.OpenAPITools.Client /// /// A dictionary in which one key has many associated values. /// - /// The type of the key + /// The type of the key /// The type of the value associated with the key. - public class Multimap : IDictionary> + public class Multimap : IDictionary> { #region Private Fields - private readonly ConcurrentDictionary> _dictionary; + private readonly Dictionary> _dictionary; #endregion Private Fields @@ -36,16 +35,16 @@ namespace Org.OpenAPITools.Client /// public Multimap() { - _dictionary = new ConcurrentDictionary>(); + _dictionary = new Dictionary>(); } /// /// Constructor with comparer. /// /// - public Multimap(IEqualityComparer comparer) + public Multimap(IEqualityComparer comparer) { - _dictionary = new ConcurrentDictionary>(comparer); + _dictionary = new Dictionary>(comparer); } #endregion Constructors @@ -56,7 +55,7 @@ namespace Org.OpenAPITools.Client /// To get the enumerator. /// /// Enumerator - public IEnumerator>> GetEnumerator() + public IEnumerator>> GetEnumerator() { return _dictionary.GetEnumerator(); } @@ -77,12 +76,25 @@ namespace Org.OpenAPITools.Client /// Add values to Multimap /// /// Key value pair - public void Add(KeyValuePair> item) + public void Add(KeyValuePair> item) { if (!TryAdd(item.Key, item.Value)) throw new InvalidOperationException("Could not add values to Multimap."); } + /// + /// Add Multimap to Multimap + /// + /// Multimap + public void Add(Multimap multimap) + { + foreach (var item in multimap) + { + if (!TryAdd(item.Key, item.Value)) + throw new InvalidOperationException("Could not add values to Multimap."); + } + } + /// /// Clear Multimap /// @@ -97,7 +109,7 @@ namespace Org.OpenAPITools.Client /// Key value pair /// Method needs to be implemented /// true if the Multimap contains the item; otherwise, false. - public bool Contains(KeyValuePair> item) + public bool Contains(KeyValuePair> item) { throw new NotImplementedException(); } @@ -110,7 +122,7 @@ namespace Org.OpenAPITools.Client /// from Multimap. The array must have zero-based indexing. /// The zero-based index in array at which copying begins. /// Method needs to be implemented - public void CopyTo(KeyValuePair>[] array, int arrayIndex) + public void CopyTo(KeyValuePair>[] array, int arrayIndex) { throw new NotImplementedException(); } @@ -121,7 +133,7 @@ namespace Org.OpenAPITools.Client /// Key value pair /// true if the item is successfully removed; otherwise, false. /// Method needs to be implemented - public bool Remove(KeyValuePair> item) + public bool Remove(KeyValuePair> item) { throw new NotImplementedException(); } @@ -129,24 +141,12 @@ namespace Org.OpenAPITools.Client /// /// Gets the number of items contained in the Multimap. /// - public int Count - { - get - { - return _dictionary.Count; - } - } + public int Count => _dictionary.Count; /// /// Gets a value indicating whether the Multimap is read-only. /// - public bool IsReadOnly - { - get - { - return false; - } - } + public bool IsReadOnly => false; /// /// Adds an item with the provided key and value to the Multimap. @@ -154,12 +154,11 @@ namespace Org.OpenAPITools.Client /// The object to use as the key of the item to add. /// The object to use as the value of the item to add. /// Thrown when couldn't add the value to Multimap. - public void Add(T key, IList value) + public void Add(TKey key, IList value) { if (value != null && value.Count > 0) { - IList list; - if (_dictionary.TryGetValue(key, out list)) + if (_dictionary.TryGetValue(key, out var list)) { foreach (var k in value) list.Add(k); } @@ -178,7 +177,7 @@ namespace Org.OpenAPITools.Client /// The key to locate in the Multimap. /// true if the Multimap contains an item with /// the key; otherwise, false. - public bool ContainsKey(T key) + public bool ContainsKey(TKey key) { return _dictionary.ContainsKey(key); } @@ -188,10 +187,9 @@ namespace Org.OpenAPITools.Client /// /// The key to locate in the Multimap. /// true if the item is successfully removed; otherwise, false. - public bool Remove(T key) + public bool Remove(TKey key) { - IList list; - return TryRemove(key, out list); + return TryRemove(key, out var _); } /// @@ -203,7 +201,7 @@ namespace Org.OpenAPITools.Client /// This parameter is passed uninitialized. /// true if the object that implements Multimap contains /// an item with the specified key; otherwise, false. - public bool TryGetValue(T key, out IList value) + public bool TryGetValue(TKey key, out IList value) { return _dictionary.TryGetValue(key, out value); } @@ -213,36 +211,21 @@ namespace Org.OpenAPITools.Client /// /// The key of the item to get or set. /// The value of the specified key. - public IList this[T key] + public IList this[TKey key] { - get - { - return _dictionary[key]; - } - set { _dictionary[key] = value; } + get => _dictionary[key]; + set => _dictionary[key] = value; } /// /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap. /// - public ICollection Keys - { - get - { - return _dictionary.Keys; - } - } + public ICollection Keys => _dictionary.Keys; /// /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap. /// - public ICollection> Values - { - get - { - return _dictionary.Values; - } - } + public ICollection> Values => _dictionary.Values; /// /// Copy the items of the Multimap to an System.Array, @@ -253,7 +236,7 @@ namespace Org.OpenAPITools.Client /// The zero-based index in array at which copying begins. public void CopyTo(Array array, int index) { - ((ICollection) _dictionary).CopyTo(array, index); + ((ICollection)_dictionary).CopyTo(array, index); } /// @@ -262,19 +245,17 @@ namespace Org.OpenAPITools.Client /// The object to use as the key of the item to add. /// The object to use as the value of the item to add. /// Thrown when couldn't add value to Multimap. - public void Add(T key, TValue value) + public void Add(TKey key, TValue value) { if (value != null) { - IList list; - if (_dictionary.TryGetValue(key, out list)) + if (_dictionary.TryGetValue(key, out var list)) { list.Add(value); } else { - list = new List(); - list.Add(value); + list = new List { value }; if (!TryAdd(key, list)) throw new InvalidOperationException("Could not add value to Multimap."); } @@ -288,18 +269,27 @@ namespace Org.OpenAPITools.Client /** * Helper method to encapsulate generator differences between dictionary types. */ - private bool TryRemove(T key, out IList value) + private bool TryRemove(TKey key, out IList value) { - return _dictionary.TryRemove(key, out value); - + _dictionary.TryGetValue(key, out value); + return _dictionary.Remove(key); } /** * Helper method to encapsulate generator differences between dictionary types. */ - private bool TryAdd(T key, IList value) + private bool TryAdd(TKey key, IList value) { - return _dictionary.TryAdd(key, value); + try + { + _dictionary.Add(key, value); + } + catch (ArgumentException) + { + return false; + } + + return true; } #endregion Private Members } From 9e32d435700e3ae3afba8c09a73c99f52c58795f Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Sun, 2 Feb 2020 12:34:49 -0800 Subject: [PATCH 76/85] =?UTF-8?q?[bug]=20fix=20null=20pointer=20exception?= =?UTF-8?q?=20while=20evaluating=20recommend=E2=80=A6=20(#5191)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../codegen/validations/oas/OpenApiEvaluator.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiEvaluator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiEvaluator.java index e28a69b4386..9132c7d0e22 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiEvaluator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/validations/oas/OpenApiEvaluator.java @@ -87,7 +87,10 @@ public class OpenApiEvaluator implements Validator { } } - parameters.forEach(parameter -> validationResult.consume(parameterValidations.validate(parameter))); + parameters.forEach(parameter -> { + parameter = ModelUtils.getReferencedParameter(specification, parameter); + validationResult.consume(parameterValidations.validate(parameter)); + }); return validationResult; } From 97ff9b4be7877c6d9b54a40331a3c1d2db164733 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Sun, 2 Feb 2020 17:36:53 -0500 Subject: [PATCH 77/85] [cli] Optional colorized outputs (#5193) --- modules/openapi-generator-cli/pom.xml | 15 ++++ .../src/main/resources/logback.xml | 84 +++++++++++++++++-- 2 files changed, 92 insertions(+), 7 deletions(-) diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index e1bd36543a9..d4304fd6ac1 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -65,6 +65,16 @@ + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + @@ -134,6 +144,11 @@ logback-classic 1.2.3 + + org.codehaus.janino + janino + 3.1.0 + org.testng testng diff --git a/modules/openapi-generator-cli/src/main/resources/logback.xml b/modules/openapi-generator-cli/src/main/resources/logback.xml index 62800526bdd..efa74345a0f 100644 --- a/modules/openapi-generator-cli/src/main/resources/logback.xml +++ b/modules/openapi-generator-cli/src/main/resources/logback.xml @@ -1,9 +1,20 @@ + + + + + + + + + System.out - [%thread] %-5level %logger{36} - %msg%n + ${noColorPattern} ERROR @@ -14,21 +25,80 @@ System.err - [%thread] %-5level %logger{36} - %msg%n + ${noColorPattern} ERROR + + System.out + true + + ${colorPattern} + + + ERROR + DENY + NEUTRAL + + + + System.err + true + + ${colorPattern} + + + ERROR + + + + System.err + true + + ONCE + + + [%thread] %highlight(%-5level) %logger{36} - %red(%msg)%n + + + - - + + + + + + + + + + + - - + + + + + + + + + + + - + + + + + + + + + From 7d366ad6ac61e3bdffc44e4a84669d5e83f5f22e Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Mon, 3 Feb 2020 03:08:51 -0500 Subject: [PATCH 78/85] [docs] Slack block, formatting, 'color' CLI option (#5194) Adds a more prominent Slack block on the main doc site in response to a few users not setting the Slack chat links on the Readme or in the "Learn how" block. Fixes a rendering issue in the "Try via NPM" block. Adds a one-liner about the recently added `-Dcolor` option for optionally colorizing output in the CLI. --- docs/usage.md | 4 +- website/i18n/en.json | 50 ++++++++---------- website/pages/en/index.js | 36 +++++++++++-- website/static/css/custom.css | 3 +- .../img/tools/Slack_Mark-256x256-3a29a6b.png | Bin 0 -> 5888 bytes 5 files changed, 60 insertions(+), 33 deletions(-) create mode 100644 website/static/img/tools/Slack_Mark-256x256-3a29a6b.png diff --git a/docs/usage.md b/docs/usage.md index d7fd3092b1d..64277c79660 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -230,7 +230,7 @@ An example bash completion script can be found in the repo at [scripts/openapi-g ## generate -The `generate` command is the workhorse of the generator toolset. As such, it has _many_ more options and the previous commands. The options are abbreviated below, but you may expand the full descriptions. +The `generate` command is the workhorse of the generator toolset. As such, it has _many_ more options and the previous commands. The abbreviated options are below, but you may expand the full descriptions. ```bash @@ -444,6 +444,8 @@ At a minimum, `generate` requires: * `-o` to specify a meaningful output directory (defaults to the current directory!) * `-i` to specify the input OpenAPI document +> **NOTE** You may also pass `-Dcolor` as a system property to colorize terminal outputs. + ### Examples The following examples use [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml). diff --git a/website/i18n/en.json b/website/i18n/en.json index 523607df864..890f1a9d449 100644 --- a/website/i18n/en.json +++ b/website/i18n/en.json @@ -123,9 +123,6 @@ "title": "Config Options for csharp-netcore", "sidebar_label": "csharp-netcore" }, - "generators/csharp-refactor": { - "title": "generators/csharp-refactor" - }, "generators/csharp": { "title": "Config Options for csharp", "sidebar_label": "csharp" @@ -186,9 +183,6 @@ "title": "Config Options for fsharp-giraffe-server", "sidebar_label": "fsharp-giraffe-server" }, - "generators/fsharp-giraffe": { - "title": "generators/fsharp-giraffe" - }, "generators/go-experimental": { "title": "Config Options for go-experimental", "sidebar_label": "go-experimental" @@ -213,16 +207,10 @@ "title": "Config Options for graphql-schema", "sidebar_label": "graphql-schema" }, - "generators/graphql-server": { - "title": "generators/graphql-server" - }, "generators/groovy": { "title": "Config Options for groovy", "sidebar_label": "groovy" }, - "generators/grpc-schema": { - "title": "generators/grpc-schema" - }, "generators/haskell-http-client": { "title": "Config Options for haskell-http-client", "sidebar_label": "haskell-http-client" @@ -259,6 +247,10 @@ "title": "Config Options for java-undertow-server", "sidebar_label": "java-undertow-server" }, + "generators/java-vertx-web": { + "title": "Config Options for java-vertx-web", + "sidebar_label": "java-vertx-web" + }, "generators/java-vertx": { "title": "Config Options for java-vertx", "sidebar_label": "java-vertx" @@ -335,6 +327,10 @@ "title": "Config Options for lua", "sidebar_label": "lua" }, + "generators/markdown": { + "title": "Config Options for markdown", + "sidebar_label": "markdown" + }, "generators/mysql-schema": { "title": "Config Options for mysql-schema", "sidebar_label": "mysql-schema" @@ -351,16 +347,10 @@ "title": "Config Options for nodejs-server-deprecated", "sidebar_label": "nodejs-server-deprecated" }, - "generators/nodejs-server": { - "title": "generators/nodejs-server" - }, "generators/objc": { "title": "Config Options for objc", "sidebar_label": "objc" }, - "generators/ocaml-client": { - "title": "generators/ocaml-client" - }, "generators/ocaml": { "title": "Config Options for ocaml", "sidebar_label": "ocaml" @@ -389,9 +379,13 @@ "title": "Config Options for php-silex", "sidebar_label": "php-silex" }, - "generators/php-slim": { - "title": "Config Options for php-slim", - "sidebar_label": "php-slim" + "generators/php-slim-deprecated": { + "title": "Config Options for php-slim-deprecated", + "sidebar_label": "php-slim-deprecated" + }, + "generators/php-slim4": { + "title": "Config Options for php-slim4", + "sidebar_label": "php-slim4" }, "generators/php-symfony": { "title": "Config Options for php-symfony", @@ -476,16 +470,10 @@ "title": "Config Options for scala-httpclient-deprecated", "sidebar_label": "scala-httpclient-deprecated" }, - "generators/scala-httpclient": { - "title": "generators/scala-httpclient" - }, "generators/scala-lagom-server": { "title": "Config Options for scala-lagom-server", "sidebar_label": "scala-lagom-server" }, - "generators/scala-play-framework": { - "title": "generators/scala-play-framework" - }, "generators/scala-play-server": { "title": "Config Options for scala-play-server", "sidebar_label": "scala-play-server" @@ -514,6 +502,10 @@ "title": "Config Options for swift4", "sidebar_label": "swift4" }, + "generators/swift5": { + "title": "Config Options for swift5", + "sidebar_label": "swift5" + }, "generators/typescript-angular": { "title": "Config Options for typescript-angular", "sidebar_label": "typescript-angular" @@ -546,6 +538,10 @@ "title": "Config Options for typescript-node", "sidebar_label": "typescript-node" }, + "generators/typescript-redux-query": { + "title": "Config Options for typescript-redux-query", + "sidebar_label": "typescript-redux-query" + }, "generators/typescript-rxjs": { "title": "Config Options for typescript-rxjs", "sidebar_label": "typescript-rxjs" diff --git a/website/pages/en/index.js b/website/pages/en/index.js index 155ebb7b84a..b0d927751f6 100755 --- a/website/pages/en/index.js +++ b/website/pages/en/index.js @@ -125,6 +125,28 @@ class Index extends React.Component { ); + const connectContents = stripMargin` + | **Connect** with us on Slack! + | + | We're a very community-oriented project. We have an active community of users, contributors, and core team members on Slack. Slack is often a good + | place to start if you're looking for guidance about where to begin contributing, if you have an idea you're + | not sure fits the project, or if you just want to ask a question or say hello. + | + | Slack is free to [download](https://slack.com/downloads), and our workspace is free to [sign up](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM). + `; + const ConnectOnSlack = () => ( + + {[ + { + content: `${connectContents}`, + image: `${baseUrl}img/tools/Slack_Mark-256x256-3a29a6b.png`, + imageAlign: 'left', + title: 'Active Community', + }, + ]} + + ); + const tryHomebrewContents = stripMargin` | **Install** via [homebrew](https://brew.sh/): | @@ -162,6 +184,8 @@ class Index extends React.Component { | -g go \\ | -o /local/out/go | \`\`\` + | + | For a full list of our docker images, check out [u/openapitools](https://hub.docker.com/u/openapitools) on Docker Hub. `; const TryOutDocker = () => ( @@ -179,7 +203,9 @@ class Index extends React.Component { const tryNpmContents = stripMargin` | The [NPM package wrapper](https://github.com/openapitools/openapi-generator-cli) is cross-platform wrapper around the .jar artifact. | **Install** globally, exposing the CLI on the command line: + | | + | | \`\`\`bash | # install the latest version of "openapi-generator-cli" | npm install @openapitools/openapi-generator-cli -g @@ -190,7 +216,8 @@ class Index extends React.Component { | # Or install it as dev-dependency in your node.js projects | npm install @openapitools/openapi-generator-cli -D | \`\`\` - | + | + | | | Then, **generate** a ruby client from a valid [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml) doc: | \`\`\`bash @@ -229,17 +256,17 @@ class Index extends React.Component { {[ { - content: 'OpenAPI Generator supports many different integrations and use cases, including (but not limited to):\n\n' + + content: 'OpenAPI Generator supports many different integrations and use cases, including (but not limited to):\n' + '* Maven Plugin\n' + '* Gradle Plugin\n' + + '* Bazel Plugin\n' + '* CLI via Homebrew\n' + '* CLI via Docker\n' + '* CLI via npm\n' + '* Generator SaaS\n\n' + 'For details, see [Workflow Integrations](' + this.docUrl('integrations.html', this.props.language) + ')\n\n' + 'Generation also allows for easy customization via options, custom templates, or even custom generators on your classpath. ' + - 'See [Customization](' + this.docUrl('customization.html', this.props.language) + ') for details.\n\n' + - 'As a very community-oriented project, the core team is also active on the project\'s [Slack Workspace](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM).', + 'See [Customization](' + this.docUrl('customization.html', this.props.language) + ') for details.', image: `${baseUrl}img/color-logo.svg`, imageAlign: 'right', title: 'Learn How', @@ -358,6 +385,7 @@ class Index extends React.Component { {/**/} + diff --git a/website/static/css/custom.css b/website/static/css/custom.css index a0cef22cea8..2fcf0896ecf 100755 --- a/website/static/css/custom.css +++ b/website/static/css/custom.css @@ -64,7 +64,8 @@ dd { #try .blockImage, #tryHomebrew .blockImage, -#tryDocker .blockImage { +#tryDocker .blockImage, +#connectOnSlack .blockImage { margin-top: auto; margin-bottom: auto; } diff --git a/website/static/img/tools/Slack_Mark-256x256-3a29a6b.png b/website/static/img/tools/Slack_Mark-256x256-3a29a6b.png new file mode 100644 index 0000000000000000000000000000000000000000..188ebb90ee056a0cabdd8afd83812df7045e4eba GIT binary patch literal 5888 zcmaht2{e>#+s_PR8Dkq`Y-351WiT>o>`R2QlctcF@fKRCFeIL_uY>YtQuZ=!YNTZf z8SChyD5d(^FcBq7DukKu@xFcEf6o7Z=lti)edd0y``Yg7zVB>``Y|^;`hka^?uOa zQiVOc!Gw+r!!1uW*#2#*s+QX|{<=1Lqom;y>{9Yl9j>0<2vWAH!yxtVzW}fp@ zGG_nCHSD`6_q!Kb>qTbRa_ooyd8>)uWl_j=?A)bVs9H{^!y zVnhM z@S{OAI#8NI3ToFqa&_>wX^4{ilf9S;#a8^tZ92%nQ4l)t^B-;vHm4RP&zUrfu?9becQVZ zD5=7Z7r%KX#j7V2KCgZrRqhER!Mq5CeQr+3(pF%eqV+mMseI@W2F#;WBxt%C3X@u2 zQY!Ah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i<&Gg@i&E(99HD6Jw47qFdJZ-i48K($?x;2ts(hhW!S>Z!2C~ zItzQn2>*>tc>MR0ZGrO|BfOYz0qySzM~VNJuByOr(i-HD7~#d=xNpbS)Hn=G$CnLx z07iDQyvu+2BTB`U6MsRViJJ!!X5eJkXJJuZ7mEh9+iV-L9sW{0!u5=ValZGUwKUI_ z(BI6gf!ZADf45BbZ2X_*3e13K%W{hwabZW5i&u%?Ar!tH_s5lv1+m;d`+g?Yp8>wN z%@cfX)BM$8EHH?*5j!IA9<)*pCqFWfWP+Jno;WT8=i|Y&mg^EgQM`@r@*ech=52U| z$SZPHEnxttc3pBhQGjMg8A?=b8RzNNDDs<71-&P5>QqH@m6r0lONtCdsQNzkn5&+H zlF(sX8$ik2-=I24Gy$b>1+pB4YcAEjv)sT8t~{2e@go?#UA3N|^@F4E%Tj`iFX*)d z3fr77!<0gb25(zxH(QbvEjdN*G*gND_`)4`wa0a&Wpeg-UKNE#wIl4jf*VDmk1?`z)cQ=Z8puVc3Wz3o ziW7wzzB0Y1v9?Sz-4W+o-SY1>7vb3bOPZs_iG)A`}xZCqBBB(rP%WtqhUp)nWN5#rK)377kbj_~4u&jpIOtP1Zz zXKX6GL|}w>lr5u%mUM1z&e(o|AvCS|LNA_01=0-f>Pmm9+5eof?#4DNccHi_nZE3Vu|3gH`+oIe|1YYpFF6_j%1f;pPOPeEmJ_BoOY)EeHj c>8l8+x(^b literal 0 HcmV?d00001 From a6807a73e5650bf73f54ab910756d61640a0ebff Mon Sep 17 00:00:00 2001 From: "Yutaka.Miyamae" <48900426+yutaka0m@users.noreply.github.com> Date: Mon, 3 Feb 2020 17:17:26 +0900 Subject: [PATCH 79/85] [Kotlin]Formatted according to the kotlin style guide (#5196) * Do not put a space https://kotlinlang.org/docs/reference/coding-conventions.html#horizontal-whitespace * Use 4 spaces for indentation https://kotlinlang.org/docs/reference/coding-conventions.html#formatting * Put spaces around the `=` sign https://kotlinlang.org/docs/reference/coding-conventions.html#method-call-formatting * Indent the expression body by 4 spaces https://kotlinlang.org/docs/reference/coding-conventions.html#expression-body-formatting * run ./bin/kotlin-springboot-petstore-all.sh --- .../kotlin-spring/dataClass.mustache | 2 +- .../kotlin-spring/dataClassOptVar.mustache | 8 ++--- .../kotlin-spring/dataClassReqVar.mustache | 6 ++-- .../kotlin-spring/exceptions.mustache | 6 ++-- .../.openapi-generator/VERSION | 2 +- .../kotlin/org/openapitools/model/Category.kt | 10 +++--- .../org/openapitools/model/InlineObject.kt | 10 +++--- .../org/openapitools/model/InlineObject1.kt | 10 +++--- .../openapitools/model/ModelApiResponse.kt | 14 ++++---- .../kotlin/org/openapitools/model/Order.kt | 26 +++++++------- .../main/kotlin/org/openapitools/model/Pet.kt | 34 +++++++++---------- .../main/kotlin/org/openapitools/model/Tag.kt | 10 +++--- .../kotlin/org/openapitools/model/User.kt | 34 +++++++++---------- .../.openapi-generator/VERSION | 2 +- .../kotlin/org/openapitools/api/Exceptions.kt | 6 ++-- .../kotlin/org/openapitools/model/Category.kt | 10 +++--- .../org/openapitools/model/InlineObject.kt | 10 +++--- .../org/openapitools/model/InlineObject1.kt | 10 +++--- .../openapitools/model/ModelApiResponse.kt | 14 ++++---- .../kotlin/org/openapitools/model/Order.kt | 26 +++++++------- .../main/kotlin/org/openapitools/model/Pet.kt | 34 +++++++++---------- .../main/kotlin/org/openapitools/model/Tag.kt | 10 +++--- .../kotlin/org/openapitools/model/User.kt | 34 +++++++++---------- 23 files changed, 164 insertions(+), 164 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache index 607daa0f8de..a06f6689bba 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache @@ -5,7 +5,7 @@ {{/vars}} */{{#discriminator}} {{>typeInfoAnnotation}}{{/discriminator}} -{{#discriminator}}interface {{classname}}{{/discriminator}}{{^discriminator}}data class {{classname}} ( +{{#discriminator}}interface {{classname}}{{/discriminator}}{{^discriminator}}data class {{classname}}( {{#requiredVars}} {{>dataClassReqVar}}{{^-last}}, {{/-last}}{{/requiredVars}}{{#hasRequired}}{{#hasOptional}}, 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 0f5001411af..dd139bd63bb 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache @@ -1,5 +1,5 @@ {{#useBeanValidation}}{{#required}} - {{^isReadOnly}}@get:NotNull{{/isReadOnly}} {{/required}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swaggerAnnotations}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swaggerAnnotations}}{{#deprecated}} - @Deprecated(message=""){{/deprecated}} - @JsonProperty("{{{baseName}}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{baseType}}<{{/isListContainer}}{{classname}}.{{nameInCamelCase}}{{#isListContainer}}>{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}} \ No newline at end of file + {{^isReadOnly}}@get:NotNull{{/isReadOnly}} {{/required}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swaggerAnnotations}} + @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swaggerAnnotations}}{{#deprecated}} + @Deprecated(message = ""){{/deprecated}} + @JsonProperty("{{{baseName}}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{baseType}}<{{/isListContainer}}{{classname}}.{{nameInCamelCase}}{{#isListContainer}}>{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache index 0fbccc8975f..2b2682033c1 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache @@ -1,4 +1,4 @@ {{#useBeanValidation}}{{#required}} - {{^isReadOnly}}@get:NotNull{{/isReadOnly}} {{/required}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swaggerAnnotations}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swaggerAnnotations}} - @JsonProperty("{{{baseName}}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{baseType}}<{{/isListContainer}}{{classname}}.{{nameInCamelCase}}{{#isListContainer}}>{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isReadOnly}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}}{{/isReadOnly}} \ No newline at end of file + {{^isReadOnly}}@get:NotNull{{/isReadOnly}} {{/required}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swaggerAnnotations}} + @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swaggerAnnotations}} + @JsonProperty("{{{baseName}}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{baseType}}<{{/isListContainer}}{{classname}}.{{nameInCamelCase}}{{#isListContainer}}>{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isReadOnly}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}}{{/isReadOnly}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/exceptions.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/exceptions.mustache index d85b8396fa5..5ccfb771530 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/exceptions.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/exceptions.mustache @@ -17,13 +17,13 @@ class DefaultExceptionHandler { @ExceptionHandler(value = [ApiException::class]) fun onApiException(ex: ApiException, response: HttpServletResponse): Unit = - response.sendError(ex.code, ex.message) + response.sendError(ex.code, ex.message) @ExceptionHandler(value = [NotImplementedError::class]) fun onNotImplemented(ex: NotImplementedError, response: HttpServletResponse): Unit = - response.sendError(HttpStatus.NOT_IMPLEMENTED.value()) + response.sendError(HttpStatus.NOT_IMPLEMENTED.value()) @ExceptionHandler(value = [ConstraintViolationException::class]) fun onConstraintViolation(ex: ConstraintViolationException, response: HttpServletResponse): Unit = - response.sendError(HttpStatus.BAD_REQUEST.value(), ex.constraintViolations.joinToString(", ") { it.message }) + response.sendError(HttpStatus.BAD_REQUEST.value(), ex.constraintViolations.joinToString(", ") { it.message }) } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION b/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION index e4955748d3e..bfbf77eb7fa 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.2-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt index 4be27d19748..54ee92921f2 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt @@ -16,13 +16,13 @@ import io.swagger.annotations.ApiModelProperty * @param id * @param name */ -data class Category ( +data class Category( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") val name: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") val name: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject.kt index ee034530c63..2320d0f393a 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject.kt @@ -16,13 +16,13 @@ import io.swagger.annotations.ApiModelProperty * @param name Updated name of the pet * @param status Updated status of the pet */ -data class InlineObject ( +data class InlineObject( - @ApiModelProperty(example = "null", value = "Updated name of the pet") - @JsonProperty("name") val name: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "Updated name of the pet") + @JsonProperty("name") val name: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "Updated status of the pet") - @JsonProperty("status") val status: kotlin.String? = null + @ApiModelProperty(example = "null", value = "Updated status of the pet") + @JsonProperty("status") val status: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject1.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject1.kt index a289d8c05f7..5443aa323fd 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject1.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject1.kt @@ -16,13 +16,13 @@ import io.swagger.annotations.ApiModelProperty * @param additionalMetadata Additional data to pass to server * @param file file to upload */ -data class InlineObject1 ( +data class InlineObject1( - @ApiModelProperty(example = "null", value = "Additional data to pass to server") - @JsonProperty("additionalMetadata") val additionalMetadata: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "Additional data to pass to server") + @JsonProperty("additionalMetadata") val additionalMetadata: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "file to upload") - @JsonProperty("file") val file: org.springframework.core.io.Resource? = null + @ApiModelProperty(example = "null", value = "file to upload") + @JsonProperty("file") val file: org.springframework.core.io.Resource? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 0e86b28e937..a49f0aea068 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -17,16 +17,16 @@ import io.swagger.annotations.ApiModelProperty * @param type * @param message */ -data class ModelApiResponse ( +data class ModelApiResponse( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("code") val code: kotlin.Int? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("code") val code: kotlin.Int? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("type") val type: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("type") val type: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("message") val message: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("message") val message: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt index 08726893f7d..0e12d03b1f8 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt @@ -21,25 +21,25 @@ import io.swagger.annotations.ApiModelProperty * @param status Order Status * @param complete */ -data class Order ( +data class Order( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("petId") val petId: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("petId") val petId: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("quantity") val quantity: kotlin.Int? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("quantity") val quantity: kotlin.Int? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, - @ApiModelProperty(example = "null", value = "Order Status") - @JsonProperty("status") val status: Order.Status? = null, + @ApiModelProperty(example = "null", value = "Order Status") + @JsonProperty("status") val status: Order.Status? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("complete") val complete: kotlin.Boolean? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("complete") val complete: kotlin.Boolean? = null ) { /** diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt index 4a2e9d26cb9..5d3acb0d2ea 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt @@ -16,34 +16,34 @@ import io.swagger.annotations.ApiModelProperty /** * A pet for sale in the pet store - * @param id - * @param category * @param name * @param photoUrls + * @param id + * @param category * @param tags * @param status pet status in the store */ -data class Pet ( +data class Pet( - @get:NotNull - @ApiModelProperty(example = "doggie", required = true, value = "") - @JsonProperty("name") val name: kotlin.String, + @get:NotNull + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") val name: kotlin.String, - @get:NotNull - @ApiModelProperty(example = "null", required = true, value = "") - @JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, + @get:NotNull + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("category") val category: Category? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("category") val category: Category? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("tags") val tags: kotlin.collections.List? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("tags") val tags: kotlin.collections.List? = null, - @ApiModelProperty(example = "null", value = "pet status in the store") - @JsonProperty("status") val status: Pet.Status? = null + @ApiModelProperty(example = "null", value = "pet status in the store") + @JsonProperty("status") val status: Pet.Status? = null ) { /** diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt index df04dcd035d..5c6ec4d2968 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt @@ -16,13 +16,13 @@ import io.swagger.annotations.ApiModelProperty * @param id * @param name */ -data class Tag ( +data class Tag( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") val name: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") val name: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt index 619b2e7c2c3..6f2e9f739ab 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt @@ -22,31 +22,31 @@ import io.swagger.annotations.ApiModelProperty * @param phone * @param userStatus User Status */ -data class User ( +data class User( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("username") val username: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("username") val username: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("firstName") val firstName: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("firstName") val firstName: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("lastName") val lastName: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("lastName") val lastName: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("email") val email: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("email") val email: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("password") val password: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("password") val password: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("phone") val phone: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("phone") val phone: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "User Status") - @JsonProperty("userStatus") val userStatus: kotlin.Int? = null + @ApiModelProperty(example = "null", value = "User Status") + @JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION index e4955748d3e..bfbf77eb7fa 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.2-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/Exceptions.kt index 4d8400902aa..44190af7a01 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -17,13 +17,13 @@ class DefaultExceptionHandler { @ExceptionHandler(value = [ApiException::class]) fun onApiException(ex: ApiException, response: HttpServletResponse): Unit = - response.sendError(ex.code, ex.message) + response.sendError(ex.code, ex.message) @ExceptionHandler(value = [NotImplementedError::class]) fun onNotImplemented(ex: NotImplementedError, response: HttpServletResponse): Unit = - response.sendError(HttpStatus.NOT_IMPLEMENTED.value()) + response.sendError(HttpStatus.NOT_IMPLEMENTED.value()) @ExceptionHandler(value = [ConstraintViolationException::class]) fun onConstraintViolation(ex: ConstraintViolationException, response: HttpServletResponse): Unit = - response.sendError(HttpStatus.BAD_REQUEST.value(), ex.constraintViolations.joinToString(", ") { it.message }) + response.sendError(HttpStatus.BAD_REQUEST.value(), ex.constraintViolations.joinToString(", ") { it.message }) } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt index 4be27d19748..54ee92921f2 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt @@ -16,13 +16,13 @@ import io.swagger.annotations.ApiModelProperty * @param id * @param name */ -data class Category ( +data class Category( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") val name: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") val name: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject.kt index ee034530c63..2320d0f393a 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject.kt @@ -16,13 +16,13 @@ import io.swagger.annotations.ApiModelProperty * @param name Updated name of the pet * @param status Updated status of the pet */ -data class InlineObject ( +data class InlineObject( - @ApiModelProperty(example = "null", value = "Updated name of the pet") - @JsonProperty("name") val name: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "Updated name of the pet") + @JsonProperty("name") val name: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "Updated status of the pet") - @JsonProperty("status") val status: kotlin.String? = null + @ApiModelProperty(example = "null", value = "Updated status of the pet") + @JsonProperty("status") val status: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject1.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject1.kt index a289d8c05f7..5443aa323fd 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject1.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject1.kt @@ -16,13 +16,13 @@ import io.swagger.annotations.ApiModelProperty * @param additionalMetadata Additional data to pass to server * @param file file to upload */ -data class InlineObject1 ( +data class InlineObject1( - @ApiModelProperty(example = "null", value = "Additional data to pass to server") - @JsonProperty("additionalMetadata") val additionalMetadata: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "Additional data to pass to server") + @JsonProperty("additionalMetadata") val additionalMetadata: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "file to upload") - @JsonProperty("file") val file: org.springframework.core.io.Resource? = null + @ApiModelProperty(example = "null", value = "file to upload") + @JsonProperty("file") val file: org.springframework.core.io.Resource? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 0e86b28e937..a49f0aea068 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -17,16 +17,16 @@ import io.swagger.annotations.ApiModelProperty * @param type * @param message */ -data class ModelApiResponse ( +data class ModelApiResponse( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("code") val code: kotlin.Int? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("code") val code: kotlin.Int? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("type") val type: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("type") val type: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("message") val message: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("message") val message: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt index 08726893f7d..0e12d03b1f8 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt @@ -21,25 +21,25 @@ import io.swagger.annotations.ApiModelProperty * @param status Order Status * @param complete */ -data class Order ( +data class Order( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("petId") val petId: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("petId") val petId: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("quantity") val quantity: kotlin.Int? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("quantity") val quantity: kotlin.Int? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, - @ApiModelProperty(example = "null", value = "Order Status") - @JsonProperty("status") val status: Order.Status? = null, + @ApiModelProperty(example = "null", value = "Order Status") + @JsonProperty("status") val status: Order.Status? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("complete") val complete: kotlin.Boolean? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("complete") val complete: kotlin.Boolean? = null ) { /** diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt index 4a2e9d26cb9..5d3acb0d2ea 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt @@ -16,34 +16,34 @@ import io.swagger.annotations.ApiModelProperty /** * A pet for sale in the pet store - * @param id - * @param category * @param name * @param photoUrls + * @param id + * @param category * @param tags * @param status pet status in the store */ -data class Pet ( +data class Pet( - @get:NotNull - @ApiModelProperty(example = "doggie", required = true, value = "") - @JsonProperty("name") val name: kotlin.String, + @get:NotNull + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") val name: kotlin.String, - @get:NotNull - @ApiModelProperty(example = "null", required = true, value = "") - @JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, + @get:NotNull + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("category") val category: Category? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("category") val category: Category? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("tags") val tags: kotlin.collections.List? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("tags") val tags: kotlin.collections.List? = null, - @ApiModelProperty(example = "null", value = "pet status in the store") - @JsonProperty("status") val status: Pet.Status? = null + @ApiModelProperty(example = "null", value = "pet status in the store") + @JsonProperty("status") val status: Pet.Status? = null ) { /** diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt index df04dcd035d..5c6ec4d2968 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt @@ -16,13 +16,13 @@ import io.swagger.annotations.ApiModelProperty * @param id * @param name */ -data class Tag ( +data class Tag( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") val name: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") val name: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt index 619b2e7c2c3..6f2e9f739ab 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt @@ -22,31 +22,31 @@ import io.swagger.annotations.ApiModelProperty * @param phone * @param userStatus User Status */ -data class User ( +data class User( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("username") val username: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("username") val username: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("firstName") val firstName: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("firstName") val firstName: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("lastName") val lastName: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("lastName") val lastName: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("email") val email: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("email") val email: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("password") val password: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("password") val password: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("phone") val phone: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("phone") val phone: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "User Status") - @JsonProperty("userStatus") val userStatus: kotlin.Int? = null + @ApiModelProperty(example = "null", value = "User Status") + @JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) { } From b36b65964fadeeb36fb6e0bf8b5ad20d29db545c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 3 Feb 2020 16:32:31 +0800 Subject: [PATCH 80/85] update kotlin samples --- .../kotlin/org/openapitools/model/Category.kt | 10 +++--- .../openapitools/model/ModelApiResponse.kt | 14 ++++---- .../kotlin/org/openapitools/model/Order.kt | 26 +++++++------- .../main/kotlin/org/openapitools/model/Pet.kt | 30 ++++++++-------- .../main/kotlin/org/openapitools/model/Tag.kt | 10 +++--- .../kotlin/org/openapitools/model/User.kt | 34 +++++++++---------- .../kotlin/org/openapitools/api/Exceptions.kt | 6 ++-- .../kotlin/org/openapitools/model/Category.kt | 10 +++--- .../openapitools/model/ModelApiResponse.kt | 14 ++++---- .../kotlin/org/openapitools/model/Order.kt | 26 +++++++------- .../main/kotlin/org/openapitools/model/Pet.kt | 30 ++++++++-------- .../main/kotlin/org/openapitools/model/Tag.kt | 10 +++--- .../kotlin/org/openapitools/model/User.kt | 34 +++++++++---------- 13 files changed, 127 insertions(+), 127 deletions(-) diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt index f477eb4e7a8..0ff2490b5fe 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt @@ -16,13 +16,13 @@ import io.swagger.annotations.ApiModelProperty * @param id * @param name */ -data class Category ( +data class Category( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") val name: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") val name: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 0e86b28e937..a49f0aea068 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -17,16 +17,16 @@ import io.swagger.annotations.ApiModelProperty * @param type * @param message */ -data class ModelApiResponse ( +data class ModelApiResponse( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("code") val code: kotlin.Int? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("code") val code: kotlin.Int? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("type") val type: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("type") val type: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("message") val message: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("message") val message: kotlin.String? = null ) { } 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 08726893f7d..0e12d03b1f8 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 @@ -21,25 +21,25 @@ import io.swagger.annotations.ApiModelProperty * @param status Order Status * @param complete */ -data class Order ( +data class Order( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("petId") val petId: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("petId") val petId: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("quantity") val quantity: kotlin.Int? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("quantity") val quantity: kotlin.Int? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, - @ApiModelProperty(example = "null", value = "Order Status") - @JsonProperty("status") val status: Order.Status? = null, + @ApiModelProperty(example = "null", value = "Order Status") + @JsonProperty("status") val status: Order.Status? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("complete") val complete: kotlin.Boolean? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("complete") val complete: kotlin.Boolean? = null ) { /** diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt index e92ce409479..5d3acb0d2ea 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt @@ -23,27 +23,27 @@ import io.swagger.annotations.ApiModelProperty * @param tags * @param status pet status in the store */ -data class Pet ( +data class Pet( - @get:NotNull - @ApiModelProperty(example = "doggie", required = true, value = "") - @JsonProperty("name") val name: kotlin.String, + @get:NotNull + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") val name: kotlin.String, - @get:NotNull - @ApiModelProperty(example = "null", required = true, value = "") - @JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, + @get:NotNull + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("category") val category: Category? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("category") val category: Category? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("tags") val tags: kotlin.collections.List? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("tags") val tags: kotlin.collections.List? = null, - @ApiModelProperty(example = "null", value = "pet status in the store") - @JsonProperty("status") val status: Pet.Status? = null + @ApiModelProperty(example = "null", value = "pet status in the store") + @JsonProperty("status") val status: Pet.Status? = null ) { /** diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt index df04dcd035d..5c6ec4d2968 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt @@ -16,13 +16,13 @@ import io.swagger.annotations.ApiModelProperty * @param id * @param name */ -data class Tag ( +data class Tag( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") val name: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") val name: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt index 619b2e7c2c3..6f2e9f739ab 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt @@ -22,31 +22,31 @@ import io.swagger.annotations.ApiModelProperty * @param phone * @param userStatus User Status */ -data class User ( +data class User( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("username") val username: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("username") val username: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("firstName") val firstName: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("firstName") val firstName: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("lastName") val lastName: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("lastName") val lastName: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("email") val email: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("email") val email: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("password") val password: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("password") val password: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("phone") val phone: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("phone") val phone: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "User Status") - @JsonProperty("userStatus") val userStatus: kotlin.Int? = null + @ApiModelProperty(example = "null", value = "User Status") + @JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) { } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/Exceptions.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/Exceptions.kt index 4d8400902aa..44190af7a01 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/Exceptions.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/Exceptions.kt @@ -17,13 +17,13 @@ class DefaultExceptionHandler { @ExceptionHandler(value = [ApiException::class]) fun onApiException(ex: ApiException, response: HttpServletResponse): Unit = - response.sendError(ex.code, ex.message) + response.sendError(ex.code, ex.message) @ExceptionHandler(value = [NotImplementedError::class]) fun onNotImplemented(ex: NotImplementedError, response: HttpServletResponse): Unit = - response.sendError(HttpStatus.NOT_IMPLEMENTED.value()) + response.sendError(HttpStatus.NOT_IMPLEMENTED.value()) @ExceptionHandler(value = [ConstraintViolationException::class]) fun onConstraintViolation(ex: ConstraintViolationException, response: HttpServletResponse): Unit = - response.sendError(HttpStatus.BAD_REQUEST.value(), ex.constraintViolations.joinToString(", ") { it.message }) + response.sendError(HttpStatus.BAD_REQUEST.value(), ex.constraintViolations.joinToString(", ") { it.message }) } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt index f477eb4e7a8..0ff2490b5fe 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt @@ -16,13 +16,13 @@ import io.swagger.annotations.ApiModelProperty * @param id * @param name */ -data class Category ( +data class Category( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") val name: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") val name: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 0e86b28e937..a49f0aea068 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -17,16 +17,16 @@ import io.swagger.annotations.ApiModelProperty * @param type * @param message */ -data class ModelApiResponse ( +data class ModelApiResponse( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("code") val code: kotlin.Int? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("code") val code: kotlin.Int? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("type") val type: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("type") val type: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("message") val message: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("message") val message: kotlin.String? = null ) { } 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 08726893f7d..0e12d03b1f8 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 @@ -21,25 +21,25 @@ import io.swagger.annotations.ApiModelProperty * @param status Order Status * @param complete */ -data class Order ( +data class Order( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("petId") val petId: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("petId") val petId: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("quantity") val quantity: kotlin.Int? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("quantity") val quantity: kotlin.Int? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, - @ApiModelProperty(example = "null", value = "Order Status") - @JsonProperty("status") val status: Order.Status? = null, + @ApiModelProperty(example = "null", value = "Order Status") + @JsonProperty("status") val status: Order.Status? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("complete") val complete: kotlin.Boolean? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("complete") val complete: kotlin.Boolean? = null ) { /** diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt index e92ce409479..5d3acb0d2ea 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt @@ -23,27 +23,27 @@ import io.swagger.annotations.ApiModelProperty * @param tags * @param status pet status in the store */ -data class Pet ( +data class Pet( - @get:NotNull - @ApiModelProperty(example = "doggie", required = true, value = "") - @JsonProperty("name") val name: kotlin.String, + @get:NotNull + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") val name: kotlin.String, - @get:NotNull - @ApiModelProperty(example = "null", required = true, value = "") - @JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, + @get:NotNull + @ApiModelProperty(example = "null", required = true, value = "") + @JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("category") val category: Category? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("category") val category: Category? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("tags") val tags: kotlin.collections.List? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("tags") val tags: kotlin.collections.List? = null, - @ApiModelProperty(example = "null", value = "pet status in the store") - @JsonProperty("status") val status: Pet.Status? = null + @ApiModelProperty(example = "null", value = "pet status in the store") + @JsonProperty("status") val status: Pet.Status? = null ) { /** diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt index df04dcd035d..5c6ec4d2968 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt @@ -16,13 +16,13 @@ import io.swagger.annotations.ApiModelProperty * @param id * @param name */ -data class Tag ( +data class Tag( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") val name: kotlin.String? = null + @ApiModelProperty(example = "null", value = "") + @JsonProperty("name") val name: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt index 619b2e7c2c3..6f2e9f739ab 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt @@ -22,31 +22,31 @@ import io.swagger.annotations.ApiModelProperty * @param phone * @param userStatus User Status */ -data class User ( +data class User( - @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: kotlin.Long? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("id") val id: kotlin.Long? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("username") val username: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("username") val username: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("firstName") val firstName: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("firstName") val firstName: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("lastName") val lastName: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("lastName") val lastName: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("email") val email: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("email") val email: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("password") val password: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("password") val password: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "") - @JsonProperty("phone") val phone: kotlin.String? = null, + @ApiModelProperty(example = "null", value = "") + @JsonProperty("phone") val phone: kotlin.String? = null, - @ApiModelProperty(example = "null", value = "User Status") - @JsonProperty("userStatus") val userStatus: kotlin.Int? = null + @ApiModelProperty(example = "null", value = "User Status") + @JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) { } From fbcb8e0c7ea7261a36a4789b69a001c9528d15ef Mon Sep 17 00:00:00 2001 From: Ben Cox <1038350+ind1go@users.noreply.github.com> Date: Mon, 3 Feb 2020 09:11:59 +0000 Subject: [PATCH 81/85] [java-jersey2] Fix empty body when form parameters supplied (#5169) --- .../main/resources/Java/libraries/jersey2/ApiClient.mustache | 4 ++-- .../src/main/java/org/openapitools/client/ApiClient.java | 4 ++-- .../src/main/java/org/openapitools/client/ApiClient.java | 4 ++-- .../src/main/java/org/openapitools/client/ApiClient.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) 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 0f83a20450f..95fb8093bc3 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 @@ -573,7 +573,7 @@ public class ApiClient { entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); } else { // We let jersey handle the serialization - entity = Entity.entity(obj, contentType); + entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType); } return entity; } @@ -732,7 +732,7 @@ public class ApiClient { } } - Entity entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType); + Entity entity = serialize(body, formParams, contentType); Response response = null; diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java index 7776f178e8e..35d6ae5c9af 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java @@ -562,7 +562,7 @@ public class ApiClient { entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); } else { // We let jersey handle the serialization - entity = Entity.entity(obj, contentType); + entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType); } return entity; } @@ -716,7 +716,7 @@ public class ApiClient { } } - Entity entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType); + Entity entity = serialize(body, formParams, contentType); Response response = null; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index a0aff556422..dcc41e43f5d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -563,7 +563,7 @@ public class ApiClient { entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); } else { // We let jersey handle the serialization - entity = Entity.entity(obj, contentType); + entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType); } return entity; } @@ -716,7 +716,7 @@ public class ApiClient { } } - Entity entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType); + Entity entity = serialize(body, formParams, contentType); Response response = null; diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/ApiClient.java index a0aff556422..dcc41e43f5d 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/ApiClient.java @@ -563,7 +563,7 @@ public class ApiClient { entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); } else { // We let jersey handle the serialization - entity = Entity.entity(obj, contentType); + entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType); } return entity; } @@ -716,7 +716,7 @@ public class ApiClient { } } - Entity entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType); + Entity entity = serialize(body, formParams, contentType); Response response = null; From 149778a7e70d477fe0b804643342563d57fc8ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Fr=C4=85k?= <46451063+daniel-frak@users.noreply.github.com> Date: Mon, 3 Feb 2020 13:33:05 +0100 Subject: [PATCH 82/85] [typescript-angular]: objects as query parameters no longer break when fields are null (#5197) * #5174 fix [BUG] [typescript-angular]: objects as query parameters break when fields are null * #5174 Shell scripts run * #5174 Code style fix * #5174 Regenerate typescript-angular samples * #5174 Regenerate typescript-angular samples a second time --- .../main/resources/typescript-angular/api.service.mustache | 6 +++++- .../typescript-angular-v2/default/api/pet.service.ts | 6 +++++- .../typescript-angular-v2/default/api/store.service.ts | 6 +++++- .../typescript-angular-v2/default/api/user.service.ts | 6 +++++- .../petstore/typescript-angular-v2/npm/api/pet.service.ts | 6 +++++- .../petstore/typescript-angular-v2/npm/api/store.service.ts | 6 +++++- .../petstore/typescript-angular-v2/npm/api/user.service.ts | 6 +++++- .../with-interfaces/api/pet.service.ts | 6 +++++- .../with-interfaces/api/store.service.ts | 6 +++++- .../with-interfaces/api/user.service.ts | 6 +++++- .../petstore/typescript-angular-v4.3/npm/api/pet.service.ts | 6 +++++- .../typescript-angular-v4.3/npm/api/store.service.ts | 6 +++++- .../typescript-angular-v4.3/npm/api/user.service.ts | 6 +++++- .../petstore/typescript-angular-v4/npm/api/pet.service.ts | 6 +++++- .../petstore/typescript-angular-v4/npm/api/store.service.ts | 6 +++++- .../petstore/typescript-angular-v4/npm/api/user.service.ts | 6 +++++- .../builds/default/api/pet.service.ts | 6 +++++- .../builds/default/api/store.service.ts | 6 +++++- .../builds/default/api/user.service.ts | 6 +++++- .../builds/with-npm/api/pet.service.ts | 6 +++++- .../builds/with-npm/api/store.service.ts | 6 +++++- .../builds/with-npm/api/user.service.ts | 6 +++++- .../builds/default/api/pet.service.ts | 6 +++++- .../builds/default/api/store.service.ts | 6 +++++- .../builds/default/api/user.service.ts | 6 +++++- .../builds/with-npm/api/pet.service.ts | 6 +++++- .../builds/with-npm/api/store.service.ts | 6 +++++- .../builds/with-npm/api/user.service.ts | 6 +++++- .../builds/default/api/pet.service.ts | 6 +++++- .../builds/default/api/store.service.ts | 6 +++++- .../builds/default/api/user.service.ts | 6 +++++- .../builds/with-npm/api/pet.service.ts | 6 +++++- .../builds/with-npm/api/store.service.ts | 6 +++++- .../builds/with-npm/api/user.service.ts | 6 +++++- .../builds/default/api/pet.service.ts | 6 +++++- .../builds/default/api/store.service.ts | 6 +++++- .../builds/default/api/user.service.ts | 6 +++++- .../builds/with-npm/api/pet.service.ts | 6 +++++- .../builds/with-npm/api/store.service.ts | 6 +++++- .../builds/with-npm/api/user.service.ts | 6 +++++- .../builds/single-request-parameter/api/pet.service.ts | 6 +++++- .../builds/single-request-parameter/api/store.service.ts | 6 +++++- .../builds/single-request-parameter/api/user.service.ts | 6 +++++- .../builds/with-npm/api/pet.service.ts | 6 +++++- .../builds/with-npm/api/store.service.ts | 6 +++++- .../builds/with-npm/api/user.service.ts | 6 +++++- .../builds/with-prefixed-module-name/api/pet.service.ts | 6 +++++- .../builds/with-prefixed-module-name/api/store.service.ts | 6 +++++- .../builds/with-prefixed-module-name/api/user.service.ts | 6 +++++- 49 files changed, 245 insertions(+), 49 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index 87cadfeffd0..38ffa081b85 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -160,7 +160,11 @@ export class {{classname}} { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index b3e2c36aff6..a2a05d7464e 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -213,7 +213,11 @@ export class PetService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index 8a1423204db..3cff4ba2c0e 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -125,7 +125,11 @@ export class StoreService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index f2645795095..0b4f7dd74b1 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -195,7 +195,11 @@ export class UserService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index b3e2c36aff6..a2a05d7464e 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -213,7 +213,11 @@ export class PetService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index 8a1423204db..3cff4ba2c0e 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -125,7 +125,11 @@ export class StoreService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index f2645795095..0b4f7dd74b1 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -195,7 +195,11 @@ export class UserService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index 465d6937c64..b3230d244e2 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -216,7 +216,11 @@ export class PetService implements PetServiceInterface { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index 915597477ef..f945e50874c 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -128,7 +128,11 @@ export class StoreService implements StoreServiceInterface { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index 21ca1cc6335..541eafd71de 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -198,7 +198,11 @@ export class UserService implements UserServiceInterface { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts index 8426b43a3af..b5bf94fba2c 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts @@ -70,7 +70,11 @@ export class PetService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts index 633f00b1d6e..6e521f729e4 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts @@ -56,7 +56,11 @@ export class StoreService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts index 9eea4e0e3dc..4ad369e9cdf 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts @@ -56,7 +56,11 @@ export class UserService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts index b3e2c36aff6..a2a05d7464e 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts @@ -213,7 +213,11 @@ export class PetService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts index 8a1423204db..3cff4ba2c0e 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts @@ -125,7 +125,11 @@ export class StoreService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts index f2645795095..0b4f7dd74b1 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts @@ -195,7 +195,11 @@ export class UserService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts index dc1719750f1..35d6f883acc 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts @@ -70,7 +70,11 @@ export class PetService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts index af2d5a127a9..22db3e3008b 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts @@ -56,7 +56,11 @@ export class StoreService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts index c4ea31b4787..50ba2dfddcd 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts @@ -56,7 +56,11 @@ export class UserService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts index dc1719750f1..35d6f883acc 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -70,7 +70,11 @@ export class PetService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts index af2d5a127a9..22db3e3008b 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -56,7 +56,11 @@ export class StoreService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts index c4ea31b4787..50ba2dfddcd 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -56,7 +56,11 @@ export class UserService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts index fc90178d82f..91bbce5b747 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts @@ -72,7 +72,11 @@ export class PetService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts index 2ce18a1079b..d169e06083a 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts @@ -58,7 +58,11 @@ export class StoreService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts index 6e5337b51d1..91092c93225 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts @@ -58,7 +58,11 @@ export class UserService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts index fc90178d82f..91bbce5b747 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts @@ -72,7 +72,11 @@ export class PetService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts index 2ce18a1079b..d169e06083a 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts @@ -58,7 +58,11 @@ export class StoreService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts index 6e5337b51d1..91092c93225 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts @@ -58,7 +58,11 @@ export class UserService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts index dc1719750f1..35d6f883acc 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts @@ -70,7 +70,11 @@ export class PetService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts index af2d5a127a9..22db3e3008b 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts @@ -56,7 +56,11 @@ export class StoreService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts index c4ea31b4787..50ba2dfddcd 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts @@ -56,7 +56,11 @@ export class UserService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts index dc1719750f1..35d6f883acc 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -70,7 +70,11 @@ export class PetService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts index af2d5a127a9..22db3e3008b 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -56,7 +56,11 @@ export class StoreService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts index c4ea31b4787..50ba2dfddcd 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -56,7 +56,11 @@ export class UserService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts index fc90178d82f..91bbce5b747 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts @@ -72,7 +72,11 @@ export class PetService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts index 2ce18a1079b..d169e06083a 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts @@ -58,7 +58,11 @@ export class StoreService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts index 6e5337b51d1..91092c93225 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts @@ -58,7 +58,11 @@ export class UserService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts index fc90178d82f..91bbce5b747 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts @@ -72,7 +72,11 @@ export class PetService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts index 2ce18a1079b..d169e06083a 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts @@ -58,7 +58,11 @@ export class StoreService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts index 6e5337b51d1..91092c93225 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts @@ -58,7 +58,11 @@ export class UserService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts index f429414093f..0e2f4d61ae2 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts @@ -109,7 +109,11 @@ export class PetService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts index 1e66b9a6bb8..ec3164d4229 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts @@ -70,7 +70,11 @@ export class StoreService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts index b5ba06f79c3..641080f297b 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts @@ -88,7 +88,11 @@ export class UserService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts index fc90178d82f..91bbce5b747 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts @@ -72,7 +72,11 @@ export class PetService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts index 2ce18a1079b..d169e06083a 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts @@ -58,7 +58,11 @@ export class StoreService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts index 6e5337b51d1..91092c93225 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts @@ -58,7 +58,11 @@ export class UserService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts index fc90178d82f..91bbce5b747 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts @@ -72,7 +72,11 @@ export class PetService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts index 2ce18a1079b..d169e06083a 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts @@ -58,7 +58,11 @@ export class StoreService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts index 6e5337b51d1..91092c93225 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts @@ -58,7 +58,11 @@ export class UserService { return httpParams; } - private addToHttpParamsRecursive(httpParams: HttpParams, value: any, key?: string): HttpParams { + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + if (typeof value === "object") { if (Array.isArray(value)) { (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); From dcc914421e1c58851370050abe823e63fce72b13 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Mon, 3 Feb 2020 06:56:42 -0800 Subject: [PATCH 83/85] [codegen] Performance optimizations: use of cache for camel case and sanitized strings (#5152) * use of cache for camel case and sanitized strings * use of cache for camel case, sanitized strings and underscored words --- .../openapitools/codegen/DefaultCodegen.java | 24 +++++++- .../codegen/utils/StringUtils.java | 55 ++++++++++++++----- 2 files changed, 63 insertions(+), 16 deletions(-) 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 6d704fe9509..40954fb1fe5 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 @@ -4343,6 +4343,11 @@ public class DefaultCodegen implements CodegenConfig { return sanitizeName(name, removeCharRegEx, new ArrayList()); } + // A cache of sanitized words. The sanitizeName() method is invoked many times with the same + // arguments, this cache is used to optimized performance. + private static Map, String>>> sanitizedNames = + new HashMap, String>>>(); + /** * Sanitize name (parameter, property, method, etc) * @@ -4369,6 +4374,21 @@ public class DefaultCodegen implements CodegenConfig { return "value"; } + Map, String>> m1 = sanitizedNames.get(name); + if (m1 == null) { + m1 = new HashMap, String>>(); + sanitizedNames.put(name, m1); + } + Map, String> m2 = m1.get(removeCharRegEx); + if (m2 == null) { + m2 = new HashMap, String>(); + m1.put(removeCharRegEx, m2); + } + List l = Collections.unmodifiableList(exceptionList); + if (m2.containsKey(l)) { + return m2.get(l); + } + // input[] => input name = this.sanitizeValue(name, "\\[\\]", "", exceptionList); @@ -4404,7 +4424,7 @@ public class DefaultCodegen implements CodegenConfig { } else { name = name.replaceAll(removeCharRegEx, ""); } - + m2.put(l, name); return name; } @@ -5499,4 +5519,4 @@ public class DefaultCodegen implements CodegenConfig { public void setFeatureSet(final FeatureSet featureSet) { this.featureSet = featureSet == null ? DefaultFeatureSet : featureSet; } -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java index aa80e681d83..4179a1f5150 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/StringUtils.java @@ -3,10 +3,24 @@ package org.openapitools.codegen.utils; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.HashMap; import java.util.regex.Matcher; import java.util.regex.Pattern; public class StringUtils { + // A cache of camelized words. The camelize() method is invoked many times with the same + // arguments, this cache is used to optimized performance. + private static Map> camelizedWords = + new HashMap>(); + + // A cache of underscored words, used to optimize the performance of the underscore() method. + private static Map underscoreWords = new HashMap(); + + static { + camelizedWords.put(false, new HashMap()); + camelizedWords.put(true, new HashMap()); + } + /** * Underscore the given word. * Copied from Twitter elephant bird @@ -16,11 +30,15 @@ public class StringUtils { * @return The underscored version of the word */ public static String underscore(final String word) { + String result = underscoreWords.get(word); + if (result != null) { + return result; + } String firstPattern = "([A-Z]+)([A-Z][a-z])"; String secondPattern = "([a-z\\d])([A-Z])"; String replacementPattern = "$1_$2"; // Replace package separator with slash. - String result = word.replaceAll("\\.", "/"); + result = word.replaceAll("\\.", "/"); // Replace $ with two underscores for inner classes. result = result.replaceAll("\\$", "__"); // Replace capital letter with _ plus lowercase letter. @@ -30,6 +48,7 @@ public class StringUtils { // replace space with underscore result = result.replace(' ', '_'); result = result.toLowerCase(Locale.ROOT); + underscoreWords.put(word, result); return result; } @@ -55,6 +74,11 @@ public class StringUtils { return camelize(word, false); } + private static Pattern camelizeSlashPattern = Pattern.compile("\\/(.?)"); + private static Pattern camelizeUppercasePattern = Pattern.compile("(\\.?)(\\w)([^\\.]*)$"); + private static Pattern camelizeUnderscorePattern = Pattern.compile("(_)(.)"); + private static Pattern camelizeHyphenPattern = Pattern.compile("(-)(.)"); + /** * Camelize name (parameter, property, method, etc) * @@ -63,12 +87,16 @@ public class StringUtils { * @return camelized string */ public static String camelize(String word, boolean lowercaseFirstLetter) { + String inputWord = word; + String camelized = camelizedWords.get(lowercaseFirstLetter).get(word); + if (camelized != null) { + return camelized; + } // Replace all slashes with dots (package separator) - Pattern p = Pattern.compile("\\/(.?)"); - Matcher m = p.matcher(word); + Matcher m = camelizeSlashPattern.matcher(word); while (m.find()) { word = m.replaceFirst("." + m.group(1)/*.toUpperCase()*/); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. - m = p.matcher(word); + m = camelizeSlashPattern.matcher(word); } // case out dots @@ -81,15 +109,14 @@ public class StringUtils { } word = f.toString(); - m = p.matcher(word); + m = camelizeSlashPattern.matcher(word); while (m.find()) { word = m.replaceFirst("" + Character.toUpperCase(m.group(1).charAt(0)) + m.group(1).substring(1)/*.toUpperCase()*/); - m = p.matcher(word); + m = camelizeSlashPattern.matcher(word); } // Uppercase the class name. - p = Pattern.compile("(\\.?)(\\w)([^\\.]*)$"); - m = p.matcher(word); + m = camelizeUppercasePattern.matcher(word); if (m.find()) { String rep = m.group(1) + m.group(2).toUpperCase(Locale.ROOT) + m.group(3); rep = rep.replaceAll("\\$", "\\\\\\$"); @@ -97,8 +124,7 @@ public class StringUtils { } // Remove all underscores (underscore_case to camelCase) - p = Pattern.compile("(_)(.)"); - m = p.matcher(word); + m = camelizeUnderscorePattern.matcher(word); while (m.find()) { String original = m.group(2); String upperCase = original.toUpperCase(Locale.ROOT); @@ -107,15 +133,14 @@ public class StringUtils { } else { word = m.replaceFirst(upperCase); } - m = p.matcher(word); + m = camelizeUnderscorePattern.matcher(word); } // Remove all hyphens (hyphen-case to camelCase) - p = Pattern.compile("(-)(.)"); - m = p.matcher(word); + m = camelizeHyphenPattern.matcher(word); while (m.find()) { word = m.replaceFirst(m.group(2).toUpperCase(Locale.ROOT)); - m = p.matcher(word); + m = camelizeHyphenPattern.matcher(word); } if (lowercaseFirstLetter && word.length() > 0) { @@ -132,6 +157,8 @@ public class StringUtils { // remove all underscore word = word.replaceAll("_", ""); + // Add to the cache. + camelizedWords.get(lowercaseFirstLetter).put(inputWord, word); return word; } From 67e4cc8be1756d68ed828a20b3278e4921c50a80 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Mon, 3 Feb 2020 09:39:17 -0800 Subject: [PATCH 84/85] [Python] Python HTTP signature update (#5154) * improve python documentation and add import to __init__package.mustache * improve python documentation and add import to __init__package.mustache * add signing_info parameter conditionally * add code comments and remove 'Content-Length' header from example * Remove debug log statement * set access_token to None by default * set access_token to None by default * fix unit tests for Python experimental * fix trailing space --- .../codegen/DefaultGenerator.java | 6 +++ .../codegen/utils/ProcessUtils.java | 37 ++++++++++++- .../resources/python/configuration.mustache | 41 +++++++++++++-- .../__init__package.mustache | 3 ++ .../python-experimental/signing.mustache | 20 ++++++- .../petstore_api/configuration.py | 52 ++++--------------- .../petstore_api/configuration.py | 52 ++++--------------- .../python-experimental/tests/test_pet_api.py | 5 ++ .../petstore_api/configuration.py | 52 ++++--------------- .../python/petstore_api/configuration.py | 52 ++++--------------- .../petstore_api/__init__.py | 1 + .../petstore_api/configuration.py | 25 +++++++-- .../petstore_api/signing.py | 20 ++++++- .../python/petstore_api/configuration.py | 52 ++++--------------- 14 files changed, 199 insertions(+), 219 deletions(-) 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 2debd1ba7fa..774b5159b96 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 @@ -855,6 +855,12 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { bundle.put("hasHttpSignatureMethods", true); } + if (ProcessUtils.hasHttpBasicMethods(authMethods)) { + bundle.put("hasHttpBasicMethods", true); + } + if (ProcessUtils.hasApiKeyMethods(authMethods)) { + bundle.put("hasApiKeyMethods", true); + } } List servers = config.fromServers(openAPI.getServers()); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java index 499c1d55308..91b7b674d66 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java @@ -94,13 +94,48 @@ public class ProcessUtils { return false; } + /** + * Returns true if the specified OAS model has at least one operation with the HTTP basic + * security scheme. + * + * @param authMethods List of auth methods. + * @return True if at least one operation has HTTP basic security scheme defined + */ + public static boolean hasHttpBasicMethods(List authMethods) { + if (authMethods != null && !authMethods.isEmpty()) { + for (CodegenSecurity cs : authMethods) { + if (Boolean.TRUE.equals(cs.isBasicBasic)) { + return true; + } + } + } + return false; + } + + /** + * Returns true if the specified OAS model has at least one operation with API keys. + * + * @param authMethods List of auth methods. + * @return True if at least one operation has API key security scheme defined + */ + public static boolean hasApiKeyMethods(List authMethods) { + if (authMethods != null && !authMethods.isEmpty()) { + for (CodegenSecurity cs : authMethods) { + if (Boolean.TRUE.equals(cs.isApiKey)) { + return true; + } + } + } + return false; + } + /** * Returns true if the specified OAS model has at least one operation with the HTTP signature * security scheme. * The HTTP signature scheme is defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ * * @param authMethods List of auth methods. - * @return True if at least one operation has HTTP signature security schema defined + * @return True if at least one operation has HTTP signature security scheme defined */ public static boolean hasHttpSignatureMethods(List authMethods) { if (authMethods != null && !authMethods.isEmpty()) { diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 3e0a1567657..0645bc46755 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -31,11 +31,16 @@ class Configuration(object): The dict value is an API key prefix when generating the auth data. :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication - :param signing_info: Configuration parameters for HTTP signature. +{{#hasHttpSignatureMethods}} + :param signing_info: Configuration parameters for the HTTP signature security scheme. Must be an instance of {{{packageName}}}.signing.HttpSigningConfiguration +{{/hasHttpSignatureMethods}} +{{#hasAuthMethods}} :Example: +{{#hasApiKeyMethods}} + API Key Authentication Example. Given the following security scheme in the OpenAPI specification: components: securitySchemes: @@ -51,12 +56,32 @@ class Configuration(object): ) The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 +{{/hasApiKeyMethods}} +{{#hasHttpBasicMethods}} + + HTTP Basic Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: basic Configure API client with HTTP basic authentication: conf = {{{packageName}}}.Configuration( username='the-user', password='the-password', ) +{{/hasHttpBasicMethods}} +{{#hasHttpSignatureMethods}} + + HTTP Signature Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: signature Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time @@ -83,18 +108,22 @@ class Configuration(object): signing.HEADER_DATE, signing.HEADER_DIGEST, 'Content-Type', - 'Content-Length', 'User-Agent' ], signature_max_validity = datetime.timedelta(minutes=5) ) ) +{{/hasHttpSignatureMethods}} +{{/hasAuthMethods}} """ def __init__(self, host="{{{basePath}}}", api_key=None, api_key_prefix=None, username=None, password=None, - signing_info=None): +{{#hasHttpSignatureMethods}} + signing_info=None, +{{/hasHttpSignatureMethods}} + ): """Constructor """ self.host = host @@ -123,19 +152,21 @@ class Configuration(object): self.password = password """Password for HTTP basic authentication """ +{{#hasHttpSignatureMethods}} if signing_info is not None: signing_info.host = host self.signing_info = signing_info """The HTTP signing configuration """ +{{/hasHttpSignatureMethods}} {{#hasOAuthMethods}} - self.access_token = "" + self.access_token = None """access token for OAuth/Bearer """ {{/hasOAuthMethods}} {{^hasOAuthMethods}} {{#hasBearerMethods}} - self.access_token = "" + self.access_token = None """access token for OAuth/Bearer """ {{/hasBearerMethods}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache index b5224a5821e..1d74d016ab4 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__package.mustache @@ -20,6 +20,9 @@ from {{packageName}}.api_client import ApiClient # import Configuration from {{packageName}}.configuration import Configuration +{{#hasHttpSignatureMethods}} +from {{packageName}}.signing import HttpSigningConfiguration +{{/hasHttpSignatureMethods}} # import exceptions from {{packageName}}.exceptions import OpenApiException diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index d191bbf4852..300efa007bf 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -15,18 +15,35 @@ import re from six.moves.urllib.parse import urlencode, urlparse from time import mktime +# The constants below define a subset of HTTP headers that can be included in the +# HTTP signature scheme. Additional headers may be included in the signature. + +# The '(request-target)' header is a calculated field that includes the HTTP verb, +# the URL path and the URL query. HEADER_REQUEST_TARGET = '(request-target)' +# The time when the HTTP signature was generated. HEADER_CREATED = '(created)' +# The time when the HTTP signature expires. The API server should reject HTTP requests +# that have expired. HEADER_EXPIRES = '(expires)' +# The 'Host' header. HEADER_HOST = 'Host' +# The 'Date' header. HEADER_DATE = 'Date' -HEADER_DIGEST = 'Digest' # RFC 3230, include digest of the HTTP request body. +# When the 'Digest' header is included in the HTTP signature, the client automatically +# computes the digest of the HTTP request body, per RFC 3230. +HEADER_DIGEST = 'Digest' +# The 'Authorization' header is automatically generated by the client. It includes +# the list of signed headers and a base64-encoded signature. HEADER_AUTHORIZATION = 'Authorization' +# The constants below define the cryptographic schemes for the HTTP signature scheme. SCHEME_HS2019 = 'hs2019' SCHEME_RSA_SHA256 = 'rsa-sha256' SCHEME_RSA_SHA512 = 'rsa-sha512' +# The constants below define the signature algorithms that can be used for the HTTP +# signature scheme. ALGORITHM_RSASSA_PSS = 'RSASSA-PSS' ALGORITHM_RSASSA_PKCS1v15 = 'RSASSA-PKCS1-v1_5' @@ -364,5 +381,4 @@ class HttpSigningConfiguration(object): auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"".format( headers_value, signed_msg.decode('ascii')) - print("AUTH: {0}".format(auth_str)) return auth_str diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index 50cca10222c..82fd3361968 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -36,11 +36,10 @@ class Configuration(object): The dict value is an API key prefix when generating the auth data. :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication - :param signing_info: Configuration parameters for HTTP signature. - Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: + API Key Authentication Example. Given the following security scheme in the OpenAPI specification: components: securitySchemes: @@ -57,49 +56,25 @@ class Configuration(object): The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 + HTTP Basic Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: basic + Configure API client with HTTP basic authentication: conf = petstore_api.Configuration( username='the-user', password='the-password', ) - - Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, - sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time - of the signature to 5 minutes after the signature has been created. - Note you can use the constants defined in the petstore_api.signing module, and you can - also specify arbitrary HTTP headers to be included in the HTTP signature, except for the - 'Authorization' header, which is used to carry the signature. - - One may be tempted to sign all headers by default, but in practice it rarely works. - This is beccause explicit proxies, transparent proxies, TLS termination endpoints or - load balancers may add/modify/remove headers. Include the HTTP headers that you know - are not going to be modified in transit. - - conf = petstore_api.Configuration( - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) - ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username=None, password=None, - signing_info=None): + ): """Constructor """ self.host = host @@ -128,12 +103,7 @@ class Configuration(object): self.password = password """Password for HTTP basic authentication """ - if signing_info is not None: - signing_info.host = host - self.signing_info = signing_info - """The HTTP signing configuration - """ - self.access_token = "" + self.access_token = None """access token for OAuth/Bearer """ self.logger = {} diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index cf2819c1d06..faadfd56055 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -37,11 +37,10 @@ class Configuration(object): The dict value is an API key prefix when generating the auth data. :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication - :param signing_info: Configuration parameters for HTTP signature. - Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: + API Key Authentication Example. Given the following security scheme in the OpenAPI specification: components: securitySchemes: @@ -58,49 +57,25 @@ class Configuration(object): The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 + HTTP Basic Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: basic + Configure API client with HTTP basic authentication: conf = petstore_api.Configuration( username='the-user', password='the-password', ) - - Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, - sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time - of the signature to 5 minutes after the signature has been created. - Note you can use the constants defined in the petstore_api.signing module, and you can - also specify arbitrary HTTP headers to be included in the HTTP signature, except for the - 'Authorization' header, which is used to carry the signature. - - One may be tempted to sign all headers by default, but in practice it rarely works. - This is beccause explicit proxies, transparent proxies, TLS termination endpoints or - load balancers may add/modify/remove headers. Include the HTTP headers that you know - are not going to be modified in transit. - - conf = petstore_api.Configuration( - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) - ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username=None, password=None, - signing_info=None): + ): """Constructor """ self.host = host @@ -129,12 +104,7 @@ class Configuration(object): self.password = password """Password for HTTP basic authentication """ - if signing_info is not None: - signing_info.host = host - self.signing_info = signing_info - """The HTTP signing configuration - """ - self.access_token = "" + self.access_token = None """access token for OAuth/Bearer """ self.logger = {} diff --git a/samples/client/petstore/python-experimental/tests/test_pet_api.py b/samples/client/petstore/python-experimental/tests/test_pet_api.py index 9a0c4f76fa1..919d2505423 100644 --- a/samples/client/petstore/python-experimental/tests/test_pet_api.py +++ b/samples/client/petstore/python-experimental/tests/test_pet_api.py @@ -121,6 +121,11 @@ class PetApiTests(unittest.TestCase): self.assertIsNotNone(config.get_host_settings()) self.assertEqual(config.get_basic_auth_token(), urllib3.util.make_headers(basic_auth=":").get('authorization')) + # No authentication scheme has been configured at this point, so auth_settings() + # should return an empty list. + self.assertEqual(len(config.auth_settings()), 0) + # Configure OAuth2 access token and verify the auth_settings have OAuth2 parameters. + config.access_token = 'MY-ACCESS_TOKEN' self.assertEqual(len(config.auth_settings()), 1) self.assertIn("petstore_auth", config.auth_settings().keys()) config.username = "user" diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index cf2819c1d06..faadfd56055 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -37,11 +37,10 @@ class Configuration(object): The dict value is an API key prefix when generating the auth data. :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication - :param signing_info: Configuration parameters for HTTP signature. - Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: + API Key Authentication Example. Given the following security scheme in the OpenAPI specification: components: securitySchemes: @@ -58,49 +57,25 @@ class Configuration(object): The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 + HTTP Basic Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: basic + Configure API client with HTTP basic authentication: conf = petstore_api.Configuration( username='the-user', password='the-password', ) - - Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, - sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time - of the signature to 5 minutes after the signature has been created. - Note you can use the constants defined in the petstore_api.signing module, and you can - also specify arbitrary HTTP headers to be included in the HTTP signature, except for the - 'Authorization' header, which is used to carry the signature. - - One may be tempted to sign all headers by default, but in practice it rarely works. - This is beccause explicit proxies, transparent proxies, TLS termination endpoints or - load balancers may add/modify/remove headers. Include the HTTP headers that you know - are not going to be modified in transit. - - conf = petstore_api.Configuration( - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) - ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username=None, password=None, - signing_info=None): + ): """Constructor """ self.host = host @@ -129,12 +104,7 @@ class Configuration(object): self.password = password """Password for HTTP basic authentication """ - if signing_info is not None: - signing_info.host = host - self.signing_info = signing_info - """The HTTP signing configuration - """ - self.access_token = "" + self.access_token = None """access token for OAuth/Bearer """ self.logger = {} diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index cf2819c1d06..faadfd56055 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -37,11 +37,10 @@ class Configuration(object): The dict value is an API key prefix when generating the auth data. :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication - :param signing_info: Configuration parameters for HTTP signature. - Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: + API Key Authentication Example. Given the following security scheme in the OpenAPI specification: components: securitySchemes: @@ -58,49 +57,25 @@ class Configuration(object): The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 + HTTP Basic Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: basic + Configure API client with HTTP basic authentication: conf = petstore_api.Configuration( username='the-user', password='the-password', ) - - Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, - sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time - of the signature to 5 minutes after the signature has been created. - Note you can use the constants defined in the petstore_api.signing module, and you can - also specify arbitrary HTTP headers to be included in the HTTP signature, except for the - 'Authorization' header, which is used to carry the signature. - - One may be tempted to sign all headers by default, but in practice it rarely works. - This is beccause explicit proxies, transparent proxies, TLS termination endpoints or - load balancers may add/modify/remove headers. Include the HTTP headers that you know - are not going to be modified in transit. - - conf = petstore_api.Configuration( - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) - ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username=None, password=None, - signing_info=None): + ): """Constructor """ self.host = host @@ -129,12 +104,7 @@ class Configuration(object): self.password = password """Password for HTTP basic authentication """ - if signing_info is not None: - signing_info.host = host - self.signing_info = signing_info - """The HTTP signing configuration - """ - self.access_token = "" + self.access_token = None """access token for OAuth/Bearer """ self.logger = {} diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py index 2c9bc6e12f0..597e3243e31 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py @@ -30,6 +30,7 @@ from petstore_api.api_client import ApiClient # import Configuration from petstore_api.configuration import Configuration +from petstore_api.signing import HttpSigningConfiguration # import exceptions from petstore_api.exceptions import OpenApiException diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py index 99d8bac4b3d..cce89b13aca 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py @@ -37,11 +37,12 @@ class Configuration(object): The dict value is an API key prefix when generating the auth data. :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication - :param signing_info: Configuration parameters for HTTP signature. + :param signing_info: Configuration parameters for the HTTP signature security scheme. Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: + API Key Authentication Example. Given the following security scheme in the OpenAPI specification: components: securitySchemes: @@ -58,12 +59,28 @@ class Configuration(object): The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 + HTTP Basic Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: basic + Configure API client with HTTP basic authentication: conf = petstore_api.Configuration( username='the-user', password='the-password', ) + HTTP Signature Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: signature + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. @@ -89,7 +106,6 @@ class Configuration(object): signing.HEADER_DATE, signing.HEADER_DIGEST, 'Content-Type', - 'Content-Length', 'User-Agent' ], signature_max_validity = datetime.timedelta(minutes=5) @@ -100,7 +116,8 @@ class Configuration(object): def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username=None, password=None, - signing_info=None): + signing_info=None, + ): """Constructor """ self.host = host @@ -134,7 +151,7 @@ class Configuration(object): self.signing_info = signing_info """The HTTP signing configuration """ - self.access_token = "" + self.access_token = None """access token for OAuth/Bearer """ self.logger = {} diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py index da45fdf4b22..758f62fc0c2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py @@ -23,18 +23,35 @@ import re from six.moves.urllib.parse import urlencode, urlparse from time import mktime +# The constants below define a subset of HTTP headers that can be included in the +# HTTP signature scheme. Additional headers may be included in the signature. + +# The '(request-target)' header is a calculated field that includes the HTTP verb, +# the URL path and the URL query. HEADER_REQUEST_TARGET = '(request-target)' +# The time when the HTTP signature was generated. HEADER_CREATED = '(created)' +# The time when the HTTP signature expires. The API server should reject HTTP requests +# that have expired. HEADER_EXPIRES = '(expires)' +# The 'Host' header. HEADER_HOST = 'Host' +# The 'Date' header. HEADER_DATE = 'Date' -HEADER_DIGEST = 'Digest' # RFC 3230, include digest of the HTTP request body. +# When the 'Digest' header is included in the HTTP signature, the client automatically +# computes the digest of the HTTP request body, per RFC 3230. +HEADER_DIGEST = 'Digest' +# The 'Authorization' header is automatically generated by the client. It includes +# the list of signed headers and a base64-encoded signature. HEADER_AUTHORIZATION = 'Authorization' +# The constants below define the cryptographic schemes for the HTTP signature scheme. SCHEME_HS2019 = 'hs2019' SCHEME_RSA_SHA256 = 'rsa-sha256' SCHEME_RSA_SHA512 = 'rsa-sha512' +# The constants below define the signature algorithms that can be used for the HTTP +# signature scheme. ALGORITHM_RSASSA_PSS = 'RSASSA-PSS' ALGORITHM_RSASSA_PKCS1v15 = 'RSASSA-PKCS1-v1_5' @@ -372,5 +389,4 @@ class HttpSigningConfiguration(object): auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"".format( headers_value, signed_msg.decode('ascii')) - print("AUTH: {0}".format(auth_str)) return auth_str diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index 1bb8505ee8b..131534656e3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -37,11 +37,10 @@ class Configuration(object): The dict value is an API key prefix when generating the auth data. :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication - :param signing_info: Configuration parameters for HTTP signature. - Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: + API Key Authentication Example. Given the following security scheme in the OpenAPI specification: components: securitySchemes: @@ -58,49 +57,25 @@ class Configuration(object): The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 + HTTP Basic Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: basic + Configure API client with HTTP basic authentication: conf = petstore_api.Configuration( username='the-user', password='the-password', ) - - Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, - sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time - of the signature to 5 minutes after the signature has been created. - Note you can use the constants defined in the petstore_api.signing module, and you can - also specify arbitrary HTTP headers to be included in the HTTP signature, except for the - 'Authorization' header, which is used to carry the signature. - - One may be tempted to sign all headers by default, but in practice it rarely works. - This is beccause explicit proxies, transparent proxies, TLS termination endpoints or - load balancers may add/modify/remove headers. Include the HTTP headers that you know - are not going to be modified in transit. - - conf = petstore_api.Configuration( - signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) - ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username=None, password=None, - signing_info=None): + ): """Constructor """ self.host = host @@ -129,12 +104,7 @@ class Configuration(object): self.password = password """Password for HTTP basic authentication """ - if signing_info is not None: - signing_info.host = host - self.signing_info = signing_info - """The HTTP signing configuration - """ - self.access_token = "" + self.access_token = None """access token for OAuth/Bearer """ self.logger = {} From e45a1d03c0bad76e5db8528b5a6e47583688cfad Mon Sep 17 00:00:00 2001 From: Jonas Haag Date: Mon, 3 Feb 2020 19:42:11 +0100 Subject: [PATCH 85/85] Fix typo in jar URL on installation page (#5200) --- docs/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index ff84a2de771..a974db16c15 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -85,7 +85,7 @@ JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator For **Mac/Linux** users: ```bash -wget https//repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.3/openapi-generator-cli-4.2.3.jar -O openapi-generator-cli.jar +wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.3/openapi-generator-cli-4.2.3.jar -O openapi-generator-cli.jar ``` For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.